@@ -160,10 +160,10 @@ Assume you have the following object plain-old-PHP object::
160160 }
161161
162162The definition of serialization can be specified using annotations, XML
163- and YAML. The :class: Symfony\C omponent\S erializer\M apping\F actory\C lassMetadataFactory
163+ or YAML. The :class: ` Symfony\C omponent\S erializer\M apping\F actory\C lassMetadataFactory `
164164that will be used by the normalizer must be aware of the format to use.
165165
166- Initialize the :class: Symfony\C omponent\S erializer\M apping\F actory\C lassMetadataFactory
166+ Initialize the :class: ` Symfony\C omponent\S erializer\M apping\F actory\C lassMetadataFactory `
167167like the following::
168168
169169 use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
@@ -245,7 +245,12 @@ You are now able to serialize only attributes in the groups you want::
245245 $data = $serializer->normalize($obj, null, array('groups' => array('group1')));
246246 // $data = ['foo' => 'foo'];
247247
248- $obj2 = $serializer->denormalize(array('foo' => 'foo', 'bar' => 'bar'), 'MyObj', null, array('groups' => array('group1', 'group3')));
248+ $obj2 = $serializer->denormalize(
249+ array('foo' => 'foo', 'bar' => 'bar'),
250+ 'MyObj',
251+ null,
252+ array('groups' => array('group1', 'group3'))
253+ );
249254 // $obj2 = MyObj(foo: 'foo', bar: 'bar')
250255
251256.. _ignoring-attributes-when-serializing :
@@ -262,7 +267,8 @@ Ignoring Attributes
262267 2.7, they are ignored when deserializing too.
263268
264269As an option, there's a way to ignore attributes from the origin object. To remove
265- those attributes use the :method: `Symfony\\ Component\\ Serializer\\ Normalizer\\ GetSetMethodNormalizer::setIgnoredAttributes `
270+ those attributes use the
271+ :method: `Symfony\\ Component\\ Serializer\\ Normalizer\\ GetSetMethodNormalizer::setIgnoredAttributes `
266272method on the normalizer definition::
267273
268274 use Symfony\Component\Serializer\Serializer;
@@ -450,7 +456,7 @@ having unique identifiers::
450456.. seealso ::
451457
452458 A popular alternative to the Symfony Serializer Component is the third-party
453- library, `JMS serializer `_.
459+ library, `JMS serializer `_ (released under the Apache license, so incompatible with GPLv2 projects) .
454460
455461.. _`JMS serializer` : https://github.com/schmittjoh/serializer
456462.. _Packagist : https://packagist.org/packages/symfony/serializer
0 commit comments