File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ method returns **false**:
107107 // ...
108108 }
109109
110+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
111+
110112Options
111113-------
112114
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ Then you can validate this method with ``IsTrue`` as follows:
111111
112112 If the ``isTokenValid() `` returns false, the validation will fail.
113113
114+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
115+
114116Options
115117-------
116118
Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ This will check if ``emailAddress`` is an instance of ``Symfony\Component\Mime\A
148148 The feature to define multiple types in the ``type `` option was introduced
149149 in Symfony 4.4.
150150
151+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
152+
151153Options
152154-------
153155
Original file line number Diff line number Diff line change 1+ .. note::
2+
3+ As with most of the other constraints, ``null`` is
4+ considered a valid value. This is to allow the use of optional values.
5+ If the value is mandatory, a common solution is to combine this constraint
6+ with :doc:`NotNull </ reference/constraints/NotNull> `.
You can’t perform that action at this time.
0 commit comments