Skip to content

Commit 0e16ea9

Browse files
committed
fixes
1 parent 4fe3a1b commit 0e16ea9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public static function factory(RequestInterface $request)
233233
*/
234234
public function __construct($handle, $options)
235235
{
236+
$this->handle = false;
237+
236238
if ($handle === false) {
237239
throw new InvalidArgumentException('Invalid handle provided');
238240
}
@@ -259,11 +261,11 @@ public function __destruct()
259261
*/
260262
public function close()
261263
{
262-
if ($this->handle !== false) {
264+
if (!!($this->handle)) {
263265
curl_close($this->handle);
264266
unset($this->handle);
265267
}
266-
$this->handle = null;
268+
$this->handle = false;
267269
}
268270

269271
/**
@@ -273,7 +275,7 @@ public function close()
273275
*/
274276
public function isAvailable()
275277
{
276-
return $this->handle !== false;
278+
return !!($this->handle);
277279
}
278280

279281
/**
@@ -323,7 +325,7 @@ public function setErrorNo($error)
323325
*/
324326
public function getInfo($option = null)
325327
{
326-
if ($this->handle === false) {
328+
if (!($this->handle)) {
327329
return null;
328330
}
329331

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($selectTimeout = 1.0)
4949
$this->selectTimeout = $selectTimeout;
5050
$this->multiHandle = curl_multi_init();
5151
// @codeCoverageIgnoreStart
52-
if ($this->multiHandle === false) {
52+
if (!($this->multiHandle)) {
5353
throw new CurlException('Unable to create multi handle');
5454
}
5555
// @codeCoverageIgnoreEnd
@@ -58,7 +58,7 @@ public function __construct($selectTimeout = 1.0)
5858

5959
public function __destruct()
6060
{
61-
if ($this->multiHandle !== false) {
61+
if (!!($this->multiHandle)) {
6262
curl_close($this->multiHandlee);
6363
unset($this->multiHandle);
6464
}

0 commit comments

Comments
 (0)