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

 <?php
 $port = '8080';
 $scheme = 'https';
-$port = isset($port) ? $port : (($scheme == 'https') ? '443' : '80');
+$port = $port ?? ($scheme == 'https') ? '443' : '80';
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 6a3101 - released at 2026-02-10 12:09