Remove unused private method
final class SomeController
{
public function run()
{
return 5;
}
-
- private function skip()
- {
- return 10;
- }
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
return RectorConfig::configure()
->withRules([
RemoveUnusedPrivateMethodRector::class,
]);