Skip to content

[Validator] Document the alpha3 option of Language #13280

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
Mar 3, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions reference/constraints/Country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ Basic Usage
Options
-------

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

alpha3
~~~~~~

Expand All @@ -88,9 +86,11 @@ alpha3

**type**: ``boolean`` **default**: ``false``

If this option is ``true``, then the constraint will valid the value as
`ISO 3166-1 alpha-3`_ three-letter codes (e.g. France = ``FRA``) instead
of the default `ISO 3166-1 alpha-2`_ two-letter codes (e.g. France = ``FR``).
If this option is ``true``, the constraint checks that the value is a
`ISO 3166-1 alpha-3`_ three-letter code (e.g. France = ``FRA``) instead
of the default `ISO 3166-1 alpha-2`_ two-letter code (e.g. France = ``FR``).

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

``message``
~~~~~~~~~~~
Expand Down
19 changes: 18 additions & 1 deletion reference/constraints/Language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Validates that a value is a valid language *Unicode language identifier*

========== ===================================================================
Applies to :ref:`property or method <validation-property-target>`
Options - `groups`_
Options - `alpha3`_
- `groups`_
- `message`_
- `payload`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\Language`
Expand Down Expand Up @@ -77,6 +78,19 @@ Basic Usage
Options
-------

alpha3
~~~~~~

.. versionadded:: 5.1

The ``alpha3`` option was introduced in Symfony 5.1.

**type**: ``boolean`` **default**: ``false``

If this option is ``true``, the constraint checks that the value is a
`ISO 639-2`_ three-letter code (e.g. French = ``fra``) instead of the default
`ISO 639-1`_ two-letter code (e.g. French = ``fr``).

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

``message``
Expand All @@ -95,3 +109,6 @@ Parameter Description
=============== ==============================================================

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 639-2`: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes