Skip to content

Commit 4fe3a1b

Browse files
committed
add php8 support
1 parent 164c5f0 commit 4fe3a1b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/aws-sdk/Guzzle/Http/Curl/CurlHandle.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public static function factory(RequestInterface $request)
209209
$args[] = $handle;
210210

211211
// PHP 5.5 pushed the handle onto the start of the args
212-
if (is_resource($args[0])) {
212+
if ($args[0] !== false) {
213213
array_shift($args);
214214
}
215215

@@ -233,7 +233,7 @@ public static function factory(RequestInterface $request)
233233
*/
234234
public function __construct($handle, $options)
235235
{
236-
if (!is_resource($handle)) {
236+
if ($handle === false) {
237237
throw new InvalidArgumentException('Invalid handle provided');
238238
}
239239
if (is_array($options)) {
@@ -259,8 +259,9 @@ public function __destruct()
259259
*/
260260
public function close()
261261
{
262-
if (is_resource($this->handle)) {
262+
if ($this->handle !== false) {
263263
curl_close($this->handle);
264+
unset($this->handle);
264265
}
265266
$this->handle = null;
266267
}
@@ -272,7 +273,7 @@ public function close()
272273
*/
273274
public function isAvailable()
274275
{
275-
return is_resource($this->handle);
276+
return $this->handle !== false;
276277
}
277278

278279
/**
@@ -322,7 +323,7 @@ public function setErrorNo($error)
322323
*/
323324
public function getInfo($option = null)
324325
{
325-
if (!is_resource($this->handle)) {
326+
if ($this->handle === false) {
326327
return null;
327328
}
328329

lib/aws-sdk/Guzzle/Http/Curl/CurlMulti.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ public function __construct($selectTimeout = 1.0)
5858

5959
public function __destruct()
6060
{
61-
if (is_resource($this->multiHandle)) {
62-
curl_multi_close($this->multiHandle);
61+
if ($this->multiHandle !== false) {
62+
curl_close($this->multiHandlee);
63+
unset($this->multiHandle);
6364
}
6465
}
6566

0 commit comments

Comments
 (0)