Remove unreachable statements
class SomeClass
{
public function run()
{
return 5;
-
- $removeMe = 10;
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector;
return RectorConfig::configure()
->withRules([
RemoveUnreachableStatementRector::class,
]);