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

Config  rector.php
Rector version: 08d73a - released at 2024-03-28 17:03