Skip to content

Commit 4ce3528

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [Validator] Allow single integer for the `versions` option of the `Uuid` constraint [Validator] Allow single constraint to be passed to the constraints option of the `When` constraint
2 parents 652cbe0 + d5c0003 commit 4ce3528

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

reference/constraints/Uuid.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ will allow alternate input formats like:
114114
``versions``
115115
~~~~~~~~~~~~
116116

117-
**type**: ``int[]`` **default**: ``[1,2,3,4,5,6,7,8]``
117+
**type**: ``int[]|int`` **default**: ``[1,2,3,4,5,6,7,8]``
118118

119119
This option can be used to only allow specific `UUID versions`_ (by default, all
120120
of them are allowed). Valid versions are 1 - 8. Instead of using numeric values,
@@ -133,6 +133,11 @@ you can also use the following PHP constants to refer to each UUID version:
133133

134134
UUID versions 7 and 8 were introduced in Symfony 6.2.
135135

136+
.. versionadded:: 6.4
137+
138+
Using a single integer instead of an integer array for this option
139+
was introduced in Symfony 6.4.
140+
136141
.. _`Universally unique identifier (UUID)`: https://en.wikipedia.org/wiki/Universally_unique_identifier
137142
.. _`RFC 4122`: https://tools.ietf.org/html/rfc4122
138143
.. _`UUID versions`: https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions

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)