Type and name of catch exception should match
try {
// ...
-} catch (SomeException $typoException) {
- $typoException->getMessage();
+} catch (SomeException $someException) {
+ $someException->getMessage();
}
Configure your rector.php
:
<?php
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
CatchExceptionNameMatchingTypeRector::class,
]);