Skip to content

Commit

Permalink
Fix exhaustive memory consumption (#110)
Browse files Browse the repository at this point in the history
Co-authored-by: staabm <staabm@users.noreply.github.com>
  • Loading branch information
staabm and staabm authored Sep 16, 2024
1 parent 6822306 commit 2715e6d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TodoByTicketCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public function processNode(Node $node, Scope $scope)
}
}

return $tickets;
// don't return empty array so we don't pollute the result cache
// see https://github.com/phpstan/phpstan/discussions/11701#discussioncomment-10660711
if ([] !== $tickets) {
return $tickets;
}
return null;
}

private function createPattern(): string
Expand Down

0 comments on commit 2715e6d

Please sign in to comment.