Skip to content

Commit

Permalink
Merge branch '5.2' into 5.x
Browse files Browse the repository at this point in the history
* 5.2:
  Standardize built-in normalizers lists
  • Loading branch information
javiereguiluz committed Apr 6, 2021
2 parents aa5af88 + a00d33c commit e4f37c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,9 @@ The Serializer component provides several built-in normalizers:
:class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
Normalizes errors according to the API Problem spec `RFC 7807`_.

:class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer`
Normalizes a PHP object using an object that implements :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`.

:class:`Symfony\\Component\\Serializer\\Normalizer\\UidNormalizer`
This normalizer converts objects that implement
:class:`Symfony\\Component\\Uid\\AbstractUid` into strings.
Expand Down
16 changes: 9 additions & 7 deletions serializer/normalizers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Symfony includes the following normalizers but you can also
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to
normalize PHP object using the :doc:`PropertyAccess component </components/property_access>`;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer`
for :phpclass:`DateTimeZone` objects
for :phpclass:`DateTimeZone` objects;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
objects implementing the :phpclass:`DateTimeInterface` interface
objects implementing the :phpclass:`DateTimeInterface` interface;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
for :phpclass:`DateInterval` objects
for :phpclass:`DateInterval` objects;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
transform :phpclass:`SplFileInfo` objects in `Data URIs`_;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to
normalize PHP object using an object that implements
:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`;
Expand All @@ -43,11 +43,13 @@ Symfony includes the following normalizers but you can also
* :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to
normalize PHP object using the getter and setter methods of the object;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` to
normalize PHP object using `PHP reflection`_.
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface
normalize PHP object using `PHP reflection`_;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
to deal with objects implementing the :phpclass:`JsonSerializable` interface
to deal with objects implementing the :phpclass:`JsonSerializable` interface;
* :class:`Symfony\\Component\\Serializer\\Normalizer\\UidNormalizer` converts objects that implement :class:`Symfony\\Component\\Uid\\AbstractUid` into strings and denormalizes uuid or ulid strings to :class:`Symfony\\Component\\Uid\\Uuid` or :class:`Symfony\\Component\\Uid\\Ulid`.


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

0 comments on commit e4f37c2

Please sign in to comment.