-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[DependencyInjection] Respect original service class when a proxy is defined #60766
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
base: 7.3
Are you sure you want to change the base?
Conversation
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 should have tests preventing regressions
@@ -322,6 +322,9 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a | |||
if ($attribute instanceof AutowireCallable) { | |||
$value = $attribute->buildDefinition($value, $type, $parameter); | |||
} elseif ($lazy = $attribute->lazy) { | |||
if ($this->container->has($type)) { | |||
$type = $this->container->findDefinition($type)->getClass(); |
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.
I don't think this should be done for the case where lazy
is an array specifying the exact interfaces that should be proxied
@nicolas-grekas Is it the way to go? If yes, I'll finish this PR asap |
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.
Yes, this needs to be fixed, good catch.
The class name should be extracted from $value instead I think, after the call to $getValue().
5564059
to
d45bd61
Compare
I updated the PR
|
Uh oh!
There was an error while loading. Please reload this page.