Skip to content

Commit d9d82e4

Browse files
committed
Merge branch '5.1' into 5.x
* 5.1: Fix wrong properties class replace ExceptionListener by EventListener add caution for datetime object Replace overriding twig.paths by twig.default_path
2 parents cb3513e + 2de840e commit d9d82e4

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

components/http_foundation.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,19 @@ can be accessed via several public properties:
8383
Each property is a :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`
8484
instance (or a sub-class of), which is a data holder class:
8585

86-
* ``request``: :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`;
86+
* ``request``: :class:`Symfony\\Component\\HttpFoundation\\ParameterBag` or
87+
:class:`Symfony\\Component\\HttpFoundation\\InputBag` if the data is
88+
coming from ``$_POST`` parameters;
8789

88-
* ``query``: :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`;
90+
* ``query``: :class:`Symfony\\Component\\HttpFoundation\\InputBag`;
8991

90-
* ``cookies``: :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`;
92+
* ``cookies``: :class:`Symfony\\Component\\HttpFoundation\\InputBag`;
9193

9294
* ``attributes``: :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`;
9395

94-
* ``files``: :class:`Symfony\\Component\\HttpFoundation\\FileBag`;
96+
* ``files``: :class:`Symfony\\Component\\HttpFoundation\\FileBag`;
9597

96-
* ``server``: :class:`Symfony\\Component\\HttpFoundation\\ServerBag`;
98+
* ``server``: :class:`Symfony\\Component\\HttpFoundation\\ServerBag`;
9799

98100
* ``headers``: :class:`Symfony\\Component\\HttpFoundation\\HeaderBag`.
99101

configuration/override_dir_structure.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ Override the Templates Directory
106106
--------------------------------
107107

108108
If your templates are not stored in the default ``templates/`` directory, use
109-
the :ref:`twig.paths <config-twig-paths>` configuration option to define your
110-
own templates directory (or directories):
109+
the :ref:`twig.default_path <config-twig-default-path>` configuration
110+
option to define your own templates directory (use :ref:`twig.paths <config-twig-paths>`
111+
for multiple directories):
111112

112113
.. configuration-block::
113114

@@ -116,7 +117,7 @@ own templates directory (or directories):
116117
# config/packages/twig.yaml
117118
twig:
118119
# ...
119-
paths: ["%kernel.project_dir%/resources/views"]
120+
default_path: "%kernel.project_dir%//resources/views"
120121
121122
.. code-block:: xml
122123
@@ -131,7 +132,7 @@ own templates directory (or directories):
131132
https://symfony.com/schema/dic/twig/twig-1.0.xsd">
132133
133134
<twig:config>
134-
<twig:path>%kernel.project_dir%/resources/views</twig:path>
135+
<twig:default-path>%kernel.project_dir%/resources/views</twig:default-path>
135136
</twig:config>
136137
137138
</container>
@@ -140,9 +141,7 @@ own templates directory (or directories):
140141
141142
// config/packages/twig.php
142143
$container->loadFromExtension('twig', [
143-
'paths' => [
144-
'%kernel.project_dir%/resources/views',
145-
],
144+
'default_path' => '%kernel.project_dir%/resources/views',
146145
]);
147146
148147
Override the Translations Directory

reference/events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ sent as response::
251251

252252
.. note::
253253

254-
The TwigBundle registers an :class:`Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener`
254+
The TwigBundle registers an :class:`Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener`
255255
that forwards the ``Request`` to a given controller defined by the
256256
``exception_listener.controller`` parameter.
257257

serializer.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ Custom normalizers and/or encoders can also be loaded by tagging them as
8282
:ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also
8383
possible to set the priority of the tag in order to decide the matching order.
8484

85+
.. caution::
86+
87+
Always make sure to load the ``DateTimeNormalizer`` when serializing the
88+
``DateTime`` or ``DateTimeImmutable`` classes to avoid excessive memory
89+
usage and exposing internal details.
90+
8591
Here is an example on how to load the
8692
:class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`, a
8793
faster alternative to the `ObjectNormalizer` when data objects always use

0 commit comments

Comments
 (0)