From 87561c95c84a341261f3d2bd726c87f0267c49b3 Mon Sep 17 00:00:00 2001 From: faissaloux Date: Fri, 18 Jul 2025 14:04:28 +0100 Subject: [PATCH] support phpstan 2.1.18 --- composer.json | 2 +- src/TestCaseForTypeCoverage.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5b1276c..2182729 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "license": "MIT", "require": { "php": "^8.2", - "phpstan/phpstan": "^1.12.21|^2.1.17", + "phpstan/phpstan": "^1.12.21|^2.1.18", "tomasvotruba/type-coverage": "^1.0.0|^2.0.2", "pestphp/pest-plugin": "^3.0.0" }, diff --git a/src/TestCaseForTypeCoverage.php b/src/TestCaseForTypeCoverage.php index a08f4f4..03f2ac8 100644 --- a/src/TestCaseForTypeCoverage.php +++ b/src/TestCaseForTypeCoverage.php @@ -110,7 +110,7 @@ public function gatherAnalyserErrors(array $files): array } $actualErrors = $analyserResult->getUnorderedErrors(); - $ruleErrorTransformer = new RuleErrorTransformer; + $ruleErrorTransformer = self::getContainer()->getByType(RuleErrorTransformer::class); if ($analyserResult->getCollectedData() !== []) { $ruleRegistry = new DirectRegistry($this->getRules()); $nodeType = CollectedDataNode::class; @@ -121,12 +121,12 @@ public function gatherAnalyserErrors(array $files): array $ruleErrors = $rule->processNode($node, $scope); foreach ($ruleErrors as $ruleError) { if ($this->ignored($ruleError)) { - $this->ignoredErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, $nodeType, $node->getLine()); + $this->ignoredErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node); continue; } - $actualErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, $nodeType, $node->getLine()); + $actualErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node); } } }