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**:
107
107
// ...
108
108
}
109
109
110
+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
111
+
110
112
Options
111
113
-------
112
114
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ Then you can validate this method with ``IsTrue`` as follows:
111
111
112
112
If the ``isTokenValid() `` returns false, the validation will fail.
113
113
114
+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
115
+
114
116
Options
115
117
-------
116
118
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
148
148
The feature to define multiple types in the ``type `` option was introduced
149
149
in Symfony 4.4.
150
150
151
+ .. include :: /reference/constraints/_null-values-are-valid.rst.inc
152
+
151
153
Options
152
154
-------
153
155
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