@@ -606,12 +606,11 @@ There are several types of normalizers available:
606
606
Encoders
607
607
--------
608
608
609
- Encoders basically turn **arrays ** into **formats ** and vice versa.
610
- They implement
611
- :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ EncoderInterface ` for
612
- encoding (array to format) and
613
- :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ DecoderInterface ` for
614
- decoding (format to array).
609
+ Encoders turn **arrays ** into **formats ** and vice versa. They implement
610
+ :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ EncoderInterface `
611
+ for encoding (array to format) and
612
+ :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ DecoderInterface ` for decoding
613
+ (format to array).
615
614
616
615
You can add new encoders to a Serializer instance by using its second constructor argument::
617
616
@@ -625,7 +624,7 @@ You can add new encoders to a Serializer instance by using its second constructo
625
624
Built-in Encoders
626
625
~~~~~~~~~~~~~~~~~
627
626
628
- The Serializer component provides built-in encoders:
627
+ The Serializer component provides several built-in encoders:
629
628
630
629
:class: `Symfony\\ Component\\ Serializer\\ Encoder\\ JsonEncoder `
631
630
This class encodes and decodes data in JSON _.
@@ -654,7 +653,11 @@ The ``CsvEncoder``
654
653
655
654
The ``CsvEncoder `` encodes to and decodes from CSV.
656
655
657
- You can pass the context key ``as_collection `` in order to have the results always as a collection.
656
+ You can pass the context key ``as_collection `` in order to have the results
657
+ always as a collection.
658
+
659
+ .. versionadded :: 4.1
660
+ The ``as_collection `` option was introduced in Symfony 4.1.
658
661
659
662
The ``XmlEncoder ``
660
663
~~~~~~~~~~~~~~~~~~
@@ -684,7 +687,11 @@ Be aware that this encoder will consider keys beginning with ``@`` as attributes
684
687
// <foo bar="value" />
685
688
// </response>
686
689
687
- You can pass the context key ``as_collection `` in order to have the results always as a collection.
690
+ You can pass the context key ``as_collection `` in order to have the results
691
+ always as a collection.
692
+
693
+ .. versionadded :: 4.1
694
+ The ``as_collection `` option was introduced in Symfony 4.1.
688
695
689
696
The ``YamlEncoder ``
690
697
~~~~~~~~~~~~~~~~~~~
0 commit comments