From 922a18794a68a201b7b47a016900feb13e461b2b Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Jan 2026 09:30:17 +0100 Subject: [PATCH] skip as part of desc --- src/Rules/NoMissnamedDocTagRule.php | 4 ++-- .../Fixture/SkipPartOfComment.php | 13 +++++++++++++ .../NoMissnamedDocTagRuleTest.php | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/Rules/NoMissnamedDocTagRule/Fixture/SkipPartOfComment.php 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 @@ +