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 @@ -83,20 +83,11 @@ private function processContextInIssetOrUnset(Isset_|Unset_ $node): void

private function processContextInIf(If_|Else_|ElseIf_ $node): void
{
$this->simpleCallableNodeTraverser->traverseNodesWithCallable(
$node->stmts,
static function (Node $subNode): ?int {
if ($subNode instanceof Class_ || $subNode instanceof Function_ || $subNode instanceof Closure) {
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
}

if ($subNode instanceof Break_) {
$subNode->setAttribute(AttributeKey::IS_IN_IF, true);
}

return null;
foreach ($node->stmts as $stmt) {
if ($stmt instanceof Break_) {
$stmt->setAttribute(AttributeKey::IS_IN_IF, true);
}
);
}
}

private function processContextInLoop(For_|Foreach_|While_|Do_ $node): void
Expand Down