Skip to content

Commit c44171f

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [Serializer] Document support of PHP backed enumerations
2 parents ca6d57a + 3cf09e9 commit c44171f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

components/serializer.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,13 @@ The Serializer component provides several built-in normalizers:
897897
This normalizer converts :phpclass:`DateInterval` objects into strings.
898898
By default, it uses the ``P%yY%mM%dDT%hH%iM%sS`` format.
899899

900+
:class:`Symfony\\Component\\Serializer\\Normalizer\\BackedEnumNormalizer`
901+
This normalizer converts a \BackedEnum objects into strings or integers.
902+
903+
.. note::
904+
905+
The PHP BackedEnum used by ``BackedEnumNormalizer`` requires at least PHP 8.1.
906+
900907
:class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer`
901908
This normalizer works with classes that implement
902909
:class:`Symfony\\Component\\Form\\FormInterface`.

serializer.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ As well as the following normalizers:
7676
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer`
7777
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
7878
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
79+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\BackedEnumNormalizer`
80+
81+
.. note::
82+
83+
The PHP BackedEnum used by ``BackedEnumNormalizer`` requires at least PHP 8.1.
7984

8085
Other :ref:`built-in normalizers <component-serializer-normalizers>` and
8186
custom normalizers and/or encoders can also be loaded by tagging them as

0 commit comments

Comments
 (0)