Skip to content

Commit 0bc1cc7

Browse files
snake77sexabbuh
authored andcommitted
Update options_resolver.rst
1 parent 788950a commit 0bc1cc7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

components/options_resolver.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,11 @@ is thrown::
403403
For options with more complicated validation schemes, pass a closure which
404404
returns ``true`` for acceptable values and ``false`` for invalid values::
405405

406-
$resolver->setAllowedValues(array(
407-
// ...
408-
$resolver->setAllowedValues('transport', function ($value) {
409-
// return true or false
410-
});
411-
));
406+
407+
// ...
408+
$resolver->setAllowedValues('transport', function ($value) {
409+
// return true or false
410+
});
412411

413412
In sub-classes, you can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::addAllowedValues`
414413
to add additional allowed values without erasing the ones already set.

0 commit comments

Comments
 (0)