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

 
 final class FooImpl implements Foo
 {
-    public ?string $bar {
+    public ?string $bar = null {
         get => 'bar';
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: e65ac6 - released at 2026-02-05 16:20