Skip to content

Commit f83b88a

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Document the SecurityUserValueResolver & Psr7ServerRequestResolver
2 parents d075fc2 + b1c5ac1 commit f83b88a

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

controller/argument_value_resolver.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ in order to be recognized. This is done via the
1212
creating and registering custom argument value resolvers, you can extend this
1313
functionality.
1414

15-
Functionality Shipped with the HttpKernel
16-
-----------------------------------------
15+
.. _functionality-shipped-with-the-httpkernel:
1716

18-
Symfony ships with the following value resolvers in the HttpKernel component:
17+
Built-In Value Resolvers
18+
------------------------
19+
20+
Symfony ships with the following value resolvers in the
21+
:doc:`HttpKernel component </components/http_kernel>`:
1922

2023
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
2124
Attempts to find a request attribute that matches the name of the argument.
@@ -42,6 +45,19 @@ Symfony ships with the following value resolvers in the HttpKernel component:
4245
argument list. When the action is called, the last (variadic) argument will
4346
contain all the values of this array.
4447

48+
In addition, some official bundles provide other value resolvers:
49+
50+
:class:`Symfony\\Bundle\\SecurityBundle\\SecurityUserValueResolver`
51+
Injects the object that represents the current logged in user if type-hinted
52+
with ``UserInterface``. Default value can be set to ``null`` in case
53+
the controller can be accessed by anonymous users. It requires installing
54+
the `SecurityBundle`_.
55+
56+
``Psr7ServerRequestResolver``
57+
Injects a `PSR-7`_ compliant version of the current request if type-hinted
58+
with ``RequestInterface``, ``MessageInterface`` or ``ServerRequestInterface``.
59+
It requires installing the `SensioFrameworkExtraBundle`_.
60+
4561
Adding a Custom Value Resolver
4662
------------------------------
4763

@@ -233,3 +249,6 @@ subrequests.
233249

234250
.. _`@ParamConverter`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
235251
.. _`yield`: http://php.net/manual/en/language.generators.syntax.php
252+
.. _`SecurityBundle`: https://github.com/symfony/security-bundle
253+
.. _`PSR-7`: https://www.php-fig.org/psr/psr-7/
254+
.. _`SensioFrameworkExtraBundle`: https://github.com/sensiolabs/SensioFrameworkExtraBundle

0 commit comments

Comments
 (0)