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

 <?php
 
 class MyClassA implements \Countable
 
 class MyClassB implements \Countable, \Stringable
 {
+    #[\Override]
     public function count(): int
     {
         return 0;
     }
     
+    #[\Override]
     public function __toString(): string
     {
         return 'hello';
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

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