Closed peterfox closed 6 months ago
I may be missing something, but this doesn't seem to be available via https://github.com/driftingly/rector-laravel/blob/eefaf3ef1186a4f07b50988de402b30b87143ed7/src/Set/LaravelSetList.php. Is there another way to use it? (Thank you!!)
@johnbacon You're right, we're missing a constant for it. We'll probably add one soon. Another way to use it is to include the three rules manually:
$rectorConfig->rule(AbortIfRector::class);
$rectorConfig->rule(ReportIfRector::class);
$rectorConfig->rule(ThrowIfRector::class);
Changes
abort_if
andreport_if
function calls as replacement for If statements containingabort
orreport
.throw_if
related rule. The set making it easier to just use all of them.config
dir to rectorWhy
Makes sense to cover all the possible helpers and have a set that covers the three scenarios. The only one missing would be the Dispatchable trait static calls (dispatchIf) but it would require a new rule and feels a bit more niche compared to the helpers.