SwitchNegatedTernaryRector

Switch negated ternary condition rector

 class SomeClass
 {
     public function run(bool $upper, string $name)
     {
-        return ! $upper
-            ? $name
-            : strtoupper($name);
+        return $upper
+            ? strtoupper($name)
+            : $name;
     }
 }

Configure your rector.php:

<?php

use Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector;
use Rector\Config\RectorConfig;

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