Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 8, 2021
1 parent 224da2b commit 38dca77
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,14 @@ private function refactorReturn(Return_ $return): ?array
return null;
}

$ifCondNotIsset = new BooleanNot(new Isset_([$coalesce->left]));
$if = $this->ifManipulator->createIfExpr($ifCondNotIsset, new Expression($coalesce->right));
$booleanNot = new BooleanNot(new Isset_([$coalesce->left]));
$if = $this->ifManipulator->createIfExpr($booleanNot, new Expression($coalesce->right));
return [$if, new Return_($coalesce->left)];
}

return null;
}

private function createIf(Coalesce $coalesce, Throw_ $throw): If_
{
$condExpr = $this->createCondExpr($coalesce);

return new If_($condExpr, [
'stmts' => [new Expression($throw)],
]);
}

private function createCondExpr(Coalesce $coalesce): BooleanNot|Identical
{
if ($coalesce->left instanceof Variable || $coalesce->left instanceof ArrayDimFetch) {
Expand Down

0 comments on commit 38dca77

Please sign in to comment.