Skip to content

Commit 730b3d2

Browse files
authored
skip as part of desc (#258)
1 parent 4db6301 commit 730b3d2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/Rules/NoMissnamedDocTagRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function processNode(Node $node, Scope $scope): array
5454
continue;
5555
}
5656

57-
$matches = Strings::match($classMethod->getDocComment()->getText(), '#(@var)\b#mi');
57+
$matches = Strings::match($classMethod->getDocComment()->getText(), '#\*\s(@var)\b#mi');
5858
if ($matches === null) {
5959
continue;
6060
}
@@ -71,7 +71,7 @@ public function processNode(Node $node, Scope $scope): array
7171
continue;
7272
}
7373

74-
$matches = Strings::match($property->getDocComment()->getText(), '#(@param|@return)\b#mi');
74+
$matches = Strings::match($property->getDocComment()->getText(), '#\*\s(@param|@return)\b#mi');
7575
if ($matches === null) {
7676
continue;
7777
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Symplify\PHPStanRules\Tests\Rules\NoMissnamedDocTagRule\Fixture;
6+
7+
final class SkipPartOfComment
8+
{
9+
/**
10+
* Designed to position @return string in the comment
11+
*/
12+
private $position;
13+
}

tests/Rules/NoMissnamedDocTagRule/NoMissnamedDocTagRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static function provideData(): Iterator
3939
]];
4040

4141
yield [__DIR__ . '/Fixture/SkipValidPropertyTag.php', []];
42+
yield [__DIR__ . '/Fixture/SkipPartOfComment.php', []];
4243
}
4344

4445
/**

0 commit comments

Comments
 (0)