diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index cd083ec7..ad6af891 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -30,7 +30,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -41,7 +41,7 @@ jobs: tools: composer:v2, cs2pr - name: "Cache dependencies" - uses: "actions/cache@v2" + uses: "actions/cache@v3" with: path: | ~/.composer/cache diff --git a/src/ProxyManager/Generator/MethodGenerator.php b/src/ProxyManager/Generator/MethodGenerator.php index a259b9c8..3c612144 100644 --- a/src/ProxyManager/Generator/MethodGenerator.php +++ b/src/ProxyManager/Generator/MethodGenerator.php @@ -6,6 +6,7 @@ use Laminas\Code\Generator\DocBlockGenerator; use Laminas\Code\Generator\MethodGenerator as LaminasMethodGenerator; +use Laminas\Code\Generator\ParameterGenerator; use Laminas\Code\Reflection\MethodReflection; use ReflectionException; use ReflectionMethod; @@ -23,7 +24,7 @@ class MethodGenerator extends LaminasMethodGenerator public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $reflectionMethod): self { /** @var static $method */ - $method = parent::copyMethodSignature($reflectionMethod); + $method = static::copyMethodSignature($reflectionMethod); $method->setInterface(false); $method->setBody(''); @@ -55,6 +56,19 @@ public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $re return $method; } + public static function copyMethodSignature(MethodReflection $reflectionMethod): parent + { + $method = parent::copyMethodSignature($reflectionMethod); + + foreach ($reflectionMethod->getParameters() as $reflectionParameter) { + $method->setParameter( + ParameterGenerator::fromReflection($reflectionParameter) + ); + } + + return $method; + } + public function getDocBlock(): ?DocBlockGenerator { $docBlock = parent::getDocBlock(); diff --git a/src/ProxyManager/Inflector/ClassNameInflector.php b/src/ProxyManager/Inflector/ClassNameInflector.php index 1b7a0e87..78079490 100644 --- a/src/ProxyManager/Inflector/ClassNameInflector.php +++ b/src/ProxyManager/Inflector/ClassNameInflector.php @@ -14,7 +14,7 @@ final class ClassNameInflector implements ClassNameInflectorInterface { - protected $proxyNamespace; + private $proxyNamespace; /** @var int @TODO annotation still needed for phpstan to understand this */ private $proxyMarkerLength; private $proxyMarker;