File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 41
41
"symfony/routing" : " ^5.1" ,
42
42
"symfony/var-dumper" : " ^5.1" ,
43
43
"tijsverkoyen/css-to-inline-styles" : " ^2.2.2" ,
44
- "vlucas/phpdotenv" : " ^4 .0" ,
44
+ "vlucas/phpdotenv" : " ^5 .0" ,
45
45
"voku/portable-ascii" : " ^1.4.8"
46
46
},
47
47
"replace" : {
Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminate \Support ;
4
4
5
- use Dotenv \Repository \Adapter \EnvConstAdapter ;
6
5
use Dotenv \Repository \Adapter \PutenvAdapter ;
7
- use Dotenv \Repository \Adapter \ServerConstAdapter ;
8
6
use Dotenv \Repository \RepositoryBuilder ;
9
7
use PhpOption \Option ;
10
8
@@ -54,16 +52,13 @@ public static function disablePutenv()
54
52
public static function getRepository ()
55
53
{
56
54
if (static ::$ repository === null ) {
57
- $ adapters = array_merge (
58
- [new EnvConstAdapter , new ServerConstAdapter ],
59
- static ::$ putenv ? [new PutenvAdapter ] : []
60
- );
55
+ $ builder = RepositoryBuilder::createWithDefaultAdapters ();
61
56
62
- static ::$ repository = RepositoryBuilder:: create ()
63
- -> withReaders ( $ adapters )
64
- -> withWriters ( $ adapters )
65
- -> immutable ()
66
- ->make ();
57
+ if ( static ::$ putenv ) {
58
+ $ builder = $ builder -> addAdapter (PutenvAdapter::class);
59
+ }
60
+
61
+ static :: $ repository = $ builder -> immutable () ->make ();
67
62
}
68
63
69
64
return static ::$ repository ;
Original file line number Diff line number Diff line change 45
45
"ramsey/uuid" : " Required to use Str::uuid() (^4.0)." ,
46
46
"symfony/process" : " Required to use the composer class (^5.1)." ,
47
47
"symfony/var-dumper" : " Required to use the dd function (^5.1)." ,
48
- "vlucas/phpdotenv" : " Required to use the Env class and env helper (^4 .0)."
48
+ "vlucas/phpdotenv" : " Required to use the Env class and env helper (^5 .0)."
49
49
},
50
50
"config" : {
51
51
"sort-packages" : true
Original file line number Diff line number Diff line change @@ -637,11 +637,11 @@ public function testEnvEscapedString()
637
637
$ this ->assertSame ('x"null"x ' , env ('foo ' ));
638
638
}
639
639
640
- public function testGetFromENVFirst ()
640
+ public function testGetFromSERVERFirst ()
641
641
{
642
642
$ _ENV ['foo ' ] = 'From $_ENV ' ;
643
643
$ _SERVER ['foo ' ] = 'From $_SERVER ' ;
644
- $ this ->assertSame ('From $_ENV ' , env ('foo ' ));
644
+ $ this ->assertSame ('From $_SERVER ' , env ('foo ' ));
645
645
}
646
646
647
647
public function providesPregReplaceArrayData ()
You can’t perform that action at this time.
0 commit comments