-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Using a optional option with a normalizer creates this option on resolve.
This looks unexpected behavior.
Test case for in Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php:
public function testNormalizersTransformWithOptionalOption()
{
$this->resolver->setOptional(array(
'foo'
));
$this->resolver->setNormalizers(array(
'foo' => function (Options $options, $value) {
return strtoupper($value);
},
));
$this->assertEquals(array('foo' => 'BAR'), $this->resolver->resolve(array('foo' => 'bar')));
$this->assertEquals(array(), $this->resolver->resolve(array()));
}
Is this related to #5104 ?