src/Domain/Value/Identifier/Uri.php
protected static function normalizePort(?int $port, ?string $scheme): ?int
    {
        if ($port === null) {
            return null;
        }

        if ($scheme && isset(static::$defaultPorts[$scheme]) && ($port == static::$defaultPorts[$scheme])) {
            return null;
        }

        return $port;
    }
protected static function normalizePort(?int $port, ?string $scheme): ?int
    {
        if ($port === null) {
            return null;
        }

        if ($scheme && isset(static::$defaultPorts[$scheme]) && ($port == static::$defaultPorts[$scheme])) {
            return null;
        }

        return $port;
    }
protected static function normalizePort ( ? int $ port , ? string $ scheme ) : ? int { if ( $ port === null ) { return null ; } if ( $ scheme && isset ( static :: $ defaultPorts [ $ scheme ] ) && ( $ port == static :: $ defaultPorts [ $ scheme ] ) ) { return null ; } return $ port ; }
Validates and normalizes the port

@param int|null    $port The port
@param string|null $scheme The scheme

@return int|null
Validates and normalizes the port