Skip to content

Commit ccc6d1e

Browse files
authored
Allow webmozart/assert to ^2.1 (#71)>
* Upgrade webmozart/assert to ^2.1 * allow ^2.1 * Rectify * cs fix * final touch: skip StringClassNameToClassConstantRector * final touch: fix cs
1 parent ec6e6f8 commit ccc6d1e

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

build/target-repository/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"require": {
77
"php": "^7.4|^8.0",
88
"phpstan/phpstan": "^2.1.14",
9-
"webmozart/assert": "^1.11"
9+
"webmozart/assert": "^1.11 || ^2.1"
1010
},
1111
"autoload": {
1212
"psr-4": {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"require": {
77
"php": "^8.2",
88
"phpstan/phpstan": "^2.1.30",
9-
"webmozart/assert": "^1.11"
9+
"webmozart/assert": "^1.11 || ^2.1"
1010
},
1111
"require-dev": {
1212
"nikic/php-parser": "^5.6",

rector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6+
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
67

78
return RectorConfig::configure()
89
->withPhpSets()
@@ -18,4 +19,4 @@
1819
)
1920
->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/tests'])
2021
->withImportNames(removeUnusedImports: true)
21-
->withSkip(['*/Source/*', '*/Fixture/*']);
22+
->withSkip(['*/Source/*', '*/Fixture/*', StringClassNameToClassConstantRector::class]);

src/Rules/NoParamTypeRemovalRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function processNode(Node $node, Scope $scope): array
8282

8383
private function resolveParentParamType(PhpMethodReflection $phpMethodReflection, int $paramPosition): Type
8484
{
85-
foreach ($phpMethodReflection->getVariants() as $variant) {
86-
foreach ($variant->getParameters() as $parentParamPosition => $parameterReflectionWithPhpDoc) {
85+
foreach ($phpMethodReflection->getVariants() as $extendedParametersAcceptor) {
86+
foreach ($extendedParametersAcceptor->getParameters() as $parentParamPosition => $parameterReflectionWithPhpDoc) {
8787
if ($paramPosition !== $parentParamPosition) {
8888
continue;
8989
}

0 commit comments

Comments
 (0)