diff --git a/build/target-repository/composer.json b/build/target-repository/composer.json index c381ac59..163eaeba 100644 --- a/build/target-repository/composer.json +++ b/build/target-repository/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^7.4|^8.0", "phpstan/phpstan": "^2.1.14", - "webmozart/assert": "^1.11" + "webmozart/assert": "^1.11 || ^2.1" }, "autoload": { "psr-4": { diff --git a/composer.json b/composer.json index d339a3fc..82b1d73b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "require": { "php": "^8.2", "phpstan/phpstan": "^2.1.30", - "webmozart/assert": "^1.11" + "webmozart/assert": "^1.11 || ^2.1" }, "require-dev": { "nikic/php-parser": "^5.6", diff --git a/rector.php b/rector.php index d8b5f54a..5ab34842 100644 --- a/rector.php +++ b/rector.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Rector\Config\RectorConfig; +use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; return RectorConfig::configure() ->withPhpSets() @@ -18,4 +19,4 @@ ) ->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/tests']) ->withImportNames(removeUnusedImports: true) - ->withSkip(['*/Source/*', '*/Fixture/*']); + ->withSkip(['*/Source/*', '*/Fixture/*', StringClassNameToClassConstantRector::class]); diff --git a/src/Rules/NoParamTypeRemovalRule.php b/src/Rules/NoParamTypeRemovalRule.php index cb473990..8d64dfae 100644 --- a/src/Rules/NoParamTypeRemovalRule.php +++ b/src/Rules/NoParamTypeRemovalRule.php @@ -82,8 +82,8 @@ public function processNode(Node $node, Scope $scope): array private function resolveParentParamType(PhpMethodReflection $phpMethodReflection, int $paramPosition): Type { - foreach ($phpMethodReflection->getVariants() as $variant) { - foreach ($variant->getParameters() as $parentParamPosition => $parameterReflectionWithPhpDoc) { + foreach ($phpMethodReflection->getVariants() as $extendedParametersAcceptor) { + foreach ($extendedParametersAcceptor->getParameters() as $parentParamPosition => $parameterReflectionWithPhpDoc) { if ($paramPosition !== $parentParamPosition) { continue; }