-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Fix using private services in expressions #23654
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
208bf05
to
68744e6
Compare
@@ -299,7 +299,7 @@ protected function getMethodCall1Service() | |||
|
|||
$instance->setBar($this->get('foo')); | |||
$instance->setBar(NULL); | |||
$instance->setBar(($this->get("foo")->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default")))); | |||
$instance->setBar(($this->get('foo')->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default")))); |
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.
You changed an instance of double quotes to single quotes on this line, but left three other instances untouched. Why not change them all to single quotes?
Never mind; I didn't notice this was a "compiled" file. I guess you would need to search out where else this is generated, which is likely not worth the effort.
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.
That's a minor, yet important side effect of the way this block of code is generated.
Will be even more visible in 3.3 where this will be something completely different.
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.
Can't wait! :-)
68744e6
to
9c08256
Compare
In fact, the remaining issue is now fixed in this very PR, as bug fix: private services used only in expressions are now considered when building the service dependency graph. |
9c08256
to
f3da6cf
Compare
…ekas) This PR was merged into the 3.2 branch. Discussion ---------- [DI] Fix using private services in expressions | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Since 3.2, fetching private services via `$container->get()` is deprecated. This makes it impossible to use a private service in an expression. Until this PR :) Commits ------- f3da6cf [DI] Fix using private services in expressions
Since 3.2, fetching private services via
$container->get()
is deprecated.This makes it impossible to use a private service in an expression.
Until this PR :)