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

PHP snippet to change
Config  rector.php
Rector version: 9691e9 - released at 2025-01-20 12:29