11Timezone
22========
33
4- Validates that a value is a valid timezone identifier (ie . ``Europe/Paris ``).
4+ Validates that a value is a valid timezone identifier (e.g . ``Europe/Paris ``).
55
66========== ===================================================================
77Applies to :ref: `property or method <validation-property-target >`
@@ -15,8 +15,8 @@ Validator :class:`Symfony\\Component\\Validator\\Constraints\\TimezoneValidato
1515Basic Usage
1616-----------
1717
18- Suppose you have a ``UserSettings `` class, with a ``timezone `` field that is a string
19- meant to contain a timezone identifier (ie. `America/New_York `):
18+ Suppose you have a ``UserSettings `` class, with a ``timezone `` field that is a
19+ string meant to contain a timezone identifier (ie. `` America/New_York ` `):
2020
2121.. configuration-block ::
2222
@@ -31,7 +31,6 @@ meant to contain a timezone identifier (ie. `America/New_York`):
3131 {
3232 /**
3333 * @Assert\Timezone
34- * @var string A timezone identifier
3534 */
3635 protected $timezone;
3736 }
@@ -69,9 +68,6 @@ meant to contain a timezone identifier (ie. `America/New_York`):
6968
7069 class Event
7170 {
72- /**
73- * @var string A timezone identifier
74- */
7571 protected $timezone;
7672
7773 public static function loadValidatorMetadata(ClassMetadata $metadata)
@@ -90,9 +86,9 @@ Options
9086message
9187~~~~~~~
9288
93- **type **: ``string `` **default **: ``This value is not a valid time . ``
89+ **type **: ``string `` **default **: ``This value is not a valid timezone . ``
9490
95- This message is shown if the underlying data is not a valid time .
91+ This message is shown if the underlying data is not a valid timezone identifier .
9692
9793You can use the following parameters in this message:
9894
@@ -107,7 +103,7 @@ Parameter Description
107103zone
108104~~~~
109105
110- **type **: ``string `` **default **: ``\DateTimeZone::ALL. ``
106+ **type **: ``string `` **default **: ``\DateTimeZone::ALL ``
111107
112108The geographical zone in which to validate the timezone identifier.
113109
@@ -122,6 +118,7 @@ This option must be used only when the ``zone`` option value equals ``\DateTimeZ
122118
123119The ``countryCode `` option enables to validate the timezone identifier is supported by the country code.
124120
125- Value must be a valid `ISO 3166-1 alpha-2 ` country code (ie. ` BE `).
121+ Value must be a valid `ISO 3166-1 alpha-2 `_ country code (e.g. `` BE ` `).
126122
127- .. _DateTimeZone : https://www.php.net/datetimezone
123+ .. _`DateTimeZone` : https://www.php.net/datetimezone
124+ .. _`ISO 3166-1 alpha-2` : https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
0 commit comments