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

PHP snippet to change
Config  rector.php
Rector version: e5d221 - released at 2024-12-21 11:55