From dae171b0887fef57330540d93016534f0b9d6634 Mon Sep 17 00:00:00 2001 From: Krzysztof Lechowski Date: Mon, 27 Aug 2018 22:06:54 +0100 Subject: [PATCH] Fixing inconcistency - subscribr to listener There was incomplete subscriber class that looked like leftover. It has been provided with config snippet for listener. I'm guessing recommendation changed from subscriber to listener, as it makes more sense here. --- session/locale_sticky_session.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index f8caef23370..a48ce72bdb7 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -139,22 +139,20 @@ want to use this as the locale for the given user. To accomplish this, you can hook into the login process and update the user's session with this locale value before they are redirected to their first page. -To do this, you need an event subscriber on the ``security.interactive_login`` +To do this, you need an event listener on the ``security.interactive_login`` event:: - // src/EventSubscriber/UserLocaleSubscriber.php + // src/EventSubscriber/UserLocaleListener.php namespace App\EventSubscriber; - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; - use Symfony\Component\Security\Http\SecurityEvents; /** * Stores the locale of the user in the session after the * login. This can be used by the LocaleSubscriber afterwards. */ - class UserLocaleSubscriber implements EventSubscriberInterface + class UserLocaleListener { private $session;