public function getPort() : int
    {
        if ($this->isUsingTrustedProxy()) {
            if ($this->server->has(self::$trustedHeaderNames[RequestHeaders::CLIENT_PORT])) {
                return (int)$this->server->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_PORT]);
            } elseif ($this->server->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_PROTO]) === 'https') {
                return 443;
            }
        }

        return (int)$this->server->get('SERVER_PORT');
    }
public function getPort() : int
    {
        if ($this->isUsingTrustedProxy()) {
            if ($this->server->has(self::$trustedHeaderNames[RequestHeaders::CLIENT_PORT])) {
                return (int)$this->server->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_PORT]);
            } elseif ($this->server->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_PROTO]) === 'https') {
                return 443;
            }
        }

        return (int)$this->server->get('SERVER_PORT');
    }
public function getPort ( ) : int { if ( $ this -> isUsingTrustedProxy ( ) ) { if ( $ this -> server -> has ( self :: $ trustedHeaderNames [ RequestHeaders :: CLIENT_PORT ] ) ) { return ( int ) $ this -> server -> get ( self :: $ trustedHeaderNames [ RequestHeaders :: CLIENT_PORT ] ) ; } elseif ( $ this -> server -> get ( self :: $ trustedHeaderNames [ RequestHeaders :: CLIENT_PROTO ] ) === 'https' ) { return 443 ; } } return ( int ) $ this -> server -> get ( 'SERVER_PORT' ) ; }
Gets the port number

@return int The port number
Gets the port number