Skip to content

Commit 5564059

Browse files
committed
[DependencyInjection] Respect original service class when a proxy is defined
1 parent ac67b6a commit 5564059

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
322322
if ($attribute instanceof AutowireCallable) {
323323
$value = $attribute->buildDefinition($value, $type, $parameter);
324324
} elseif ($lazy = $attribute->lazy) {
325+
if ($this->container->has($type)) {
326+
$type = $this->container->findDefinition($type)->getClass();
327+
}
325328
$definition = (new Definition($type))
326329
->setFactory('current')
327330
->setArguments([[$value ??= $getValue()]])

0 commit comments

Comments
 (0)