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

PHP snippet to change
Config  rector.php
Rector version: b5859b - released at 2024-12-05 10:00