diff --git a/components/config/definition.rst b/components/config/definition.rst index 9ec4fe4708c..8ad8ae1b0c9 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -820,7 +820,8 @@ character (``.``):: $node = $treeBuilder->buildTree(); $children = $node->getChildren(); - $path = $children['driver']->getPath(); + $childChildren = $children['connection']->getChildren(); + $path = $childChildren['driver']->getPath(); // $path = 'database.connection.driver' Use the ``setPathSeparator()`` method on the config builder to change the path @@ -831,7 +832,8 @@ separator:: $treeBuilder->setPathSeparator('/'); $node = $treeBuilder->buildTree(); $children = $node->getChildren(); - $path = $children['driver']->getPath(); + $childChildren = $children['connection']->getChildren(); + $path = $childChildren['driver']->getPath(); // $path = 'database/connection/driver' Processing Configuration Values diff --git a/form/form_collections.rst b/form/form_collections.rst index c58bf996235..0ab38902a17 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -531,7 +531,7 @@ First, add a "delete this tag" link to each tag form: .. code-block:: javascript - const tags = document.querySelectorAll('ul.tags') + const tags = document.querySelectorAll('ul.tags li') tags.forEach((tag) => { addTagFormDeleteLink(tag) }) diff --git a/form/form_customization.rst b/form/form_customization.rst index a546b9ed680..b5c5a23f841 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -268,8 +268,9 @@ Renders any errors for the given field. .. caution:: - In the :ref:`error messages of Bootstrap 5 Form Theme `, - ``form_errors()`` is already included in ``form_label()``. + In the Bootstrap 4 form theme, ``form_errors()`` is already included in + ``form_label()``. Read more about this in the + :ref:`Bootstrap 4 theme documentation `. .. _reference-forms-twig-widget: diff --git a/http_client.rst b/http_client.rst index ebdbf604a12..0b68740e398 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1675,6 +1675,23 @@ responses dynamically when it's called:: $client = new MockHttpClient($callback); $response = $client->request('...'); // calls $callback to get the response +.. tip:: + + Instead of using the first argument, you can also set the (list of) + responses or callbacks using the ``setResponseFactory()`` method:: + + $responses = [ + new MockResponse($body1, $info1), + new MockResponse($body2, $info2), + ]; + + $client = new MockHttpClient(); + $client->setResponseFactory($responses); + + .. versionadded:: 5.4 + + The ``setResponseFactory()`` method was introduced in Symfony 5.4. + If you need to test responses with HTTP status codes different than 200, define the ``http_code`` option:: diff --git a/logging/processors.rst b/logging/processors.rst index d1cc750c8ec..99a6bb2c069 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -282,4 +282,4 @@ the ``monolog.processor`` tag: ->addTag('monolog.processor', ['channel' => 'main']); .. _`Monolog`: https://github.com/Seldaek/monolog -.. _`built-in Monolog processors`: https://github.com/Seldaek/monolog/tree/master/src/Monolog/Processor +.. _`built-in Monolog processors`: https://github.com/Seldaek/monolog/tree/main/src/Monolog/Processor diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 6adaa9df79f..ec3dbc2eb70 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -284,6 +284,8 @@ type: .. include:: /reference/forms/types/options/attr.rst.inc +.. include:: /reference/forms/types/options/by_reference.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/serializer.rst b/serializer.rst index 7c812dbbec6..296d2c7626a 100644 --- a/serializer.rst +++ b/serializer.rst @@ -111,6 +111,49 @@ You can pass the context as follows:: DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s', ]); +You can also configure the default context through the framework +configuration: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + framework: + # ... + serializer: + default_context: + enable_max_depth: true + + .. code-block:: xml + + + + + + + + + + .. code-block:: php + + // config/packages/framework.php + use Symfony\Config\FrameworkConfig; + use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer; + + return static function (FrameworkConfig $framework) { + $framework->serializer() + ->defaultContext([ + AbstractObjectNormalizer::ENABLE_MAX_DEPTH => true + ]) + ; + }; + +.. versionadded:: 5.4 + + The ability to configure the ``default_context`` option in the + Serializer was introduced in Symfony 5.4. + .. _serializer-using-serialization-groups-annotations: Using Serialization Groups Annotations