From 3efc44e6606917d2ae0bc3b76bc4e40fa2aefb67 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 29 May 2018 14:14:02 +0200 Subject: [PATCH] Use '[]' notation, add missing "()" update class name --- security/impersonating_user.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index 6c1c6b99d36..0584bb172e7 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -198,7 +198,7 @@ The :doc:`/session/locale_sticky_session` article does not update the locale when you impersonate a user. If you *do* want to be sure to update the locale when you switch users, add an event subscriber on this event:: - // src/EventListener/SwitchUserListener.php + // src/EventListener/SwitchUserSubscriber.php namespace App\EventListener; use Symfony\Component\Security\Http\Event\SwitchUserEvent; @@ -211,7 +211,7 @@ you switch users, add an event subscriber on this event:: { $request = $event->getRequest(); - if ($request->hasSession() && ($session = $request->getSession)) { + if ($request->hasSession() && ($session = $request->getSession())) { $session->set( '_locale', // assuming your User has some getLocale() method @@ -222,10 +222,10 @@ you switch users, add an event subscriber on this event:: public static function getSubscribedEvents() { - return array( + return [ // constant for security.switch_user SecurityEvents::SWITCH_USER => 'onSwitchUser', - ); + ]; } }