Skip to content

Commit 92642ca

Browse files
[Validator] Allow single constraint to be passed to the constraints option of the When constraint
1 parent 123f998 commit 92642ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reference/constraints/When.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,13 @@ You can also pass custom variables using the `values`_ option.
271271
``constraints``
272272
~~~~~~~~~~~~~~~
273273

274-
**type**: ``array``
274+
**type**: ``array|Constraint``
275275

276-
The constraints that are applied if the expression returns true.
276+
One or multiple constraints that are applied if the expression returns true.
277+
278+
.. versionadded:: 6.4
279+
280+
Passing a single ``Constraint`` instead of an array was introduced in Symfony 6.4.
277281

278282
.. include:: /reference/constraints/_groups-option.rst.inc
279283

0 commit comments

Comments
 (0)