From 7ba7d702884130b2132468f149f4fbb5ae6aaa04 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 13 May 2024 17:36:16 +0100 Subject: [PATCH] fix: support for latest phpstan version --- composer.json | 6 +++--- phpstan.neon | 2 +- src/PHPStanAnalyser.php | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 08a7a8c..37cc311 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ "license": "MIT", "require": { "php": "^8.1", - "phpstan/phpstan": "^1.10.60", - "tomasvotruba/type-coverage": "^0.2.1", + "phpstan/phpstan": "^1.11.0", + "tomasvotruba/type-coverage": "^0.2.8", "pestphp/pest-plugin": "^2.1.1" }, "autoload": { @@ -25,7 +25,7 @@ } }, "require-dev": { - "pestphp/pest": "^2.30.0", + "pestphp/pest": "^2.34.7", "pestphp/pest-dev-tools": "^2.16.0" }, "minimum-stability": "dev", diff --git a/phpstan.neon b/phpstan.neon index d0b5465..3e57a07 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,10 +9,10 @@ parameters: - src checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: false reportUnmatchedIgnoredErrors: true ignoreErrors: + - identifier: missingType.generics - "#is not allowed to extend#" - "#is not covered by backward compatibility promise#" - "#is concrete, but does not have a Test suffix.#" diff --git a/src/PHPStanAnalyser.php b/src/PHPStanAnalyser.php index c477777..072156c 100644 --- a/src/PHPStanAnalyser.php +++ b/src/PHPStanAnalyser.php @@ -7,6 +7,7 @@ use PhpParser\Node; use PHPStan\Analyser\Analyser; use PHPStan\Analyser\FileAnalyser; +use PHPStan\Analyser\LocalIgnoresProcessor; use PHPStan\Analyser\NodeScopeResolver; use PHPStan\Analyser\RuleErrorTransformer; use PHPStan\Collectors\Collector; @@ -81,7 +82,7 @@ public static function make(Container $container, array $rules, array $collector $container->getService('defaultAnalysisParser'), // @phpstan-ignore-line $container->getByType(DependencyResolver::class), new RuleErrorTransformer(), - true + $container->getByType(LocalIgnoresProcessor::class), ); return new Analyser($fileAnalyser, $ruleRegistry, $collectorRegistry, $nodeScopeResolver, 9_999_999_999_999);