[Dotenv] Make load() variadic

This commit is contained in:
Robin Chalas 2017-06-20 22:35:44 +02:00
parent 407631c682
commit 408a33e99b

View File

@ -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);
}