Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 135c5ff

Browse filesBrowse files
Minor fixes
1 parent b0b1498 commit 135c5ff
Copy full SHA for 135c5ff

File tree

1 file changed

+9
-12
lines changed
Filter options

1 file changed

+9
-12
lines changed

‎reference/constraints/Timezone.rst

Copy file name to clipboardExpand all lines: reference/constraints/Timezone.rst
+9-12Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Timezone
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
========== ===================================================================
77
Applies to :ref:`property or method <validation-property-target>`
@@ -15,8 +15,8 @@ Validator :class:`Symfony\\Component\\Validator\\Constraints\\TimezoneValidato
1515
Basic 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
9086
message
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

9793
You can use the following parameters in this message:
9894

@@ -107,7 +103,7 @@ Parameter Description
107103
zone
108104
~~~~
109105

110-
**type**: ``string`` **default**: ``\DateTimeZone::ALL.``
106+
**type**: ``string`` **default**: ``\DateTimeZone::ALL``
111107

112108
The 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

123119
The ``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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.