Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ public function refactor(Node $node): null|ClassMethod|Function_
return null;
}

// we cannot be sure here
if ($this->shouldSkip($stmts)) {
$assignedVariableNamesByStmtPosition = $this->resolvedAssignedVariablesByStmtPosition($stmts);
if ($assignedVariableNamesByStmtPosition === []) {
return null;
}

$assignedVariableNamesByStmtPosition = $this->resolvedAssignedVariablesByStmtPosition($stmts);
// we cannot be sure here, deep walk only when there is a candidate to remove
if ($this->shouldSkip($stmts)) {
return null;
}

$hasChanged = false;

Expand Down
Loading