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 d3b6181 commit 85cfebbCopy full SHA for 85cfebb
Attribute/AutowireCallable.php
@@ -42,7 +42,7 @@ public function __construct(
42
43
public function buildDefinition(mixed $value, ?string $type, \ReflectionParameter $parameter): Definition
44
{
45
- return (new Definition($type = \is_string($this->lazy) ? $this->lazy : ($type ?: 'Closure')))
+ return (new Definition($type = \is_array($this->lazy) ? current($this->lazy) : ($type ?: 'Closure')))
46
->setFactory(['Closure', 'fromCallable'])
47
->setArguments([\is_array($value) ? $value + [1 => '__invoke'] : $value])
48
->setLazy($this->lazy || 'Closure' !== $type && 'callable' !== (string) $parameter->getType());
0 commit comments