8000 [Dotenv] Make load() variadic · symfony/symfony@408a33e · GitHub
[go: up one dir, main page]

Skip to content

Commit 408a33e

Browse files
committed
[Dotenv] Make load() variadic
1 parent 407631c commit 408a33e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Component/Dotenv/Dotenv.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ final class Dotenv
4545
* @throws FormatException when a file has a syntax error
4646
* @throws PathException when a file does not exist or is not readable
4747
*/
48-
public function load($path/*, ...$paths*/)
48+
public function load($path, ...$paths)
4949
{
50-
// func_get_args() to be replaced by a variadic argument for Symfony 4.0
51-
foreach (func_get_args() as $path) {
50+
array_unshift($paths, $path);
51+
52+
foreach ($paths as $path) {
5253
if (!is_readable($path) || is_dir($path)) {
5354
throw new PathException($path);
5455
}

0 commit comments

Comments
 (0)
0