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,