We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1a1877 commit 46ddb5bCopy full SHA for 46ddb5b
src/Symfony/Component/DependencyInjection/Attribute/AutowireCallable.php
@@ -45,7 +45,7 @@ public function __construct(
45
46
public function buildDefinition(mixed $value, ?string $type, \ReflectionParameter $parameter): Definition
47
{
48
- return (new Definition($type = $type ?: 'Closure'))
+ return (new Definition($type = \is_array($this->lazy) ? current($this->lazy) : ($type ?: 'Closure')))
49
->setFactory(['Closure', 'fromCallable'])
50
->setArguments([\is_array($value) ? $value + [1 => '__invoke'] : $value])
51
->setLazy($this->lazy || 'Closure' !== $type && 'callable' !== (string) $parameter->getType());
0 commit comments