From d943d58c219b457403dc536f855d9d6f32e2280f Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 9 Mar 2023 17:10:16 +0100 Subject: [PATCH] InvalidPHPStanDocTagRule - added forgotten handling of ClassConst --- src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php | 1 + tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php b/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php index e214ea60be..a9435ff577 100644 --- a/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php +++ b/src/Rules/PhpDoc/InvalidPHPStanDocTagRule.php @@ -77,6 +77,7 @@ public function processNode(Node $node, Scope $scope): array && !$node instanceof Node\Stmt\Property && !$node instanceof Node\Expr\Assign && !$node instanceof Node\Expr\AssignRef + && !$node instanceof Node\Stmt\ClassConst ) { return []; } diff --git a/tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php b/tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php index 11ec1c6d15..1d83c10e5d 100644 --- a/tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php +++ b/tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php @@ -40,13 +40,13 @@ public function dataRule(): iterable 'Unknown PHPDoc tag: @phpstan-varr', 44, ], - ]; - yield [false, $errors]; - yield [true, array_merge($errors, [ [ 'Unknown PHPDoc tag: @phpstan-varr', 47, ], + ]; + yield [false, $errors]; + yield [true, array_merge($errors, [ [ 'Unknown PHPDoc tag: @phpstan-varr', 57,