Remove useless ternary if fallback is falsey of left code
function go(bool $value)
{
- return $value ?: false;
+ return $value;
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Ternary\RemoveUselessTernaryRector;
return RectorConfig::configure()
->withRules([
RemoveUselessTernaryRector::class,
]);