Skip to content

Commit 7a0df5e

Browse files
committed
Merge pull request symfony#3053 from gnutix/2.1
[OptionsResolver] Fix syntax errors in code examples (missing in_array closing slashes)
2 parents ea8db68 + e463c1e commit 7a0df5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/options_resolver.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ value you guess based on the host. You can do that easily by using a
199199
Closure as the default value::
200200

201201
use Symfony\Component\OptionsResolver\Options;
202+
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
202203

203204
// ...
204205
protected function setDefaultOptions(OptionsResolverInterface $resolver)
@@ -207,7 +208,7 @@ Closure as the default value::
207208

208209
$resolver->setDefaults(array(
209210
'port' => function (Options $options) {
210-
if (in_array($options['host'], array('127.0.0.1', 'localhost')) {
211+
if (in_array($options['host'], array('127.0.0.1', 'localhost'))) {
211212
return 80;
212213
}
213214
@@ -305,7 +306,7 @@ need to use the other options for normalizing::
305306

306307
$resolver->setNormalizers(array(
307308
'host' => function (Options $options, $value) {
308-
if (!in_array(substr($value, 0, 7), array('http://', 'https://')) {
309+
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
309310
if ($options['ssl']) {
310311
$value = 'https://'.$value;
311312
} else {

0 commit comments

Comments
 (0)