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

 <?php
 
 interface BaseInterface
 
 class MyClassB implements BaseInterface, \Stringable
 {
+    #[\Override]
     public function __toString(): string
     {
         return 'hello';
     }
     
+    #[\Override]
     public function test(): void
     {
         $example = true;
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 3a3942 - released at 2026-03-17 17:46