From de9d744659fce8cc413f3fe20679d448e0c6e0c6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 28 Feb 2020 17:53:15 +0100 Subject: [PATCH] [Validator] Document the alpha3 option of Language --- reference/constraints/Country.rst | 10 +++++----- reference/constraints/Language.rst | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/reference/constraints/Country.rst b/reference/constraints/Country.rst index c8ba898cd46..744de6dd0fb 100644 --- a/reference/constraints/Country.rst +++ b/reference/constraints/Country.rst @@ -77,8 +77,6 @@ Basic Usage Options ------- -.. include:: /reference/constraints/_groups-option.rst.inc - alpha3 ~~~~~~ @@ -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`` ~~~~~~~~~~~ diff --git a/reference/constraints/Language.rst b/reference/constraints/Language.rst index 70d1e2e51cc..7d58491c416 100644 --- a/reference/constraints/Language.rst +++ b/reference/constraints/Language.rst @@ -6,7 +6,8 @@ Validates that a value is a valid language *Unicode language identifier* ========== =================================================================== Applies to :ref:`property or method ` -Options - `groups`_ +Options - `alpha3`_ + - `groups`_ - `message`_ - `payload`_ Class :class:`Symfony\\Component\\Validator\\Constraints\\Language` @@ -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`` @@ -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