Skip to content

Commit 58c9014

Browse files
committed
feature #13885 [Serializer] Adds FormErrorNormalizer (YaFou)
This PR was merged into the master branch. Discussion ---------- [Serializer] Adds FormErrorNormalizer <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> This pull request is related to symfony/symfony#36211. Commits ------- 9ed468d [Serializer] Adds FormErrorNormalizer
2 parents 14d9473 + 9ed468d commit 58c9014

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

components/serializer.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,12 @@ There are several types of normalizers available:
796796
This normalizer converts :phpclass:`DateInterval` objects into strings.
797797
By default, it uses the ``P%yY%mM%dDT%hH%iM%sS`` format.
798798

799+
:class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer`
800+
This normalizer works with classes that implement
801+
:class:`Symfony\\Component\\Form\\FormInterface`.
802+
803+
It will get errors from the form and normalize them into an normalized array.
804+
799805
:class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
800806
This normalizer converts objects that implement
801807
:class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface`

serializer.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ As well as the following normalizers:
6767
for :phpclass:`DateInterval` objects
6868
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to
6969
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
70+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` for
71+
objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to
72+
normalize form errors.
7073
* :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer`
7174
to deal with objects implementing the :phpclass:`JsonSerializable` interface
7275
* :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to

serializer/normalizers.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Symfony includes the following normalizers but you can also
3636
transform :phpclass:`SplFileInfo` objects in `Data URIs`_
3737
* :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to
3838
normalize PHP object using an object that implements
39+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` for
40+
objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to
41+
normalize form errors.
3942
:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`;
4043
* :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to
4144
normalize PHP object using the getter and setter methods of the object;

0 commit comments

Comments
 (0)