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