Run Rector on your code to see what it can do for you:

 
 try {
     throwException();
-} catch (Throwable $e) {
+} catch (Throwable $throwable) {
 
-    logException($e);
+    logException($throwable);
     $notification = new Notification();
-    $notification->exception($e);
+    $notification->exception($throwable);
 }
 
 try {
     throwException();
-} catch (Throwable $e) {
-    logException($e);
+} catch (Throwable $throwable) {
+    logException($throwable);
 
     $notification = new Notification();
     $notification->exception($e);
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: b855ff - released at 2026-01-22 19:37