From 60f3dc27a6e312424c8e684c6327c541fc56fa83 Mon Sep 17 00:00:00 2001 From: Brice Lalu Date: Wed, 14 Mar 2018 19:46:12 +0100 Subject: [PATCH 1/2] Update locale_sticky_session.rst Hi, I removed the 'public static function getSubscribedEvents' on the UserLocaleListener because it's useless, it's not an EventSubscriber. What do you think? --- session/locale_sticky_session.rst | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index 81176981ec9..b92587ad0b8 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -164,13 +164,6 @@ event:: $this->session->set('_locale', $user->getLocale()); } } - - public static function getSubscribedEvents() - { - return array( - SecurityEvents::INTERACTIVE_LOGIN => array(array('onInteractiveLogin', 15)), - ); - } } Then register the listener: @@ -185,7 +178,7 @@ Then register the listener: class: AppBundle\EventListener\UserLocaleListener arguments: ['@session'] tags: - - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } + - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin, priority: 15 } .. code-block:: xml From edd186063d2bc3048f322c2a1f40cab79c32ce63 Mon Sep 17 00:00:00 2001 From: Brice Lalu Date: Thu, 15 Mar 2018 12:01:12 +0100 Subject: [PATCH 2/2] Update locale_sticky_session.rst --- session/locale_sticky_session.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index b92587ad0b8..29c29cd45fb 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -132,7 +132,6 @@ event:: // src/AppBundle/EventListener/UserLocaleListener.php namespace AppBundle\EventListener; - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use Symfony\Component\Security\Http\SecurityEvents; @@ -197,7 +196,7 @@ Then register the listener: + method="onInteractiveLogin" priority=15 /> @@ -213,7 +212,7 @@ Then register the listener: ->addArgument(new Reference('session')) ->addTag( 'kernel.event_listener', - array('event' => 'security.interactive_login', 'method' => 'onInteractiveLogin') + array('event' => 'security.interactive_login', 'method' => 'onInteractiveLogin', 'priority' => 15) ); .. caution::