Skip to content

Commit 3ca65b8

Browse files
Fix generating proxies for arguments promoted as properties
1 parent 70d9e16 commit 3ca65b8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/ProxyManager/Generator/MethodGenerator.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Laminas\Code\Generator\DocBlockGenerator;
88
use Laminas\Code\Generator\MethodGenerator as LaminasMethodGenerator;
9+
use Laminas\Code\Generator\ParameterGenerator;
910
use Laminas\Code\Reflection\MethodReflection;
1011
use ReflectionException;
1112
use ReflectionMethod;
@@ -23,7 +24,7 @@ class MethodGenerator extends LaminasMethodGenerator
2324
public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $reflectionMethod): self
2425
{
2526
/** @var static $method */
26-
$method = parent::copyMethodSignature($reflectionMethod);
27+
$method = static::copyMethodSignature($reflectionMethod);
2728

2829
$method->setInterface(false);
2930
$method->setBody('');
@@ -55,6 +56,19 @@ public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $re
5556
return $method;
5657
}
5758

59+
public static function copyMethodSignature(MethodReflection $reflectionMethod): parent
60+
{
61+
$method = parent::copyMethodSignature($reflectionMethod);
62+
63+
foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
64+
$method->setParameter(
65+
ParameterGenerator::fromReflection($reflectionParameter)
66+
);
67+
}
68+
69+
return $method;
70+
}
71+
5872
public function getDocBlock(): ?DocBlockGenerator
5973
{
6074
$docBlock = parent::getDocBlock();

0 commit comments

Comments
 (0)