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``
784784~~~~~~~~~~~~~~~~~~~
785785
786786The ``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]);
788794
789795The ``CsvEncoder ``
790796~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ processes asking for the same ``$version``::
202202 namespace App\Controller;
203203
204204 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
205- use Symfony\Component\Lock\LockInterface ;
205+ use Symfony\Component\Lock\LockFactory ;
206206
207207 class PdfController extends AbstractController
208208 {
You can’t perform that action at this time.
0 commit comments