Skip to content

Commit af29c1e

Browse files
committed
Remove duplicate normalizers docs
1 parent a113e73 commit af29c1e

File tree

4 files changed

+34
-59
lines changed

4 files changed

+34
-59
lines changed

components/serializer.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ There are several types of normalizers available:
719719
:class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
720720
This normalizer directly reads and writes public properties as well as
721721
**private and protected** properties (from both the class and all of its
722-
parent classes). It supports calling the constructor during the denormalization process.
722+
parent classes) by using `PHP reflection`_. It supports calling the constructor
723+
during the denormalization process.
723724

724725
Objects are normalized to a map of property names to property values.
725726

@@ -750,7 +751,7 @@ There are several types of normalizers available:
750751
The ``DateTimeZoneNormalizer`` was introduced in Symfony 4.3.
751752

752753
:class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer`
753-
This normalizer converts :phpclass:`SplFileInfo` objects into a data URI
754+
This normalizer converts :phpclass:`SplFileInfo` objects into a `data URI`_
754755
string (``data:...``) such that files can be embedded into serialized data.
755756

756757
:class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
@@ -762,9 +763,25 @@ There are several types of normalizers available:
762763
:class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface`
763764
into a list of errors according to the `RFC 7807`_ standard.
764765

766+
.. versionadded:: 4.1
767+
768+
The ``ConstraintViolationListNormalizer`` was introduced in Symfony 4.1.
769+
765770
:class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
766771
Normalizes errors according to the API Problem spec `RFC 7807`_.
767772

773+
.. versionadded:: 4.4
774+
775+
The ``ProblemNormalizer`` was introduced in Symfony 4.4.
776+
777+
:class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer`
778+
Denormalizes arrays of objects using a format like ``MyObject[]`` (note the ``[]`` suffix).
779+
780+
:class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer`
781+
Normalizes PHP objects that implement
782+
:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`
783+
by using them as the normalizer.
784+
768785
.. _component-serializer-encoders:
769786

770787
Encoders
@@ -1557,3 +1574,5 @@ Learn more
15571574
.. _`Value Objects`: https://en.wikipedia.org/wiki/Value_object
15581575
.. _`API Platform`: https://api-platform.com
15591576
.. _`list of PHP timezones`: https://www.php.net/manual/en/timezones.php
1577+
.. _`PHP reflection`: https://php.net/manual/en/book.reflection.php
1578+
.. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

serializer.rst

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -57,41 +57,23 @@ Encoders supporting the following formats are enabled:
5757

5858
As well as the following normalizers:
5959

60-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to
61-
handle typical data objects
62-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
63-
objects implementing the :phpclass:`DateTimeInterface` interface
64-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer` for
65-
:phpclass:`DateTimeZone` objects
60+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
61+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer`
62+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer`
6663
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
67-
for :phpclass:`DateInterval` objects
68-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
69-
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
64+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer`
7065
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
71-
to deal with objects implementing the :phpclass:`JsonSerializable` interface
72-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to
73-
denormalize arrays of objects using a format like `MyObject[]` (note the `[]` suffix)
74-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface
75-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects
66+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer`
67+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
68+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
7669

77-
.. versionadded:: 4.1
78-
79-
The ``ConstraintViolationListNormalizer`` was introduced in Symfony 4.1.
80-
81-
.. versionadded:: 4.3
82-
83-
The ``DateTimeZoneNormalizer`` was introduced in Symfony 4.3.
84-
85-
.. versionadded:: 4.4
86-
87-
The ``ProblemNormalizer`` was introduced in Symfony 4.4.
88-
89-
Custom normalizers and/or encoders can also be loaded by tagging them as
70+
Other :ref:`built-in normalizers <component-serializer-normalizers>` and
71+
custom normalizers and/or encoders can also be loaded by tagging them as
9072
:ref:`serializer.normalizer <reference-dic-tags-serializer-normalizer>` and
9173
:ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also
9274
possible to set the priority of the tag in order to decide the matching order.
9375

94-
Here is an example on how to load the
76+
Here is an example on how to load the built-in
9577
:class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`, a
9678
faster alternative to the `ObjectNormalizer` when data objects always use
9779
getters (``getXxx()``), issers (``isXxx()``) or hassers (``hasXxx()``) to read
@@ -292,4 +274,3 @@ take a look at how this bundle works.
292274
.. _`GraphQL`: https://graphql.org
293275
.. _`JSON:API`: https://jsonapi.org
294276
.. _`HAL`: http://stateless.co/hal_specification.html
295-
.. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

serializer/custom_normalizer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How to Create your Custom Normalizer
66

77
The :doc:`Serializer component </components/serializer>` uses
88
normalizers to transform any data into an array. The component provides several
9-
:doc:`built-in normalizers </serializer/normalizers>` but you may need to create
9+
:ref:`built-in normalizers <component-serializer-normalizers>` but you may need to create
1010
your own normalizer to transform an unsupported data structure.
1111

1212
Creating a New Normalizer

serializer/normalizers.rst

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,5 @@ Normalizers are enabled in the serializer passing them as its first argument::
2121
Built-in Normalizers
2222
--------------------
2323

24-
Symfony includes the following normalizers but you can also
25-
:doc:`create your own normalizer </serializer/custom_normalizer>`:
26-
27-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to
28-
normalize PHP object using the :doc:`PropertyAccessor component </components/property_access>`;
29-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer`
30-
for :phpclass:`DateTimeZone` objects
31-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
32-
objects implementing the :phpclass:`DateTimeInterface` interface
33-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
34-
for :phpclass:`DateInterval` objects
35-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
36-
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
37-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to
38-
normalize PHP object using an object that implements
39-
:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`;
40-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to
41-
normalize PHP object using the getter and setter methods of the object;
42-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` to
43-
normalize PHP object using `PHP reflection`_.
44-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface
45-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects
46-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
47-
to deal with objects implementing the :phpclass:`JsonSerializable` interface
48-
49-
.. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
50-
.. _`PHP reflection`: https://php.net/manual/en/book.reflection.php
24+
Symfony includes several types of :ref:`built-in normalizers <component-serializer-normalizers>`
25+
but you can also :doc:`create your own normalizer </serializer/custom_normalizer>`.

0 commit comments

Comments
 (0)