From 408a33e99b285ee50d78cbf55f131d0198e48dca Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 20 Jun 2017 22:35:44 +0200 Subject: [PATCH] [Dotenv] Make load() variadic --- src/Symfony/Component/Dotenv/Dotenv.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Dotenv/Dotenv.php b/src/Symfony/Component/Dotenv/Dotenv.php index 1e665fb537a70..1c4c2fd2128dd 100644 --- a/src/Symfony/Component/Dotenv/Dotenv.php +++ b/src/Symfony/Component/Dotenv/Dotenv.php @@ -45,10 +45,11 @@ final class Dotenv * @throws FormatException when a file has a syntax error * @throws PathException when a file does not exist or is not readable */ - public function load($path/*, ...$paths*/) + public function load($path, ...$paths) { - // func_get_args() to be replaced by a variadic argument for Symfony 4.0 - foreach (func_get_args() as $path) { + array_unshift($paths, $path); + + foreach ($paths as $path) { if (!is_readable($path) || is_dir($path)) { throw new PathException($path); }