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

 {
     public function testSuccess(): void
     {
-        $mock = $this->createMock(\stdClass::class);
+        $mock = self::createMock(\stdClass::class);
         
-        $this->assertTrue(true);
+        self::assertTrue(true);
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: ea5089 - released at 2026-01-27 00:48