diff --git a/components/options_resolver.rst b/components/options_resolver.rst index d6823b5b124..5aea9f45d79 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -199,6 +199,7 @@ value you guess based on the host. You can do that easily by using a Closure as the default value:: use Symfony\Component\OptionsResolver\Options; + use Symfony\Component\OptionsResolver\OptionsResolverInterface; // ... protected function setDefaultOptions(OptionsResolverInterface $resolver) @@ -207,7 +208,7 @@ Closure as the default value:: $resolver->setDefaults(array( 'port' => function (Options $options) { - if (in_array($options['host'], array('127.0.0.1', 'localhost')) { + if (in_array($options['host'], array('127.0.0.1', 'localhost'))) { return 80; } @@ -305,7 +306,7 @@ need to use the other options for normalizing:: $resolver->setNormalizers(array( 'host' => function (Options $options, $value) { - if (!in_array(substr($value, 0, 7), array('http://', 'https://')) { + if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) { if ($options['ssl']) { $value = 'https://'.$value; } else {