Skip to content

Commit ce979df

Browse files
committed
minor #7214 make strict the default option for choice validation (snoek09)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #7214). Discussion ---------- make strict the default option for choice validation This fixes #7171. Commits ------- 89d402c strict default option for choice validation
2 parents 88c24aa + 89d402c commit ce979df

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

reference/constraints/Choice.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,15 @@ too many options per the `max`_ option.
367367
strict
368368
~~~~~~
369369

370-
**type**: ``boolean`` **default**: ``false``
370+
**type**: ``boolean`` **default**: ``true``
371371

372-
If true, the validator will also check the type of the input value. Specifically,
372+
The validator will also check the type of the input value. Specifically,
373373
this value is passed to as the third argument to the PHP :phpfunction:`in_array`
374374
method when checking to see if a value is in the valid choices array.
375375

376+
.. caution::
377+
378+
Setting the strict option of the Choice Constraint to ``false`` has been
379+
deprecated as of Symfony 3.2 and the option will be changed to ``true`` as of 4.0.
380+
376381
.. include:: /reference/constraints/_payload-option.rst.inc

0 commit comments

Comments
 (0)