Removes dead code statements
-$value = 5;
-$value;
+$value = 5;
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector;
return RectorConfig::configure()
->withRules([
RemoveDeadStmtRector::class,
]);