Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Conversation

bricelalu
Copy link
Contributor

Hi, I removed the 'public static function getSubscribedEvents' on the UserLocaleListener because it's useless, it's not an EventSubscriber. What do you think?

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()
Copy link
Member

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!

Copy link
Contributor Author

@bricelalu bricelalu Mar 15, 2018

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.

@javiereguiluz
Copy link
Member

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!

@xabbuh
Copy link
Member

xabbuh commented Mar 21, 2018

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+.

@bricelalu
Copy link
Contributor Author

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?

@javiereguiluz javiereguiluz added this to the 2.8 milestone Jul 24, 2018
@javiereguiluz
Copy link
Member

@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!

javiereguiluz added a commit that referenced this pull request Jul 24, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants