File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -1534,15 +1534,11 @@ protected function getEnv($name)
1534
1534
return $ value ;
1535
1535
}
1536
1536
1537
- $ envPlaceholders = $ bag ->getEnvPlaceholders ();
1538
- if (isset ($ envPlaceholders [$ name ][$ value ])) {
1539
- $ bag = new ParameterBag ($ bag ->all ());
1540
-
1541
- return $ bag ->unescapeValue ($ bag ->get ("env( $ name) " ));
1542
- }
1543
- foreach ($ envPlaceholders as $ env => $ placeholders ) {
1537
+ foreach ($ bag ->getEnvPlaceholders () as $ env => $ placeholders ) {
1544
1538
if (isset ($ placeholders [$ value ])) {
1545
- return $ this ->getEnv ($ env );
1539
+ $ bag = new ParameterBag ($ bag ->all ());
1540
+
1541
+ return $ bag ->unescapeValue ($ bag ->get ("env( $ name) " ));
1546
1542
}
1547
1543
}
1548
1544
Original file line number Diff line number Diff line change @@ -738,20 +738,6 @@ public function testDynamicEnv()
738
738
$ this ->assertSame ('someFooBar ' , $ container ->getParameter ('baz ' ));
739
739
}
740
740
741
- public function testFallbackEnv ()
742
- {
743
- putenv ('DUMMY_FOO=foo ' );
744
-
745
- $ container = new ContainerBuilder ();
746
- $ container ->setParameter ('foo ' , '%env(DUMMY_FOO)% ' );
747
- $ container ->setParameter ('bar ' , 'bar%env(default:foo:DUMMY_BAR)% ' );
748
-
749
- $ container ->compile (true );
750
- putenv ('DUMMY_FOO ' );
751
-
752
- $ this ->assertSame ('barfoo ' , $ container ->getParameter ('bar ' ));
753
- }
754
-
755
741
public function testCastEnv ()
756
742
{
757
743
$ container = new ContainerBuilder ();
You can’t perform that action at this time.
0 commit comments