Skip to content

Commit 514aa7b

Browse files
[DependencyInjection] Fix code generating lazy closures
1 parent f8cf281 commit 514aa7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Argument/LazyClosure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static function getCode(string $initializer, array $callable, Definition
7272
throw new RuntimeException(sprintf('Cannot create lazy closure for service "%s" because its corresponding callable is invalid.', $id));
7373
}
7474

75-
$code = ProxyHelper::exportSignature($r->getMethod($method));
75+
$code = ProxyHelper::exportSignature($r->getMethod($method), true, $args);
7676

7777
if ($asClosure) {
7878
$code = ' { '.preg_replace('/: static$/', ': \\'.$r->name, $code);
@@ -81,7 +81,7 @@ public static function getCode(string $initializer, array $callable, Definition
8181
}
8282

8383
$code = 'new class('.$initializer.') extends \\'.self::class
84-
.$code.' { return $this->service->'.$callable[1].'(...\func_get_args()); } '
84+
.$code.' { return $this->service->'.$callable[1].'('.$args.'); } '
8585
.'}';
8686

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"psr/container": "^1.1|^2.0",
2121
"symfony/deprecation-contracts": "^2.5|^3",
2222
"symfony/service-contracts": "^2.5|^3.0",
23-
"symfony/var-exporter": "^6.2.7"
23+
"symfony/var-exporter": "^6.2.10"
2424
},
2525
"require-dev": {
2626
"symfony/yaml": "^5.4|^6.0",

0 commit comments

Comments
 (0)