Skip to content

Commit 708e98c

Browse files
committed
minor #11468 Document the UserValueResolver (HypeMC)
This PR was merged into the 4.2 branch. Discussion ---------- Document the UserValueResolver Fixes #10595, followup to #11467. **NOTE**: This PR has all the changes that #11467 has plus some symfony 4.2 specific additions, so #11467 should probably be merged first. Commits ------- b72a65e Document the UserValueResolver
2 parents 8b45bd0 + b72a65e commit 708e98c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

controller/argument_value_resolver.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,25 @@ Symfony ships with the following value resolvers in the
4545
argument list. When the action is called, the last (variadic) argument will
4646
contain all the values of this array.
4747

48-
In addition, some official bundles provide other value resolvers:
48+
In addition, some components and official bundles provide other value resolvers:
49+
50+
:class:`Symfony\\Component\\Security\\Http\\Controller\\UserValueResolver`
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 :doc:`Security component </components/security>`.
4955

5056
:class:`Symfony\\Bundle\\SecurityBundle\\SecurityUserValueResolver`
5157
Injects the object that represents the current logged in user if type-hinted
5258
with ``UserInterface``. Default value can be set to ``null`` in case
5359
the controller can be accessed by anonymous users. It requires installing
5460
the `SecurityBundle`_.
5561

62+
.. deprecated:: 4.1
63+
64+
The resolver was deprecated in Symfony 4.1 in favor of
65+
`Symfony\\Component\\Security\\Http\\Controller\\UserValueResolver`.
66+
5667
``Psr7ServerRequestResolver``
5768
Injects a `PSR-7`_ compliant version of the current request if type-hinted
5869
with ``RequestInterface``, ``MessageInterface`` or ``ServerRequestInterface``.

0 commit comments

Comments
 (0)