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

 
     public function resolve($key)
     {
-        if (isset($this->items[$key])) {
-            return $this->items[$key];
-        }
-
-        return $this->items[$key] = 'default';
+        return $this->items[$key] ?? $this->items[$key] = 'default';
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: e4cb24 - released at 2026-06-25 18:47