-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] add ServiceLocatorTagPass::register() to share service locators #22175
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
4ef4036
to
1ddb17b
Compare
👍 |
1ddb17b
to
ee17a10
Compare
7144c13
to
31657cc
Compare
ba03a95
to
659df71
Compare
} | ||
|
||
/** | ||
* @param Reference[] $refMap |
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.
the phpdoc does not match the signature (which can confuse some IDEs which will ask consumers to pass the refMap as first argument)
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.
fixed
659df71
to
8ff764b
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.
👍
Thank you @nicolas-grekas. |
…rvice locators (nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] add ServiceLocatorTagPass::register() to share service locators | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new `AbstractController` as a service subscribers). This PR fixes this issue, and a few related others found along the way. Commits ------- 8ff764b [DI] add ServiceLocatorTagPass::register() to share service locators
Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new
AbstractController
as a service subscribers).This PR fixes this issue, and a few related others found along the way.