Skip to content

Commit 17ae929

Browse files
nicolas-grekasGrundik
authored andcommitted
Fix generating proxies for arguments promoted as properties
1 parent 04e124d commit 17ae929

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

1112
/**
@@ -19,14 +20,27 @@ class MethodGenerator extends LaminasMethodGenerator
1920
public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $reflectionMethod): self
2021
{
2122
/** @var static $method */
22-
$method = parent::copyMethodSignature($reflectionMethod);
23+
$method = static::copyMethodSignature($reflectionMethod);
2324

2425
$method->setInterface(false);
2526
$method->setBody('');
2627

2728
return $method;
2829
}
2930

31+
public static function copyMethodSignature(MethodReflection $reflectionMethod): parent
32+
{
33+
$method = parent::copyMethodSignature($reflectionMethod);
34+
35+
foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
36+
$method->setParameter(
37+
ParameterGenerator::fromReflection($reflectionParameter)
38+
);
39+
}
40+
41+
return $method;
42+
}
43+
3044
/**
3145
* {@inheritDoc} override needed to specify type in more detail
3246
*/

0 commit comments

Comments
 (0)