RemoveUnusedVariableInCatchRector

Remove unused variable in catch()

 final class SomeClass
 {
     public function run()
     {
         try {
-        } catch (Throwable $notUsedThrowable) {
+        } catch (Throwable) {
         }
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;

return RectorConfig::configure()
    ->withRules([
        RemoveUnusedVariableInCatchRector::class,
    ]);
SETS:  PHP 8.0