diff --git a/composer.json b/composer.json index 7e21db0..99c5495 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ ], "require": { "php": ">=8.3", - "rector/rector": "^1.0", + "rector/rector": "^2.0", "symfony/config": "^6.4", "symfony/console": "^6.4", "symfony/dependency-injection": "^6.4", @@ -20,9 +20,9 @@ "require-dev": { "ibexa/code-style": "~2.0.0", "nikic/php-parser": "^4.18", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-symfony": "^1.3", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-symfony": "^2.0", "phpunit/phpunit": "^10", "qossmic/deptrac-shim": "^0.24.0 || ^1.0.2" }, diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..32e187b --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,31 @@ +parameters: + ignoreErrors: + - + message: '#^PHPDoc tag @var with type array\\|null is not subtype of native type array\.$#' + identifier: varTag.nativeType + count: 1 + path: src/lib/Rule/Internal/RemoveInterfaceWithMethodsRector.php + + - + message: '#^Doing instanceof PHPStan\\Type\\ObjectType is error\-prone and deprecated\. Use Type\:\:isObject\(\) or Type\:\:getObjectClassNames\(\) instead\.$#' + identifier: phpstanApi.instanceofType + count: 1 + path: src/lib/Rule/PropertyToGetterRector.php + + - + message: '#^Doing instanceof PHPStan\\Type\\ObjectType is error\-prone and deprecated\. Use Type\:\:isObject\(\) or Type\:\:getObjectClassNames\(\) instead\.$#' + identifier: phpstanApi.instanceofType + count: 1 + path: src/lib/Rule/RemoveArgumentFromMethodCallRector.php + + - + message: '#^Method Ibexa\\Rector\\Visitor\\DependentMethodCallRemovingVisitor\:\:leaveNode\(\) never returns array\ so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/lib/Visitor/DependentMethodCallRemovingVisitor.php + + - + message: '#^Method Ibexa\\Rector\\Visitor\\DependentMethodCallRemovingVisitor\:\:leaveNode\(\) never returns int so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/lib/Visitor/DependentMethodCallRemovingVisitor.php diff --git a/phpstan.neon b/phpstan.neon index 3756f56..e85bd74 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,7 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon - vendor/phpstan/phpstan-symfony/extension.neon + - phpstan-baseline.neon parameters: level: 8