From 664bc4b79ef054fc88c2ea616d3c5a4769bcb5ff Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Fri, 30 Sep 2022 17:15:30 +0200 Subject: [PATCH] document serializer default_context --- reference/configuration/framework.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 56b19ab150c..06df82f51ef 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -2836,6 +2836,19 @@ paths This option allows to define an array of paths with files or directories where the component will look for additional serialization files. +default_context +............... + +**type**: ``array`` **default**: ``[]`` + +A map with default context options that will be used with each ``serialize`` and ``deserialize`` +call. This can be used for example to set the json encoding behavior by setting ``json_encode_options`` +to a `json_encode flags bitmask`_. + +.. versionadded:: 5.4 + + The ``default_context`` parameter was introduced in Symfony 5.4. + php_errors ~~~~~~~~~~ @@ -3612,6 +3625,7 @@ use the configuration of the first exception that matches ``instanceof``: .. _`blue/green deployment`: https://martinfowler.com/bliki/BlueGreenDeployment.html .. _`gulp-rev`: https://www.npmjs.com/package/gulp-rev .. _`webpack-manifest-plugin`: https://www.npmjs.com/package/webpack-manifest-plugin +.. _`json_encode flags bitmask`: https://www.php.net/json_encode .. _`error_reporting PHP option`: https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting .. _`CSRF security attacks`: https://en.wikipedia.org/wiki/Cross-site_request_forgery .. _`session.sid_length PHP option`: https://www.php.net/manual/session.configuration.php#ini.session.sid-length