@@ -252,29 +252,27 @@ that will be used by the normalizer must be aware of the format to use.
252252The following code shows how to initialize the :class: `Symfony\\ Component\\ Serializer\\ Mapping\\ Factory\\ ClassMetadataFactory `
253253for each format:
254254
255- .. configuration-block ::
256-
257- .. code-block :: php-annotations
255+ * Annotations in PHP files::
258256
259- use Doctrine\Common\Annotations\AnnotationReader;
260- use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
261- use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
257+ use Doctrine\Common\Annotations\AnnotationReader;
258+ use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
259+ use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
262260
263- $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
261+ $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
264262
265- .. code-block :: yaml
263+ * XML files::
266264
267- use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
268- use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
265+ use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
266+ use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
269267
270- $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yml'));
268+ $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yml'));
271269
272- .. code-block :: xml
270+ * YAML files::
273271
274- use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
275- use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
272+ use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
273+ use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
276274
277- $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
275+ $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
278276
279277.. _component-serializer-attributes-groups-annotations :
280278
0 commit comments