Skip to content
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

Allow subscribing events by class #295

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

norkunas
Copy link
Contributor

@norkunas norkunas commented Jan 21, 2022

Subscribing by event names was and old way before subscribing by event class name was not supported, so this enables it.

@norkunas norkunas force-pushed the event-aliases branch 3 times, most recently from f35f4a1 to e2ca33b Compare January 21, 2022 09:01
Copy link
Member

@yann-eugone yann-eugone 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 this Tomas.

I'm 100% aware that event names is not "the way to go" since few Symfony version.
But I've been struggling with BC to be able to remove it from the source code.
Now that you added the ability to register listener for both event name and event class, how can we inform developer that rely on event name that they must update their code for next major ?

src/DependencyInjection/PrestaSitemapExtension.php Outdated Show resolved Hide resolved
@norkunas
Copy link
Contributor Author

norkunas commented Jan 21, 2022

Thank you for this Tomas.

I'm 100% aware that event names is not "the way to go" since few Symfony version. But I've been struggling with BC to be able to remove it from the source code. Now that you added the ability to register listener for both event name and event class, how can we inform developer that rely on event name that they must update their code for next major ?

I think we could just add @deprecated on constants then? For example https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/HttpKernel/HttpKernelInterface.php MASTER_REQUEST constant

@norkunas norkunas force-pushed the event-aliases branch 7 times, most recently from 8832066 to c3b83bf Compare January 21, 2022 09:48
@yann-eugone
Copy link
Member

Thank you very much Tomas :)

@yann-eugone yann-eugone merged commit ad23fe5 into prestaconcept:3.x Jan 24, 2022
@norkunas norkunas deleted the event-aliases branch January 24, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants