Remove dead catches
class SomeClass
{
public function run()
{
try {
// some code
} catch (RuntimeException $exception) {
throw new InvalidArgumentException($exception->getMessage());
- } catch (Throwable $throwable) {
- throw $throwable;
}
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\TryCatch\RemoveDeadCatchRector;
return RectorConfig::configure()
->withRules([
RemoveDeadCatchRector::class,
]);