8000 minor #13326 Add missing built-in normalizers (l-vo) · symfony/symfony-docs@9890f2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 9890f2d

Browse files
committed
minor #13326 Add missing built-in normalizers (l-vo)
This PR was merged into the 3.4 branch. Discussion ---------- Add missing built-in normalizers Commits ------- cd379f2 Add missing buit-in normalizers
2 parents 903b1b4 + cd379f2 commit 9890f2d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

serializer.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ As well as the following normalizers:
103103
handle typical data objects
104104
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
105105
objects implementing the :phpclass:`DateTimeInterface` interface
106+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer` for :phpclass:`DateInterval` objects
106107
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
107108
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
108109
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
109110
to deal with objects implementing the :phpclass:`JsonSerializable` interface
110111
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to
111112
denormalize arrays of objects using a format like `MyObject[]` (note the `[]` suffix)
112113

114+
.. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
115+
113116
Custom normalizers and/or encoders can also be loaded by tagging them as
114117
:ref:`serializer.normalizer <reference-dic-tags-serializer-normalizer>` and
115118
:ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also

serializer/normalizers.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ Symfony includes the following normalizers but you can also
2626

2727
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to
2828
normalize PHP object using the :doc:`PropertyAccessor component </components/property_access>`;
29+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
30+
objects implementing the :phpclass:`DateTimeInterface` interface
31+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer` for :phpclass:`DateInterval` objects
32+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
33+
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
2934
* :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to
3035
normalize PHP object using an object that implements
3136
:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`;
3237
* :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to
3338
normalize PHP object using the getter and setter methods of the object;
3439
* :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` to
3540
normalize PHP object using `PHP reflection`_.
41+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
42+
to deal with objects implementing the :phpclass:`JsonSerializable` interface
3643

44+
.. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
3745
.. _`PHP reflection`: https://php.net/manual/en/book.reflection.php

0 commit comments

Comments
 (0)
0