File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -784,7 +784,13 @@ The ``JsonEncoder``
784
784
~~~~~~~~~~~~~~~~~~~
785
785
786
786
The ``JsonEncoder `` encodes to and decodes from JSON strings, based on the PHP
787
- :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions.
787
+ :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions. It can be
788
+ useful to modify how these functions operate in certain instances by providing
789
+ options such as ``JSON_PRESERVE_ZERO_FRACTION ``. You can use the serialization
790
+ context to pass in these options using the key ``json_encode_options `` or
791
+ ``json_decode_options `` respectively::
792
+
793
+ $this->serializer->serialize($data, 'json', ['json_encode_options' => \JSON_PRESERVE_ZERO_FRACTION]);
788
794
789
795
The ``CsvEncoder ``
790
796
~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ processes asking for the same ``$version``::
202
202
namespace App\Controller;
203
203
204
204
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
205
- use Symfony\Component\Lock\LockInterface ;
205
+ use Symfony\Component\Lock\LockFactory ;
206
206
207
207
class PdfController extends AbstractController
208
208
{
You can’t perform that action at this time.
0 commit comments