ReverseConditionableMethodCallRector

Reverse conditionable method calls

-$conditionable->when(!$condition, function () {});
+$conditionable->unless($condition, function () {});

Configure your rector.php:

<?php

use RectorLaravel\Rector\MethodCall\ReverseConditionableMethodCallRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withRules([
        ReverseConditionableMethodCallRector::class,
    ]);
SETS:  Code quality