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';
Applied Rules:
Not a change you expect?
rector.php