Currently, you can only find tagged services on ContainerBuilder, not ContainerInterface.
This leads to implementing a compiler pass object (the only place to get a ContainerBuilder) that finds the tagged services, and then adds them to th container as a parameter that you later use as an argument to a service.
This seems like an unnecessary step to me. If we're storing the list of each tagged service on the "compiled" container, why not just also store a map of tag => services?
If we did that, we could add a findTaggedServiceIds method on our runtime Container. That would allow us to just pass the container to the object that needs it, and it can find the tagged services whenever it needs to. Any object that is going to do something with a list of service ids is going to need the container anyhow, so this seems a lot simpler to me.
Also, this is something that we could maybe do upstream.
Comments
Comment #1
msonnabaum CreditAttribution: msonnabaum commented