Run Rector on your code to see what it can do for you:
{ $something = null; - if($something === null) { - /* @phpstan-ignore some.rule (please don't eat me) */ - $something = 'something'; - } + $something ??= 'something'; } }
Applied Rules:
Not a change you expect?
rector.php