Description
Hey!
I'm currently playing with the dependency injection component and I'm stuck with compiler pass execution order. Let's explain my issue:
Given you want to attach a listener to an event dispatcher throught a compiler pass by adding a tag (in my case, doctrine.event_listener
) on a service based on an other tag which is project specific. In this case, you must define your compiler pass before the doctrine one because it collects tagged services on the PassConfig::TYPE_BEFORE_OPTIMIZATION
which is the very first pass run and so, my added tag is not used because it is added too late in the process.
So, basically, in my case the order inside each pass is critical. I have thought about adding a new pass before the PassConfig::TYPE_BEFORE_OPTIMIZATION
but it will result to the same issue for this new pass.
Then, maybe a good alternative can be to introduce priority inside each pass or totally get rid of passes and only rely on priority. It seems a pretty good candidate for the event dispatcher component? What do you think?