diff --git a/components/serializer.rst b/components/serializer.rst index 2e43ac571f5..6b6eec10201 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -693,13 +693,13 @@ When serializing, you can set a callback to format a specific object property:: Normalizers ----------- -Normalizers turn **object** into **array** and vice versa. They implement -:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface` -for normalize (object to array) and -:class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizableInterface` for denormalize -(array to object). +Normalizers turn **objects** into **arrays** and vice versa. They implement +:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` for +normalizing (object to array) and +:class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface` for +denormalizing (array to object). -You can add new normalizers to a Serializer instance by using its first constructor argument:: +Normalizers are enabled in the serializer passing them as its first argument:: use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Serializer; diff --git a/serializer.rst b/serializer.rst index 4216d619c15..ce74573ae6a 100644 --- a/serializer.rst +++ b/serializer.rst @@ -269,7 +269,6 @@ take a look at how this bundle works. .. toctree:: :maxdepth: 1 - serializer/normalizers serializer/custom_encoders serializer/custom_normalizer diff --git a/serializer/normalizers.rst b/serializer/normalizers.rst deleted file mode 100644 index 4e0b63a2ee6..00000000000 --- a/serializer/normalizers.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. index:: - single: Serializer, Normalizers - -Normalizers -=========== - -Normalizers turn **objects** into **arrays** and vice versa. They implement -:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` for -normalizing (object to array) and -:class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface` for -denormalizing (array to object). - -Normalizers are enabled in the serializer passing them as its first argument:: - - use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; - use Symfony\Component\Serializer\Serializer; - - $normalizers = [new ObjectNormalizer()]; - $serializer = new Serializer($normalizers); - -Built-in Normalizers --------------------- - -Symfony includes several types of :ref:`built-in normalizers ` -but you can also :doc:`create your own normalizer `.