@@ -170,7 +170,7 @@ Converting Property Names when Serializing and Deserializing
170170 interface was introduced in Symfony 2.7.
171171
172172Sometimes serialized attributes must be named differently than properties
173- or getter and setter methods of PHP classes.
173+ or getter / setter methods of PHP classes.
174174
175175The Serializer Component provides a handy way to translate or map PHP field
176176names to serialized names: The Name Converter System.
@@ -187,7 +187,7 @@ Given you have the following object::
187187And in the serialized form, all attributes must be prefixed by ``org_ `` like
188188the following::
189189
190- {"org_name": "Les-Tilleuls.coop ", "org_address": "Euratechnologies, 2 rue Hegel, 59160 Lomme , France"}
190+ {"org_name": "Acme SARL ", "org_address": "Euratechnologies, 59000 Lille , France"}
191191
192192A custom Name Converter can handle such cases::
193193
@@ -222,11 +222,11 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
222222 $serializer = new Serializer(array(new JsonEncoder()), array($normalizer));
223223
224224 $obj = new Company();
225- $obj->name = 'Les-Tilleuls.coop ';
226- $obj->address = 'Euratechnologies, 2 rue Hegel, 59160 Lomme , France';
225+ $obj->name = 'Acme SARL ';
226+ $obj->address = 'Euratechnologies, 59000 Lille , France';
227227
228228 $json = $serializer->serialize($obj);
229- // {"org_name": "Les-Tilleuls.coop ", "org_address": "Euratechnologies, 2 rue Hegel, 59160 Lomme , France"}
229+ // {"org_name": "Acme SARL ", "org_address": "Euratechnologies, 59000 Lille , France"}
230230 $objCopy = $serializer->deserialize($json);
231231 // Same data as $obj
232232
@@ -239,11 +239,11 @@ CamelCase to snake_case
239239 The :class: `Symfony\\ Component\\ Serializer\\ NameConverter\\ CamelCaseToUnderscoreNameConverter `
240240 interface was introduced in Symfony 2.7.
241241
242- In many formats, it's common to use underscores to separate words (also know
242+ In many formats, it's common to use underscores to separate words (also known
243243as snake_case). However, PSR-1 specifies that the preferred style for PHP
244244properties and methods is CamelCase.
245245
246- Symfony provides a built-in Name Converter designed to translate between
246+ Symfony provides a built-in name converter designed to transform between
247247snake_case and CamelCased styles during serialization and deserialization
248248processes::
249249
0 commit comments