Skip to content

Commit

Permalink
Fix comment (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored Sep 16, 2024
1 parent e90df6d commit f64a1c7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/utils/CommentMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ final class CommentMatcher
*/
public static function matchComments(Node $node, string $pattern): iterable
{
if (
$node instanceof Node\Stmt\InlineHTML
|| $node instanceof \PHPStan\Node\CollectedDataNode // see https://github.com/phpstan/phpstan/discussions/11701
) {
// prevent unnecessary work / reduce memory consumption
return [];
}

if (
$node instanceof VirtualNode
|| $node instanceof Node\Expr
|| $node instanceof Node\Stmt\InlineHTML
|| $node instanceof \PHPStan\Node\CollectedDataNode // see https://github.com/phpstan/phpstan/discussions/11701
) {
// prevent duplicate errors
return [];
Expand Down

0 comments on commit f64a1c7

Please sign in to comment.