diff --git a/src/Rules/NoMissnamedDocTagRule.php b/src/Rules/NoMissnamedDocTagRule.php index 83e75082..5d30ed9b 100644 --- a/src/Rules/NoMissnamedDocTagRule.php +++ b/src/Rules/NoMissnamedDocTagRule.php @@ -54,7 +54,7 @@ public function processNode(Node $node, Scope $scope): array continue; } - $matches = Strings::match($classMethod->getDocComment()->getText(), '#(@var)\b#mi'); + $matches = Strings::match($classMethod->getDocComment()->getText(), '#\*\s(@var)\b#mi'); if ($matches === null) { continue; } @@ -71,7 +71,7 @@ public function processNode(Node $node, Scope $scope): array continue; } - $matches = Strings::match($property->getDocComment()->getText(), '#(@param|@return)\b#mi'); + $matches = Strings::match($property->getDocComment()->getText(), '#\*\s(@param|@return)\b#mi'); if ($matches === null) { continue; } diff --git a/tests/Rules/NoMissnamedDocTagRule/Fixture/SkipPartOfComment.php b/tests/Rules/NoMissnamedDocTagRule/Fixture/SkipPartOfComment.php new file mode 100644 index 00000000..46213b41 --- /dev/null +++ b/tests/Rules/NoMissnamedDocTagRule/Fixture/SkipPartOfComment.php @@ -0,0 +1,13 @@ +