Skip to content

Commit f64a1c7

Browse files
authored
Fix comment (#107)
1 parent e90df6d commit f64a1c7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/utils/CommentMatcher.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ final class CommentMatcher
1616
*/
1717
public static function matchComments(Node $node, string $pattern): iterable
1818
{
19+
if (
20+
$node instanceof Node\Stmt\InlineHTML
21+
|| $node instanceof \PHPStan\Node\CollectedDataNode // see https://github.com/phpstan/phpstan/discussions/11701
22+
) {
23+
// prevent unnecessary work / reduce memory consumption
24+
return [];
25+
}
26+
1927
if (
2028
$node instanceof VirtualNode
2129
|| $node instanceof Node\Expr
22-
|| $node instanceof Node\Stmt\InlineHTML
23-
|| $node instanceof \PHPStan\Node\CollectedDataNode // see https://github.com/phpstan/phpstan/discussions/11701
2430
) {
2531
// prevent duplicate errors
2632
return [];

0 commit comments

Comments
 (0)