Skip to content

[EventDispatcher] Fix position of AddEventAliasesPass #13509

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

Merged
merged 1 commit into from
Apr 10, 2020
Merged

[EventDispatcher] Fix position of AddEventAliasesPass #13509

merged 1 commit into from
Apr 10, 2020

Conversation

fsoedjede
Copy link
Contributor

In the note following the change, it's written : Note that AddEventAliasesPass has to be processed before RegisterListenersPass.
But in the code it was the inverse

In the note following the change, it's written : Note that ``AddEventAliasesPass`` has to be processed before ``RegisterListenersPass``.
But in the code it was the inverse
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

Did you experience this while using the code? Because I think the code is correct:

  • The order of processing is important, the order of registration is not.
  • The RegisterListenerPass is registered as PassConfig::TYPE_BEFORE_REMOVING, the AddEventAliasesPass class defaults to PassConfig::TYPE_BEFORE_OPTIMIZATION.
  • The order of processing of the container is: before optimization, optimization, after optimization, before removing, removing, after removing so the processing occurs in the correct order.

Anyway, I don't see much problem with changing the order in the example if that's more clear :)

@javiereguiluz
Copy link
Member

Thank you Felix.

@javiereguiluz javiereguiluz merged commit 5016434 into symfony:4.4 Apr 10, 2020
@fsoedjede
Copy link
Contributor Author

@wouterj You're right. It could have stayed as is. I didn't give enough attention to PassConfig::TYPE_BEFORE_REMOVING

Thanks for accepting!

@fsoedjede fsoedjede deleted the patch-2 branch April 10, 2020 14:47
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