@@ -209,7 +209,7 @@ public static function factory(RequestInterface $request)
209
209
$ args [] = $ handle ;
210
210
211
211
// PHP 5.5 pushed the handle onto the start of the args
212
- if (is_resource ( $ args [0 ]) ) {
212
+ if ($ args [0 ] !== false ) {
213
213
array_shift ($ args );
214
214
}
215
215
@@ -233,7 +233,7 @@ public static function factory(RequestInterface $request)
233
233
*/
234
234
public function __construct ($ handle , $ options )
235
235
{
236
- if (! is_resource ( $ handle) ) {
236
+ if ($ handle === false ) {
237
237
throw new InvalidArgumentException ('Invalid handle provided ' );
238
238
}
239
239
if (is_array ($ options )) {
@@ -259,8 +259,9 @@ public function __destruct()
259
259
*/
260
260
public function close ()
261
261
{
262
- if (is_resource ( $ this ->handle ) ) {
262
+ if ($ this ->handle !== false ) {
263
263
curl_close ($ this ->handle );
264
+ unset($ this ->handle );
264
265
}
265
266
$ this ->handle = null ;
266
267
}
@@ -272,7 +273,7 @@ public function close()
272
273
*/
273
274
public function isAvailable ()
274
275
{
275
- return is_resource ( $ this ->handle ) ;
276
+ return $ this ->handle !== false ;
276
277
}
277
278
278
279
/**
@@ -322,7 +323,7 @@ public function setErrorNo($error)
322
323
*/
323
324
public function getInfo ($ option = null )
324
325
{
325
- if (! is_resource ( $ this ->handle ) ) {
326
+ if ($ this ->handle === false ) {
326
327
return null ;
327
328
}
328
329
0 commit comments