Skip to content

Commit

Permalink
Update src/Symfony/Component/DependencyInjection/Argument/LazyClosure…
Browse files Browse the repository at this point in the history
….php

Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
  • Loading branch information
ruudk and nicolas-grekas committed Aug 3, 2023
1 parent 2cab4b7 commit 4b77c0f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -88,7 +88,7 @@ public static function getCode(string $initializer, array $callable, Definition
}

$code = 'new class('.$initializer.') extends \\'.self::class
.$code.' { '.($methodReflector->getReturnType() instanceof \ReflectionNamedType && 'void' === $methodReflector->getReturnType()->getName() ? '' : 'return ').'$this->service->'.$callable[1].'('.$args.'); } '
.$code.' { '.($methodReflector->hasReturnType() && 'void' === (string) $methodReflector->getReturnType() ? '' : 'return ').'$this->service->'.$callable[1].'('.$args.'); } '
.'}';

return $asClosure ? '('.$code.')->'.$method.'(...)' : $code;
Expand Down

0 comments on commit 4b77c0f

Please sign in to comment.