Fix phpstan reports
parent
a7c6125ee4
commit
b64e38eb86
|
@ -217,13 +217,13 @@ class CurlDownloader
|
||||||
|
|
||||||
$version = curl_version();
|
$version = curl_version();
|
||||||
$features = $version['features'];
|
$features = $version['features'];
|
||||||
if (0 === strpos($url, 'https://') && \defined('CURL_VERSION_HTTP2') && \defined('CURL_HTTP_VERSION_2_0') && (CURL_VERSION_HTTP2 & $features)) {
|
if (0 === strpos($url, 'https://') && \defined('CURL_VERSION_HTTP2') && \defined('CURL_HTTP_VERSION_2_0') && (CURL_VERSION_HTTP2 & $features) !== 0) {
|
||||||
curl_setopt($curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
curl_setopt($curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// curl 8.7.0 - 8.7.1 has a bug whereas automatic accept-encoding header results in an error when reading the response
|
// curl 8.7.0 - 8.7.1 has a bug whereas automatic accept-encoding header results in an error when reading the response
|
||||||
// https://github.com/composer/composer/issues/11913
|
// https://github.com/composer/composer/issues/11913
|
||||||
if (in_array($version['version'], ['8.7.0', '8.7.1'], true) && \defined('CURL_VERSION_LIBZ') && (CURL_VERSION_LIBZ & $features)) {
|
if (isset($version['version']) && in_array($version['version'], ['8.7.0', '8.7.1'], true) && \defined('CURL_VERSION_LIBZ') && (CURL_VERSION_LIBZ & $features) !== 0) {
|
||||||
curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
|
curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue