@@ -252,29 +252,27 @@ that will be used by the normalizer must be aware of the format to use.
252
252
The following code shows how to initialize the :class: `Symfony\\ Component\\ Serializer\\ Mapping\\ Factory\\ ClassMetadataFactory `
253
253
for each format:
254
254
255
- .. configuration-block ::
256
-
257
- .. code-block :: php-annotations
255
+ * Annotations in PHP files::
258
256
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;
262
260
263
- $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
261
+ $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
264
262
265
- .. code-block :: yaml
263
+ * XML files::
266
264
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;
269
267
270
- $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yml'));
268
+ $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yml'));
271
269
272
- .. code-block :: xml
270
+ * YAML files::
273
271
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;
276
274
277
- $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
275
+ $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
278
276
279
277
.. _component-serializer-attributes-groups-annotations :
280
278
0 commit comments