Skip to content

[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

Open
wants to merge 1 commit into
base: 6.4
Choose a base branch
from

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jun 11, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60765
License MIT

Copy link
Member

@stof stof left a 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();
Copy link
Member

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

@lyrixx
Copy link
Member Author

lyrixx commented Jun 16, 2025

@nicolas-grekas Is it the way to go? If yes, I'll finish this PR asap

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy