@@ -328,12 +328,12 @@ discard block |
||
| 328 | 328 | CURLOPT_SSL_VERIFYHOST => 2, |
| 329 | 329 | // http://www.php.net/manual/en/function.curl-setopt.php#82418 |
| 330 | 330 | CURLOPT_HTTPHEADER => ['Expect:'], |
| 331 | - CURLOPT_WRITEFUNCTION => function ($curl, $data) use (&$body) { |
|
| 331 | + CURLOPT_WRITEFUNCTION => function($curl, $data) use (&$body) { |
|
| 332 | 332 | $body .= $data; |
| 333 | 333 | |
| 334 | 334 | return mb_strlen($data, '8bit'); |
| 335 | 335 | }, |
| 336 | - CURLOPT_HEADERFUNCTION => function ($curl, $data) use (&$headers) { |
|
| 336 | + CURLOPT_HEADERFUNCTION => function($curl, $data) use (&$headers) { |
|
| 337 | 337 | foreach (explode("\r\n", $data) as $row) { |
| 338 | 338 | if (($pos = strpos($row, ':')) !== false) { |
| 339 | 339 | $headers[strtolower(substr($row, 0, $pos))] = trim(substr($row, $pos + 1)); |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | protected function checkResponse($response, $url, $options) |
| 475 | 475 | { |
| 476 | - if(!$this->errorChecker instanceof \Closure) |
|
| 476 | + if (!$this->errorChecker instanceof \Closure) |
|
| 477 | 477 | throw new InvalidCallException('The errorChecker should be set first'); |
| 478 | 478 | $error = call_user_func($this->errorChecker, $response); |
| 479 | 479 | if ($error) { |
@@ -473,8 +473,9 @@ |
||
| 473 | 473 | */ |
| 474 | 474 | protected function checkResponse($response, $url, $options) |
| 475 | 475 | { |
| 476 | - if(!$this->errorChecker instanceof \Closure) |
|
| 477 | - throw new InvalidConfigException('The errorChecker should be set first'); |
|
| 476 | + if(!$this->errorChecker instanceof \Closure) { |
|
| 477 | + throw new InvalidConfigException('The errorChecker should be set first'); |
|
| 478 | + } |
|
| 478 | 479 | $error = call_user_func($this->errorChecker, $response); |
| 479 | 480 | if ($error) { |
| 480 | 481 | throw new ErrorResponseException($error, [ |