-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument #22024
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
Conversation
ec2285b
to
d097928
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes good sense to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
<argument key="session" type="service" id="session" on-invalid="null" /> | ||
<argument type="service"> | ||
<service class="Symfony\Component\DependencyInjection\ServiceLocator"> | ||
<tag name="service_locator" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all other tags are of the "X.Y" form. Not sure if we need to call it container.service_locator
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tag renamed to container.service_locator
d097928
to
fb016d6
Compare
fb016d6
to
5d230b5
Compare
Thank you @nicolas-grekas. |
…es ServiceLocatorArgument (nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (master only) | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I first started working on adding this new "container.service_locator" tag, so here it is. It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.) Then I realized that this allowed us to entirely drop `ServiceLocatorArgument` and replace it with the more flexible `ServiceClosureArgument`. This makes things simpler overall, see diff stat. Commits ------- 5d230b5 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument
If you always use |
This PR was merged into the 1.5-dev branch. Discussion ---------- Related to symfony/symfony#22024 Let's hope I don't have to fix this again 😅 Commits ------- 2fa6076 Fix tests failure for Symfony 3.3-dev
@sstok adding |
This PR was merged into the 2.0-dev branch. Discussion ---------- | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT Symfony 3.3-dev changed the way how ServiceLocators are registered symfony/symfony#22024 Commits ------- e2c028b Fix compatibility for latest Symfony version
…guiluz) This PR was merged into the master branch. Discussion ---------- [DI] Add section about service locators Adds documentation for symfony/symfony#21553 and symfony/symfony#22024. Any suggestion will be much appreciated, as usual. Commits ------- fa19770 Fix service locator declaration f5e4942 Rewords 5efacd0 [DI] Add section about Service Locators
I first started working on adding this new "container.service_locator" tag, so here it is.
It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.)
Then I realized that this allowed us to entirely drop
ServiceLocatorArgument
and replace it with the more flexibleServiceClosureArgument
.This makes things simpler overall, see diff stat.