Skip to content

Commit 5c82e99

Browse files
committed
feature #13280 [Validator] Document the alpha3 option of Language (javiereguiluz)
This PR was squashed before being merged into the master branch. Discussion ---------- [Validator] Document the alpha3 option of Language Fixes #13236. Commits ------- de9d744 [Validator] Document the alpha3 option of Language
2 parents 09e9d56 + de9d744 commit 5c82e99

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

reference/constraints/Country.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ Basic Usage
7777
Options
7878
-------
7979

80-
.. include:: /reference/constraints/_groups-option.rst.inc
81-
8280
alpha3
8381
~~~~~~
8482

@@ -88,9 +86,11 @@ alpha3
8886

8987
**type**: ``boolean`` **default**: ``false``
9088

91-
If this option is ``true``, then the constraint will valid the value as
92-
`ISO 3166-1 alpha-3`_ three-letter codes (e.g. France = ``FRA``) instead
93-
of the default `ISO 3166-1 alpha-2`_ two-letter codes (e.g. France = ``FR``).
89+
If this option is ``true``, the constraint checks that the value is a
90+
`ISO 3166-1 alpha-3`_ three-letter code (e.g. France = ``FRA``) instead
91+
of the default `ISO 3166-1 alpha-2`_ two-letter code (e.g. France = ``FR``).
92+
93+
.. include:: /reference/constraints/_groups-option.rst.inc
9494

9595
``message``
9696
~~~~~~~~~~~

reference/constraints/Language.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Validates that a value is a valid language *Unicode language identifier*
66

77
========== ===================================================================
88
Applies to :ref:`property or method <validation-property-target>`
9-
Options - `groups`_
9+
Options - `alpha3`_
10+
- `groups`_
1011
- `message`_
1112
- `payload`_
1213
Class :class:`Symfony\\Component\\Validator\\Constraints\\Language`
@@ -77,6 +78,19 @@ Basic Usage
7778
Options
7879
-------
7980

81+
alpha3
82+
~~~~~~
83+
84+
.. versionadded:: 5.1
85+
86+
The ``alpha3`` option was introduced in Symfony 5.1.
87+
88+
**type**: ``boolean`` **default**: ``false``
89+
90+
If this option is ``true``, the constraint checks that the value is a
91+
`ISO 639-2`_ three-letter code (e.g. French = ``fra``) instead of the default
92+
`ISO 639-1`_ two-letter code (e.g. French = ``fr``).
93+
8094
.. include:: /reference/constraints/_groups-option.rst.inc
8195

8296
``message``
@@ -95,3 +109,6 @@ Parameter Description
95109
=============== ==============================================================
96110

97111
.. include:: /reference/constraints/_payload-option.rst.inc
112+
113+
.. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
114+
.. _`ISO 639-2`: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

0 commit comments

Comments
 (0)