Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Rule/DeadCodeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,19 @@ public function processNode(
}
}

return $this->processKnownCollectedUsages($knownCollectedUsages);
$errors = $this->processKnownCollectedUsages($knownCollectedUsages);

// the usage graph is the analysis output and has just been turned into errors;
// processNode(CollectedDataNode) runs once per process, so this state would
// otherwise stay allocated for the rest of the process (~90k objects on a
// 2.4k-file codebase). DebugUsagePrinter received its own copies earlier;
// $typeDefinitions and $mixedClassNameUsages are kept for print().
$this->traitMembers = [];
$this->memberAlternativesCache = [];
$this->blackMembers = [];
$this->usageGraph = [];

return $errors;
}

/**
Expand Down
Loading