File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ These are the options available on the :ref:`serializer context <serializer-cont
212212``ignore_empty_attributes `` (default: ``false ``)
213213 If set to true, ignores all attributes with empty values in the generated XML
214214``preserve_numeric_keys `` (default: ``false ``)
215- If set to true, it keeps numeric array indexes instead of collapsing them into ``<item> `` nodes.
215+ If set to true, it keeps numeric array indexes (e.g. ``<item key="0"> ``)
216+ instead of collapsing them into ``<item> `` nodes.
216217
217218.. versionadded :: 7.1
218219
@@ -224,9 +225,8 @@ These are the options available on the :ref:`serializer context <serializer-cont
224225
225226.. versionadded :: 7.4
226227
227- The ``cdata_wrapping_name_pattern `` option was introduced in Symfony 7.4.
228-
229- The ``preserve_numeric_keys `` option was introduced in Symfony 7.4.
228+ The ``cdata_wrapping_name_pattern `` and ``preserve_numeric_keys `` options
229+ were introduced in Symfony 7.4.
230230
231231Example with a custom ``context ``::
232232
@@ -281,6 +281,7 @@ Example with ``preserve_numeric_keys``::
281281 // <lastname>Clay</lastname>
282282 // </person>
283283 //</response>
284+
284285 $xmlEncoder->encode($data, 'xml', ['preserve_numeric_keys' => true]);
285286 // outputs:
286287 //<response>
You can’t perform that action at this time.
0 commit comments