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 @@ -865,7 +865,13 @@ The ``JsonEncoder``
865
865
~~~~~~~~~~~~~~~~~~~
866
866
867
867
The ``JsonEncoder `` encodes to and decodes from JSON strings, based on the PHP
868
- :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions.
868
+ :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions. It can be
869
+ useful to modify how these functions operate in certain instances by providing
870
+ options such as ``JSON_PRESERVE_ZERO_FRACTION ``. You can use the serialization
871
+ context to pass in these options using the key ``json_encode_options `` or
872
+ ``json_decode_options `` respectively::
873
+
874
+ $this->serializer->serialize($data, 'json', ['json_encode_options' => \JSON_PRESERVE_ZERO_FRACTION]);
869
875
870
876
The ``CsvEncoder ``
871
877
~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ processes asking for the same ``$version``::
207
207
namespace App\Controller;
208
208
209
209
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
210
- use Symfony\Component\Lock\LockInterface ;
210
+ use Symfony\Component\Lock\LockFactory ;
211
211
212
212
class PdfController extends AbstractController
213
213
{
You can’t perform that action at this time.
0 commit comments