Skip to content

Commit

Permalink
Fix orig node set on ChangeNestedForeachIfsToEarlyContinueRector
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 17, 2024
1 parent c0c4c25 commit ebc06ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class CommentInsideIfStatement
if ($value !== 5) {
continue;
}
// why am I doing this?
if ($value !== 10) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public function refactor(Node $node): ?Node
return null;
}

foreach ($nestedIfsWithOnlyNonReturn as $nestedIf) {
$nestedIf->cond->setAttribute(AttributeKey::ORIGINAL_NODE, null);
}

return $this->processNestedIfsWithNonBreaking($node, $nestedIfsWithOnlyNonReturn);
}

Expand Down

0 comments on commit ebc06ca

Please sign in to comment.