Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 604d451

Browse files
committed
minor #16616 Add hint how to debug argument resolver order (Seldaek)
This PR was merged into the 5.4 branch. Discussion ---------- Add hint how to debug argument resolver order I guess having a specific command for debugging those would be even better, but this does the job fairly ok: ``` bin/console debug:container debug.argument_resolver.inner --show-arguments Information for Service "debug.argument_resolver.inner" ======================================================= Responsible for resolving the arguments passed to an action. ---------------- ---------------------------------------------------------- Option Value ---------------- ---------------------------------------------------------- Service ID debug.argument_resolver.inner Class Symfony\Component\HttpKernel\Controller\ArgumentResolver Tags - Public no Synthetic no Lazy no Shared yes Abstract no Autowired no Autoconfigured no Arguments Service(argument_metadata_factory) Iterator (10 element(s)) - Service(debug.App\ArgumentResolver\PackageResolver) - Service(debug.App\ArgumentResolver\UserResolver) - Service(debug.argument_resolver.request_attribute) - Service(debug.argument_resolver.request) - Service(debug.argument_resolver.session) - Service(debug.security.user_value_resolver) - Service(debug.argument_resolver.service) - Service(debug.argument_resolver.default) - Service(debug.argument_resolver.variadic) - Service(debug.argument_resolver.not_tagged_controller) ---------------- ---------------------------------------------------------- ! [NOTE] The "debug.argument_resolver.inner" service or alias has been removed or inlined when the container was ! compiled. ``` Commits ------- 9cb56a2 Add hint how to debug argument resolver order
2 parents 1b0cfaf + 9cb56a2 commit 604d451

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controller/argument_value_resolver.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ Otherwise, set a priority lower than ``100`` to make sure the argument resolver
242242
is not triggered when the ``Request`` attribute is present (for example, when
243243
passing the user along sub-requests).
244244

245+
To ensure your resolvers are added in the right position you can run the following
246+
command to see which argument resolvers are present and in which order they run.
247+
248+
.. code-block:: terminal
249+
250+
$ php bin/console debug:container debug.argument_resolver.inner --show-arguments
251+
245252
.. tip::
246253

247254
As you can see in the ``UserValueResolver::supports()`` method, the user

0 commit comments

Comments
 (0)