Skip to content

Commit 54c6b50

Browse files
committed
minor #18446 [Validator] Allow single constraint to be passed to the constraints option of the When constraint (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [Validator] Allow single constraint to be passed to the constraints option of the `When` constraint Fix #18444 Commits ------- 92642ca [Validator] Allow single constraint to be passed to the constraints option of the `When` constraint
2 parents 123f998 + 92642ca commit 54c6b50

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)