Skip to content

Commit 2715e6d

Browse files
authored
Fix exhaustive memory consumption (#110)
Co-authored-by: staabm <staabm@users.noreply.github.com>
1 parent 6822306 commit 2715e6d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/TodoByTicketCollector.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ public function processNode(Node $node, Scope $scope)
5555
}
5656
}
5757

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

6166
private function createPattern(): string

0 commit comments

Comments
 (0)