DowngradeNonCapturingCatchesRector
Downgrade catch () without variable to one
class SomeClass
{
public function run()
{
try {
// code
- } catch (\Exception) {
+ } catch (\Exception $exception) {
// error
}
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp80\Rector\Catch_\DowngradeNonCapturingCatchesRector;
return RectorConfig::configure()
->withRules([
DowngradeNonCapturingCatchesRector::class,
]);