Skip to content

No longer recommend injecting the service container #13486

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

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Apr 4, 2020

Fixes #13469

I think it makes sense to no longer document injecting the service container. Service subscriber is the better alternative in any case.

I actually also thought about removing setting a service public at all. But let's keep it for now (it is sometimes usefull in tests see e.g. symfony/symfony#36147 and #12647 . It's also a bit weird to have a "Public Versus Private Services" section that only discusses "private" services

@wouterj wouterj added this to the 5.1 milestone Apr 4, 2020
@wouterj wouterj force-pushed the issue-13469/containerinterface-alias branch from 07e91ef to 156ac13 Compare April 4, 2020 13:34
@javiereguiluz
Copy link
Member

Thanks Wouter!

@javiereguiluz javiereguiluz merged commit 3cf3035 into symfony:master Apr 6, 2020
@wouterj wouterj deleted the issue-13469/containerinterface-alias branch April 6, 2020 12: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.

[DependencyInjection] Deprecate ContainerInterface aliases
4 participants