DowngradeThrowExprRector

Downgrade throw expression

-echo $variable ?? throw new RuntimeException();
+if (! isset($variable)) {
+    throw new RuntimeException();
+}
+
+echo $variable;

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\DowngradePhp80\Rector\Expression\DowngradeThrowExprRector;

return RectorConfig::configure()
    ->withRules([
        DowngradeThrowExprRector::class,
    ]);