Skip to content

Commit 8a82260

Browse files
committed
fix Throw_ as Expr on DowngradeThrowExprRector
1 parent 47d8b97 commit 8a82260

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,9 @@ private function refactorDirectCoalesce(Expression $expression): ?array
262262

263263
// add condition if above
264264
$throwExpr = $coalesce->right;
265-
$throw = new Stmt\Throw_($throwExpr->expr);
266265

267266
$if = new If_(new Identical($coalesce->left, new ConstFetch(new Name('null'))), [
268-
'stmts' => [$throw],
267+
'stmts' => [new Expression($throwExpr)],
269268
]);
270269

271270
// replace coalsese with left :)

0 commit comments

Comments
 (0)