Skip to content

[Validator] Allow single integer for the versions option of the Uuid constraint #18447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion reference/constraints/Uuid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ will allow alternate input formats like:
``versions``
~~~~~~~~~~~~

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

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

UUID versions 7 and 8 were introduced in Symfony 6.2.

.. versionadded:: 6.4

Using a single integer instead of an integer array for this option
was introduced in Symfony 6.4.

.. _`Universally unique identifier (UUID)`: https://en.wikipedia.org/wiki/Universally_unique_identifier
.. _`RFC 4122`: https://tools.ietf.org/html/rfc4122
.. _`UUID versions`: https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions