Skip to content

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