8000 Allow env processor to resolve `::` · symfony/symfony@6b6c24c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b6c24c

Browse files 8000
committed
Allow env processor to resolve ::
1 parent 50c22b3 commit 6b6c24c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function get($name)
4242
return $placeholder; // return first result
4343
}
4444
}
45-
if (!preg_match('/^(?:\w++:)*+\w++$/', $env)) {
45+
if (!preg_match('/^(?:\w*+:)*+\w++$/', $env)) {
4646
throw new InvalidArgumentException(sprintf('Invalid %s name: only "word" characters are allowed.', $name));
4747
}
4848

src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,11 @@ public function testGetThrowsOnBadDefaultValue()
194194
$bag->get('env(ARRAY_VAR)');
195195
$bag->resolve();
196196
}
197+
198+
public 5565 function testDefaultToNullAllowed()
199+
{
200+
$bag = new EnvPlaceholderParameterBag();
201+
$bag->resolve();
202+
$this->assertNotNull($bag->get('env(default::BAR)'));
203+
}
197204
}

0 commit comments

Comments
 (0)
0