RemoveDeadReturnRector

Remove last return in the functions, since does not do anything

 class SomeClass
 {
     public function run()
     {
         $shallWeDoThis = true;

         if ($shallWeDoThis) {
             return;
         }
-
-        return;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector;

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