Skip to content

Commit f0b3d52

Browse files
committed
Dial back a bit
1 parent e5ad342 commit f0b3d52

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Analyser/RuleErrorTransformer.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPStan\Rules\LineRuleError;
99
use PHPStan\Rules\MetadataRuleError;
1010
use PHPStan\Rules\NonIgnorableRuleError;
11+
use PHPStan\Rules\RuleError;
1112
use PHPStan\Rules\TipRuleError;
1213

1314
final class RuleErrorTransformer
@@ -17,7 +18,7 @@ final class RuleErrorTransformer
1718
* @param class-string<Node> $nodeType
1819
*/
1920
public function transform(
20-
IdentifierRuleError $ruleError,
21+
RuleError $ruleError,
2122
Scope $scope,
2223
string $nodeType,
2324
int $nodeLine,
@@ -29,6 +30,7 @@ public function transform(
2930
$filePath = $scope->getFile();
3031
$traitFilePath = null;
3132
$tip = null;
33+
$identifier = null;
3234
$metadata = [];
3335
if ($scope->isInTrait()) {
3436
$traitReflection = $scope->getTraitReflection();
@@ -56,6 +58,10 @@ public function transform(
5658
$tip = $ruleError->getTip();
5759
}
5860

61+
if ($ruleError instanceof IdentifierRuleError) {
62+
$identifier = $ruleError->getIdentifier();
63+
}
64+
5965
if ($ruleError instanceof MetadataRuleError) {
6066
$metadata = $ruleError->getMetadata();
6167
}
@@ -74,7 +80,7 @@ public function transform(
7480
$tip,
7581
$nodeLine,
7682
$nodeType,
77-
$ruleError->getIdentifier(),
83+
$identifier,
7884
$metadata,
7985
);
8086
}

0 commit comments

Comments
 (0)