-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update locale_sticky_session.rst #9440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, I removed the 'public static function getSubscribedEvents' on the UserLocaleListener because it's useless, it's not an EventSubscriber. What do you think?
@@ -164,13 +164,6 @@ event:: | |||
$this->session->set('_locale', $user->getLocale()); | |||
} | |||
} | |||
|
|||
public static function getSubscribedEvents() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this method is gone, we can also remove the use Symfony\Component\EventDispatcher\EventSubscriberInterface;
at the top of this class. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz Thanks, it's done.
I was going to merge this ... but then I realized that the first part of the article explains a subscriber and the second part a listener. I think this is very confusing. Shouldn't we just use one subscriber and add more subscribed events as the article needs it? Let's ask to some doc maintainers: @wouterj and @xabbuh Thanks! |
If I remember correctly, we decided to always use event subscribers which by the way plays nicely with the autoconfiguration of services with Symfony 3.4+. |
Hi @xabbuh and @javiereguiluz, Is it ok if I update this PR and replace the event listener with event subscriber, similarly to what you've done on the 3.4 version of this doc? |
@bricelalu I'm sorry I forgot about this. It's now merged. The other big change mentioned can be done later in another PR. Thanks! |
This PR was squashed before being merged into the 2.8 branch (closes #9440). Discussion ---------- 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? <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 9ce4ce7 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?