Skip to content

Commit 434d240

Browse files
committed
Merge branch '4.4'
* 4.4: Add docs for DateTimeZoneNormalizer
2 parents 4b2d764 + e0e6116 commit 434d240

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

components/serializer.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,14 @@ There are several types of normalizers available:
715715
:phpclass:`DateTime` and :phpclass:`DateTimeImmutable`) into strings.
716716
By default, it uses the `RFC3339`_ format.
717717

718+
:class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer`
719+
This normalizer converts :phpclass:`DateTimeZone` objects into strings that
720+
represent the name of the timezone according to the `list of PHP timezones`_.
721+
722+
.. versionadded:: 4.3
723+
724+
The ``DateTimeZoneNormalizer`` was introduced in Symfony 4.3.
725+
718726
:class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer`
719727
This normalizer converts :phpclass:`SplFileInfo` objects into a data URI
720728
string (``data:...``) such that files can be embedded into serialized data.
@@ -1462,3 +1470,4 @@ Learn more
14621470
.. _`RFC 7807`: https://tools.ietf.org/html/rfc7807
14631471
.. _`Value Objects`: https://en.wikipedia.org/wiki/Value_object
14641472
.. _`API Platform`: https://api-platform.com
1473+
.. _`list of PHP timezones`: https://www.php.net/manual/en/timezones.php

serializer.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,19 @@ As well as the following normalizers:
6161
handle typical data objects
6262
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
6363
objects implementing the :phpclass:`DateTimeInterface` interface
64+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer` for
65+
:phpclass:`DateTimeZone` objects
6466
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
6567
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
6668
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
6769
to deal with objects implementing the :phpclass:`JsonSerializable` interface
6870
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to
6971
denormalize arrays of objects using a format like `MyObject[]` (note the `[]` suffix)
7072

73+
.. versionadded:: 4.3
74+
75+
The ``DateTimeZoneNormalizer`` was introduced in Symfony 4.3.
76+
7177
Custom normalizers and/or encoders can also be loaded by tagging them as
7278
:ref:`serializer.normalizer <reference-dic-tags-serializer-normalizer>` and
7379
:ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also

0 commit comments

Comments
 (0)