8000 Merge branch '5.4' into 6.0 · symfony/symfony-docs@be1a2d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit be1a2d0

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Remove duplicate normalizers docs
2 parents 74cdd53 + c9036cd commit be1a2d0

File tree

4 files changed

+19
-55
lines changed
  • 4 files changed

    +19
    -55
    lines changed

    components/serializer.rst

    Lines changed: 5 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -834,7 +834,8 @@ The Serializer component provides several built-in normalizers:
    834834
    :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
    835835
    This normalizer directly reads and writes public properties as well as
    836836
    **private and protected** properties (from both the class and all of its
    837-
    parent classes). It supports calling the constructor during the denormalization process.
    837+
    parent classes) by using `PHP reflection`_. It supports calling the constructor
    838+
    during the denormalization process.
    838839

    839840
    Objects are normalized to a map of property names to property values.
    840841

    @@ -861,7 +862,7 @@ The Serializer component provides several built-in normalizers:
    861862
    represent the name of the timezone according to the `list of PHP timezones`_.
    862863

    863864
    :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer`
    864-
    This normalizer converts :phpclass:`SplFileInfo` objects into a data URI
    865+
    This normalizer converts :phpclass:`SplFileInfo` objects into a `data URI`_
    865866
    string (``data:...``) such that files can be embedded into serialized data.
    866867

    867868
    :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
    @@ -1746,3 +1747,5 @@ Learn more
    17461747
    .. _`API Platform`: https://api-platform.com
    17471748
    .. _`list of PHP timezones`: https://www.php.net/manual/en/timezones.php
    17481749
    .. _`RFC 4122`: https://tools.ietf.org/html/rfc4122
    1750+
    .. _`PHP reflection`: https://php.net/manual/en/book.reflection.php
    1751+
    .. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

    serializer.rst

    Lines changed: 11 additions & 20 deletions
    Original file line numberDiff line numberDiff line change
    @@ -66,27 +66,19 @@ Encoders supporting the following formats are enabled:
    6666

    6767
    As well as the following normalizers:
    6868

    69-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to
    70-
    handle typical data objects
    71-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for
    72-
    objects implementing the :phpclass:`DateTimeInterface` interface
    73-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer` for
    74-
    :phpclass:`DateTimeZone` objects
    69+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
    70+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer`
    71+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer`
    7572
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer`
    76-
    for :phpclass:`DateInterval` objects
    77-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
    78-
    transform :phpclass:`SplFileInfo` objects in `Data URIs`_
    79-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` for
    80-
    objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to
    81-
    normalize form errors.
    73+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer`
    74+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer`
    8275
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
    83-
    to deal with objects implementing the :phpclass:`JsonSerializable` interface
    84-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to
    85-
    denormalize arrays of objects using a notation like ``MyObject[]`` (note the ``[]`` suffix)
    86-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface
    87-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects
    76+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer`
    77+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
    78+
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
    8879

    89-
    Custom normalizers and/or encoders can also be loaded by tagging them as
    80+
    Other :ref:`built-in normalizers <component-serializer-normalizers>` and
    81+
    custom normalizers and/or encoders can also be loaded by tagging them as
    9082
    :ref:`serializer.normalizer <reference-dic-tags-serializer-normalizer>` and
    9183
    :ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also
    9284
    possible to set the priority of the tag in order to decide the matching order.
    @@ -97,7 +89,7 @@ possible to set the priority of the tag in order to decide the matching order.
    9789
    ``DateTime`` or ``DateTimeImmutable`` classes to avoid excessive memory
    9890
    usage and exposing internal details.
    9991

    100-
    Here is an example on how to load the
    92+
    Here is an example on how to load the built-in
    10193
    :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`, a
    10294
    faster alternative to the `ObjectNormalizer` when data objects always use
    10395
    getters (``getXxx()``), issers (``isXxx()``) or hassers (``hasXxx()``) to read
    @@ -319,4 +311,3 @@ take a look at how this bundle works.
    319311
    .. _`GraphQL`: https://graphql.org
    320312
    .. _`JSON:API`: https://jsonapi.org
    321313
    .. _`HAL`: http://stateless.co/hal_specification.html
    322-
    .. _`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 & 32 deletions
    Original file line numberDiff line numberDiff line change
    @@ -21,35 +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:`PropertyAccess 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\\FormErrorNormalizer` for
    41-
    objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to
    42-
    normalize form errors;
    43-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to
    44-
    normalize PHP object using the getter and setter methods of the object;
    45-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` to
    46-
    normalize PHP object using `PHP reflection`_;
    47-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface;
    48-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects
    49-
    * :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
    50-
    to deal with objects implementing the :phpclass:`JsonSerializable` interface;
    51-
    * :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`.
    52-
    53-
    54-
    .. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
    55-
    .. _`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)
    0