diff --git a/security.rst b/security.rst index 5b5298b6c36..e3bf05e6129 100644 --- a/security.rst +++ b/security.rst @@ -1052,10 +1052,10 @@ the User object, and use the ``isGranted()`` method (or An alternative way to get the current user in a controller is to type-hint the controller argument with - :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface\\UserInterface` + :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface` (and default it to ``null`` if being logged-in is optional):: - use Symfony\Component\Security\Core\User\UserInterface\UserInterface; + use Symfony\Component\Security\Core\User\UserInterface; public function indexAction(UserInterface $user = null) {