Skip to content

Commit b3964c7

Browse files
committed
validate null (Expression constraint in 2.6)
Since Symfony 2.6, the Expression constraint doesn't skip validating `null` values.
1 parent 1ea6304 commit b3964c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

reference/constraints/Expression.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ more about the expression language syntax, see
217217
// ...
218218
}
219219
220+
.. versionadded:: 2.6
221+
In Symfony 2.6, the Expression constraint *is* executed if the value
222+
is ``null``. Before 2.6, if the value was ``null``, the expression
223+
was never executed and the value was considered valid (unless you
224+
also had a constraint like `NotBlank` on the property).
225+
220226
For more information about the expression and what variables are available
221227
to you, see the :ref:`expression <reference-constraint-expression-option>`
222228
option details below.

0 commit comments

Comments
 (0)