Allow env processor to resolve ::

This commit is contained in:
Jérémy Derussé 2019-04-07 20:27:31 +02:00
parent 50c22b3d58
commit 6b6c24c618
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
2 changed files with 8 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class EnvPlaceholderParameterBag extends ParameterBag
return $placeholder; // return first result
}
}
if (!preg_match('/^(?:\w++:)*+\w++$/', $env)) {
if (!preg_match('/^(?:\w*+:)*+\w++$/', $env)) {
throw new InvalidArgumentException(sprintf('Invalid %s name: only "word" characters are allowed.', $name));
}

View File

@ -194,4 +194,11 @@ class EnvPlaceholderParameterBagTest extends TestCase
$bag->get('env(ARRAY_VAR)');
$bag->resolve();
}
public function testDefaultToNullAllowed()
{
$bag = new EnvPlaceholderParameterBag();
$bag->resolve();
$this->assertNotNull($bag->get('env(default::BAR)'));
}
}