RemoveDeadIfForeachForRector

Remove if, foreach and for that does not do anything

 class SomeClass
 {
     public function run($value)
     {
-        if ($value) {
-        }
-
-        foreach ($values as $value) {
-        }
-
         return $value;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\For_\RemoveDeadIfForeachForRector;

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