Skip to content

Commit 37d51ba

Browse files
committed
minor #17101 [Serializer] Document support of PHP backed enumerations (94noni)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] Document support of PHP backed enumerations Ref #15489 PS: I do not know if we should document that this requires `PHP v8.1+` and if yes, how to document it Commits ------- ffc4856 [Serializer] Document support of PHP backed enumerations
2 parents 85708a2 + ffc4856 commit 37d51ba

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

components/serializer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,14 @@ 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+
.. versionadded:: 5.4
904+
905+
The ``BackedEnumNormalizer`` was introduced in Symfony
906+
5.4. PHP BackedEnum require at least PHP 8.1.
907+
900908
:class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer`
901909
This normalizer works with classes that implement
902910
:class:`Symfony\\Component\\Form\\FormInterface`.

serializer.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ As well as the following normalizers:
8080
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer`
8181
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
8282
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
83+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\BackedEnumNormalizer`
84+
85+
.. versionadded:: 5.4
86+
87+
:class:`Symfony\\Component\\Serializer\\Normalizer\\BackedEnumNormalizer`
88+
was introduced in Symfony 5.4. PHP BackedEnum require at least PHP 8.1.
8389

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

0 commit comments

Comments
 (0)