@@ -16,7 +16,7 @@ class StoreBuilder
16
16
/**
17
17
* The file names to search for.
18
18
*
19
- * @var string[]
19
+ * @var string[]|null
20
20
*/
21
21
private $ names ;
22
22
@@ -30,13 +30,13 @@ class StoreBuilder
30
30
/**
31
31
* Create a new store builder instance.
32
32
*
33
- * @param string[] $paths
34
- * @param string[] $names
35
- * @param bool $shortCircuit
33
+ * @param string[] $paths
34
+ * @param string[]|null $names
35
+ * @param bool $shortCircuit
36
36
*
37
37
* @return void
38
38
*/
39
- private function __construct (array $ paths = [], array $ names = [] , $ shortCircuit = false )
39
+ private function __construct (array $ paths = [], array $ names = null , $ shortCircuit = false )
40
40
{
41
41
$ this ->paths = $ paths ;
42
42
$ this ->names = $ names ;
@@ -56,25 +56,25 @@ public static function create()
56
56
/**
57
57
* Creates a store builder with the given paths.
58
58
*
59
- * @param string[] $paths
59
+ * @param string|string [] $paths
60
60
*
61
61
* @return \Dotenv\Repository\RepositoryBuilder
62
62
*/
63
- public function withPaths (array $ paths )
63
+ public function withPaths ($ paths )
64
64
{
65
- return new self ($ paths , $ this ->names , $ this ->shortCircuit );
65
+ return new self (( array ) $ paths , $ this ->names , $ this ->shortCircuit );
66
66
}
67
67
68
68
/**
69
69
* Creates a store builder with the given names.
70
70
*
71
- * @param string[] $names
71
+ * @param string|string[]|null $names
72
72
*
73
73
* @return \Dotenv\Store\StoreBuilder
74
74
*/
75
- public function withNames (array $ names )
75
+ public function withNames ($ names = null )
76
76
{
77
- return new self ($ this ->paths , $ names , $ this ->shortCircuit );
77
+ return new self ($ this ->paths , $ names === null ? null : ( array ) $ names , $ this ->shortCircuit );
78
78
}
79
79
80
80
/**
@@ -95,7 +95,7 @@ public function shortCircuit()
95
95
public function make ()
96
96
{
97
97
return new FileStore (
98
- Paths::filePaths ($ this ->paths , $ this ->names ),
98
+ Paths::filePaths ($ this ->paths , $ this ->names === null ? [ ' .env ' ] : $ this -> names ),
99
99
$ this ->shortCircuit
100
100
);
101
101
}
0 commit comments