Skip to content

Commit 69f9db3

Browse files
committed
[Validator] Mention IsNull in Basic Constraints
1 parent efd9cd0 commit 69f9db3

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

reference/constraints/IsFalse.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ method returns **false**:
107107
// ...
108108
}
109109
110+
.. include:: /reference/constraints/_null-values-are-valid.rst.inc
111+
110112
Options
111113
-------
112114

reference/constraints/IsTrue.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
114116
Options
115117
-------
116118

reference/constraints/Type.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
151153
Options
152154
-------
153155

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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>`.

0 commit comments

Comments
 (0)