private function getProtocolVersion(string $requestVersion): int
    {
        switch ($requestVersion) {
            case '1.0':
                return CURL_HTTP_VERSION_1_0;
            case '1.1':
                return CURL_HTTP_VERSION_1_1;
            case '2.0':
                if (defined('CURL_HTTP_VERSION_2_0')) {
                    return CURL_HTTP_VERSION_2_0;
                }
                throw new \UnexpectedValueException('libcurl 7.33 needed for HTTP 2.0 support');
        }

        return CURL_HTTP_VERSION_NONE;
    }
private function getProtocolVersion(string $requestVersion): int
    {
        switch ($requestVersion) {
            case '1.0':
                return CURL_HTTP_VERSION_1_0;
            case '1.1':
                return CURL_HTTP_VERSION_1_1;
            case '2.0':
                if (defined('CURL_HTTP_VERSION_2_0')) {
                    return CURL_HTTP_VERSION_2_0;
                }
                throw new \UnexpectedValueException('libcurl 7.33 needed for HTTP 2.0 support');
        }

        return CURL_HTTP_VERSION_NONE;
    }
private function getProtocolVersion ( string $ requestVersion ) : int { switch ( $ requestVersion ) { case '1.0' : return CURL_HTTP_VERSION_1_0 ; case '1.1' : return CURL_HTTP_VERSION_1_1 ; case '2.0' : if ( defined ( 'CURL_HTTP_VERSION_2_0' ) ) { return CURL_HTTP_VERSION_2_0 ; } throw new \ UnexpectedValueException ( 'libcurl 7.33 needed for HTTP 2.0 support' ) ; } return CURL_HTTP_VERSION_NONE ; }
Return cURL constant for specified HTTP version.

@param string $requestVersion HTTP version ("1.0", "1.1" or "2.0").

@return int Respective CURL_HTTP_VERSION_x_x constant.

@throws \UnexpectedValueException If unsupported version requested.
Return cURL constant for specified HTTP version .