Skip to content

Commit e463c1e

Browse files
author
Dorian Villet
committed
[OptionsResolver] Fix syntax errors in code examples (missing in_array closing slashes)
This pull request fixes 2 syntax errors when using `in_array()` in conditions (missing the last closing slash). It also adds a missing `use` statement in one code example.
1 parent cf7db08 commit e463c1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/options_resolver.rst

+3-2
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)