Skip to content

Commit 981db08

Browse files
stofrobocoder
authored andcommitted
Fix deprecations triggered by PHP 8.5
The `curl_close` function is a no-op as of PHP 8.0 (when the curl extension migrated from resources to objects) and is deprecated as of PHP 8.5.
1 parent 7bc9987 commit 981db08

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/WebDriver/Service/CurlService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
8989
CURLE_GOT_NOTHING !== ($errno = curl_errno($curl)) &&
9090
$error = curl_error($curl)
9191
) {
92-
curl_close($curl);
92+
if (\PHP_VERSION_ID < 80000) {
93+
curl_close($curl);
94+
}
9395

9496
$e = new CurlExecException(
9597
sprintf(
@@ -106,8 +108,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
106108

107109
throw $e;
108110
}
109-
110-
curl_close($curl);
111+
if (\PHP_VERSION_ID < 80000) {
112+
curl_close($curl);
113+
}
111114

112115
return array($rawResult, $info);
113116
}

0 commit comments

Comments
 (0)