Skip to content

Commit

Permalink
Ignore more nodes to reduce memory consumption (#105)
Browse files Browse the repository at this point in the history
Co-authored-by: clxmstaab <[email protected]>
  • Loading branch information
staabm and clxmstaab authored Sep 16, 2024
1 parent 27ab19c commit cf30537
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/TodoBySymfonyDeprecationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use UnexpectedValueException;

use function count;
use function sprintf;

/**
* @implements Rule<Node\Expr\FuncCall>
Expand Down
3 changes: 1 addition & 2 deletions src/TodoByTicketCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Collectors\Collector;
use RuntimeException;
use staabm\PHPStanTodoBy\utils\CommentMatcher;
use staabm\PHPStanTodoBy\utils\ticket\TicketRuleConfiguration;

Expand Down Expand Up @@ -38,7 +37,7 @@ public function processNode(Node $node, Scope $scope)
$line = $comment->getLine();

$text = $comment->getText();
$startLine =$comment->getStartLine();
$startLine = $comment->getStartLine();

/** @var array<int, array<array{0: string, 1: int}>> $matches */
foreach ($matches as $match) {
Expand Down
2 changes: 0 additions & 2 deletions src/TodoByTicketRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace staabm\PHPStanTodoBy;

use PhpParser\Comment;
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Node\CollectedDataNode;
Expand Down Expand Up @@ -129,5 +128,4 @@ private function hasPrefix(string $ticketKey): bool

return false;
}

}
1 change: 1 addition & 0 deletions src/utils/CommentMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static function matchComments(Node $node, string $pattern): iterable
if (
$node instanceof VirtualNode
|| $node instanceof Node\Expr
|| $node instanceof \PHPStan\Node\CollectedDataNode // see https://github.com/phpstan/phpstan/discussions/11701
) {
// prevent duplicate errors
return [];
Expand Down

0 comments on commit cf30537

Please sign in to comment.