Remove dead condition above return
final class SomeClass
{
public function go()
{
- if (1 === 1) {
- return 'yes';
- }
-
return 'yes';
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Return_\RemoveDeadConditionAboveReturnRector;
return RectorConfig::configure()
->withRules([
RemoveDeadConditionAboveReturnRector::class,
]);