Skip to content

Update authentication.rst #13072

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 1 commit into from
Closed

Update authentication.rst #13072

wants to merge 1 commit into from

Conversation

Dominic-Mayers
Copy link
Contributor

I think we do not have to implement the ListenerInterface anymore in the example class SomeAuthenticationListener.

I think we do not have to implement the ListenerInterface anymore.
@Dominic-Mayers
Copy link
Contributor Author

OK, it's the same as #13069 .

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not have to implement the ListenerInterface anymore

Correct. It was deprecated in 4.4 and removed in 5.0. The upgrade guide suggests extending to AbstractListener but in the Slack community I have seen a few posts in support about making them callables:

use Symfony\Component\HttpKernel\Event\RequestEvent;

class MyListener
{
    public function __invoke(RequestEvent $event)
    {
        // code
    }
}

WDYT?

@HeahDude HeahDude added this to the 4.4 milestone Feb 9, 2020
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for that PR!
Could you check other places mentioned in #13069 as well?
I also agree that we should use __invoke in examples (#13072 (review)), the PR should target 4.4 though, so devs starting projects on the LTS don't use deprecated code. Thanks!

@HeahDude
Copy link
Contributor

HeahDude commented Feb 9, 2020

Forget my comment, we can close here in favor of #13083.

@HeahDude
Copy link
Contributor

Closing since #13083 has been merged. Thanks!

@HeahDude HeahDude closed this Feb 10, 2020
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.

3 participants