From b08471a02a52d0174a6578468d0fbf9df9e6a151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Sun, 2 Mar 2025 09:03:13 +0100 Subject: [PATCH] Bump rector/rector and phpstan/phpstan to ^2.0 (#26) --- composer.json | 11 ++++++----- phpstan-baseline.neon | 31 +++++++++++++++++++++++++++++++ phpstan.neon | 1 + 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 phpstan-baseline.neon diff --git a/composer.json b/composer.json index ef25878..7c5de8d 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": "^5.4", "symfony/console": "^5.4", "symfony/dependency-injection": "^5.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" }, @@ -34,7 +34,8 @@ }, "autoload-dev": { "psr-4": { - "Ibexa\\Rector\\Tests\\": "tests/lib/" + "Ibexa\\Rector\\Tests\\": "tests/lib/", + "Ibexa\\Contracts\\Rector\\Tests\\": "tests/contracts/" } }, "scripts": { 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