Skip to content

Commit 79f659d

Browse files
committed
Fix probable bugs; Clean up style
1 parent 9eef25a commit 79f659d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/Curl/Curl.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Curl;
44

5+
use Curl\ArrayUtil;
6+
57
class Curl
68
{
79
const VERSION = '7.1.0';
@@ -148,8 +150,8 @@ public function buildPostData($data)
148150
// Manually build a single-dimensional array from a multi-dimensional array as using curl_setopt($ch,
149151
// CURLOPT_POSTFIELDS, $data) doesn't correctly handle multi-dimensional arrays when files are
150152
// referenced.
151-
if (\Curl\ArrayUtil::is_array_multidim($data)) {
152-
$data = \Curl\ArrayUtil::array_flatten_multidim($data);
153+
if (ArrayUtil::is_array_multidim($data)) {
154+
$data = ArrayUtil::array_flatten_multidim($data);
153155
}
154156

155157
// Modify array values to ensure any referenced files are properly handled depending on the support of

src/Curl/MultiCurl.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,38 +453,32 @@ public function setConnectTimeout($seconds)
453453
*
454454
* @access public
455455
* @param $string
456-
*
457-
* @return bool
458456
*/
459457
public function setCookieString($string)
460458
{
461-
return $this->setOpt(CURLOPT_COOKIE, $string);
459+
$this->setOpt(CURLOPT_COOKIE, $string);
462460
}
463461

464462
/**
465463
* Set Cookie File
466464
*
467465
* @access public
468466
* @param $cookie_file
469-
*
470-
* @return boolean
471467
*/
472468
public function setCookieFile($cookie_file)
473469
{
474-
return $this->setOpt(CURLOPT_COOKIEFILE, $cookie_file);
470+
$this->setOpt(CURLOPT_COOKIEFILE, $cookie_file);
475471
}
476472

477473
/**
478474
* Set Cookie Jar
479475
*
480476
* @access public
481477
* @param $cookie_jar
482-
*
483-
* @return boolean
484478
*/
485479
public function setCookieJar($cookie_jar)
486480
{
487-
return $this->setOpt(CURLOPT_COOKIEJAR, $cookie_jar);
481+
$this->setOpt(CURLOPT_COOKIEJAR, $cookie_jar);
488482
}
489483

490484
/**
@@ -798,7 +792,6 @@ private function initHandle($curl)
798792
}
799793

800794
$this->activeCurls[$curl->id] = $curl;
801-
$this->responseCookies = array();
802795
$curl->call($curl->beforeSendFunction);
803796
}
804797
}

0 commit comments

Comments
 (0)