Skip to content

Commit 8231230

Browse files
committed
Fix according to PR comments
1 parent 94fe8dc commit 8231230

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

components/options_resolver.rst

+9-6
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,11 @@ There is also an
305305
method, which you can use if you want to add an allowed value to the previously
306306
set allowed values.
307307

308-
If you need to add some more logic to the value validation process you can pass a callable
308+
.. versionadded:: 2.5
309+
310+
The callback support for allowed values was introduced in Symfony 2.5.
311+
312+
If you need to add some more logic to the value validation process, you can pass a callable
309313
as an allowed value::
310314

311315
// ...
@@ -315,15 +319,14 @@ as an allowed value::
315319

316320
$resolver->setAllowedValues(array(
317321
'transport' => function($value) {
318-
return strpos($value, 'mail') !== false;
319-
}
322+
return false !== strpos($value, 'mail');
323+
},
320324
));
321325
}
322326

323-
Note that using this together with addAllowedValues will not work.
327+
.. caution::
324328

325-
.. versionadded:: 2.5
326-
The callback support for allowed values was added in Symfony 2.5.
329+
Note that using this together with ``addAllowedValues`` will not work.
327330

328331
Configure allowed Types
329332
~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)