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

[DI] New container.service_subscriber & ServiceSubscriberInterface #7740

Closed
weaverryan opened this issue Apr 1, 2017 · 5 comments
Closed
Labels
DependencyInjection hasPR A Pull Request has already been submitted for this issue.
Milestone

Comments

@weaverryan
Copy link
Member

See symfony/symfony#21708

@weaverryan
Copy link
Member Author

@chalasr This is pretty closely related to #7458, right? Would it make sense to put them all in the same article?

@chalasr
Copy link
Member

chalasr commented May 5, 2017

@weaverryan This is a whole concept (built on top of #7458) allowing to request some entries from the DIC at the PHP level. I think it deserves its own article, the need for this feature should be different that the one for #7458 (right now the class must know which services they want exactly, #7458 is more about collecting tagged services).

@nicolas-grekas pov would be good!

@nicolas-grekas
Copy link
Member

nicolas-grekas commented May 5, 2017

It's like event listeners vs subscribers.
Personally, I'd advocate to promote subscribers over listeners, for events and for services.

@chalasr
Copy link
Member

chalasr commented May 5, 2017

I agree and it's already the case for events, that doesn't make listeners useless though. But creating locators by hand remain the way to go for collecting services for a given tag, that is especially useful for third party libs/bundles and the core. Opened symfony/symfony#22649 for a related proposal.

@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Feb 8, 2018
@codedmonkey
Copy link
Contributor

I've created a concept page in #9223. It still needs some improvements though, especially properly describing getSubscribedServices(). It's probably also worth mentioning on the page that you're probably already using it through AbstractController. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DependencyInjection hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

No branches or pull requests

6 participants