-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Remove synthetic services from methodMap + generated methods #21244
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
@@ -285,15 +285,15 @@ public function testGetCircularReference() | |||
} | |||
|
|||
/** | |||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException | |||
* @expectedExceptionMessage You have requested a synthetic service ("request"). The DIC does not know how to construct this service. | |||
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException |
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.
We go from \RuntimeException
to \InvalidArgumentException
now.. minor BC break :)
👍 for master, as it's needed to keep things simple.
The generated method (and it existence in the method map) has another purpose: it allows |
@stof, yes, and my point is that we don't care, because these are erroneous situations anyway. The fact the current behavior prevents meaningful progress largely wins over the small&rare DX+ that it provides. |
👍 |
It makes sense right? Ie. we dont have Imo. the exception is even better now, service not found. |
What if an alias refers a pre-defined service? I think |
3775ba8
to
c1e1e99
Compare
@ro0NL updated, was that what you meant? |
Yep 👍 |
👍 |
Thank you @nicolas-grekas. |
…ted methods (nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Remove synthetic services from methodMap + generated methods | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - For synthetic services, the generated methods are just dead code to fill opcache ;) And having them in "methodMap" prevents using the property for checking if a service comes from a (non-synthetic) definition or not. This prepares some changes that we'd like to do in 4.0, see #19668. Commits ------- c1e1e99 [DI] Remove synthetic services from methodMap + generated methods
For synthetic services, the generated methods are just dead code to fill opcache ;)
And having them in "methodMap" prevents using the property for checking if a service comes from a (non-synthetic) definition or not.
This prepares some changes that we'd like to do in 4.0, see #19668.