From a38b44e47b8dcc3f92a615213e83323b17240a49 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 21 Feb 2013 15:40:44 +0100 Subject: [PATCH] Fixed the serializer initialization for 2.0 Refs symfony/symfony#7145 --- components/serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index e502845a126..27c9d4aa0d8 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -42,7 +42,7 @@ which Encoders and Normalizer are going to be available:: use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; - $encoders = array(new XmlEncoder(), new JsonEncoder()); + $encoders = array('xml' => new XmlEncoder(), 'json' => new JsonEncoder()); $normalizers = array(new GetSetMethodNormalizer()); $serializer = new Serializer($normalizers, $encoders);