- Removed curl_close() as it is deprecated

This commit is contained in:
Dave Mc Nicoll 2026-06-01 15:12:34 +00:00
parent 0694b50eb6
commit 2df4ea15e2

View File

@ -31,8 +31,6 @@ class Curl implements TransportInterface {
if ($this->throwErrors) { if ($this->throwErrors) {
if ( false === $exec) { if ( false === $exec) {
$errno = curl_errno($ch); $errno = curl_errno($ch);
curl_close($ch);
throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno); throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno);
} }
elseif ($code >= 400) { elseif ($code >= 400) {
@ -40,8 +38,6 @@ class Curl implements TransportInterface {
} }
} }
curl_close($ch);
return $exec; return $exec;
} }
@ -59,12 +55,8 @@ class Curl implements TransportInterface {
if ( ( false === $execute ) && $this->throwErrors ) { if ( ( false === $execute ) && $this->throwErrors ) {
$errno = curl_errno($ch); $errno = curl_errno($ch);
curl_close($ch);
throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno); throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno);
} }
else {
curl_close($ch);
}
return $execute ? (object) $execute : null; return $execute ? (object) $execute : null;
} }