GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 4703c4...b7eadc )
by sunsky
02:50
created
src/RequestTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,24 +13,24 @@
 block discarded – undo
13 13
 
14 14
 trait RequestTrait {
15 15
     protected $expectContentType = null;
16
-    public function expectsJson(){
16
+    public function expectsJson() {
17 17
         $this->expectContentType = Mime::JSON;
18 18
     }
19
-    public function expectsXml(){
19
+    public function expectsXml() {
20 20
         $this->expectContentType = Mime::XML;
21 21
     }
22 22
 
23
-    protected function json(){
23
+    protected function json() {
24 24
 
25 25
     }
26
-    protected function unJson(){
26
+    protected function unJson() {
27 27
 
28 28
     }
29 29
 
30
-    protected function xml(){
30
+    protected function xml() {
31 31
 
32 32
     }
33
-    protected function unXml(){
33
+    protected function unXml() {
34 34
 
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
src/JsonTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,15 +51,15 @@
 block discarded – undo
51 51
     public function unJson($body)
52 52
     {
53 53
         $parsed = json_decode($body, true);
54
-        if(json_last_error() !== JSON_ERROR_NONE)throw new UnexpectedResponseException('parsing json occurs error: '.  self::jsonLastErrorMsg() . ', raw body: ' .$body  );
54
+        if (json_last_error() !== JSON_ERROR_NONE)throw new UnexpectedResponseException('parsing json occurs error: '.self::jsonLastErrorMsg().', raw body: '.$body);
55 55
         return $parsed;
56 56
     }
57 57
 
58 58
     /**
59 59
      * @return string
60 60
      */
61
-    private static function jsonLastErrorMsg(){
62
-        if(function_exists('json_last_error_msg')) return json_last_error_msg();
61
+    private static function jsonLastErrorMsg() {
62
+        if (function_exists('json_last_error_msg')) return json_last_error_msg();
63 63
         switch (json_last_error()) {
64 64
             case JSON_ERROR_NONE:
65 65
                 return ' - No errors';
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,9 @@  discard block
 block discarded – undo
51 51
     public function unJson($body)
52 52
     {
53 53
         $parsed = json_decode($body, true);
54
-        if(json_last_error() !== JSON_ERROR_NONE)throw new UnexpectedResponseException('parsing json occurs error: '.  self::jsonLastErrorMsg() . ', raw body: ' .$body  );
54
+        if(json_last_error() !== JSON_ERROR_NONE) {
55
+        	throw new UnexpectedResponseException('parsing json occurs error: '.  self::jsonLastErrorMsg() . ', raw body: ' .$body  );
56
+        }
55 57
         return $parsed;
56 58
     }
57 59
 
@@ -59,7 +61,9 @@  discard block
 block discarded – undo
59 61
      * @return string
60 62
      */
61 63
     private static function jsonLastErrorMsg(){
62
-        if(function_exists('json_last_error_msg')) return json_last_error_msg();
64
+        if(function_exists('json_last_error_msg')) {
65
+        	return json_last_error_msg();
66
+        }
63 67
         switch (json_last_error()) {
64 68
             case JSON_ERROR_NONE:
65 69
                 return ' - No errors';
Please login to merge, or discard this patch.
src/Response.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,9 +96,9 @@
 block discarded – undo
96 96
     public function unserializeBody()
97 97
     {
98 98
         if (isset($this->request->expectedMime)) {
99
-            if (Mime::getFullMime($this->request->expectedMime) !== $this->contentType) throw new UnexpectedResponseException('expected mime can not be matched, real mime:'. $this->contentType. ', expected mime:'. Mime::getFullMime($this->request->expectedMime));
99
+            if (Mime::getFullMime($this->request->expectedMime) !== $this->contentType) throw new UnexpectedResponseException('expected mime can not be matched, real mime:'.$this->contentType.', expected mime:'.Mime::getFullMime($this->request->expectedMime));
100 100
             $method = 'un'.ucfirst($this->request->expectedMime);
101
-            if (!method_exists($this->request, $method)) throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
101
+            if (!method_exists($this->request, $method)) throw new InvalidOperationException($method.' is not exists in '.__CLASS__);
102 102
             $this->body = $this->request->{$method}($this->body);
103 103
         }
104 104
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,10 +72,11 @@  discard block
 block discarded – undo
72 72
         $headers = explode(PHP_EOL, $headers);
73 73
         array_shift($headers); // HTTP HEADER
74 74
         foreach ($headers as $h) {
75
-            if (false !== strpos($h, ':'))
76
-                list($k, $v) = explode(':', $h, 2);
77
-            else
78
-                list($k, $v) = array($h, '');
75
+            if (false !== strpos($h, ':')) {
76
+                            list($k, $v) = explode(':', $h, 2);
77
+            } else {
78
+                            list($k, $v) = array($h, '');
79
+            }
79 80
 
80 81
             $this->header[trim($k)] = trim($v);
81 82
         }
@@ -96,9 +97,13 @@  discard block
 block discarded – undo
96 97
     public function unserializeBody()
97 98
     {
98 99
         if (isset($this->request->expectedMime)) {
99
-            if (Mime::getFullMime($this->request->expectedMime) !== $this->contentType) throw new UnexpectedResponseException('expected mime can not be matched, real mime:'. $this->contentType. ', expected mime:'. Mime::getFullMime($this->request->expectedMime));
100
+            if (Mime::getFullMime($this->request->expectedMime) !== $this->contentType) {
101
+            	throw new UnexpectedResponseException('expected mime can not be matched, real mime:'. $this->contentType. ', expected mime:'. Mime::getFullMime($this->request->expectedMime));
102
+            }
100 103
             $method = 'un'.ucfirst($this->request->expectedMime);
101
-            if (!method_exists($this->request, $method)) throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
104
+            if (!method_exists($this->request, $method)) {
105
+            	throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
106
+            }
102 107
             $this->body = $this->request->{$method}($this->body);
103 108
         }
104 109
     }
Please login to merge, or discard this patch.
src/MultiRequest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param array $options
47 47
      * @return $this
48 48
      */
49
-    public function setDefaults(array $options = array()){
49
+    public function setDefaults(array $options = array()) {
50 50
         $this->defaultOptions = $options;
51 51
         return $this;
52 52
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 'method' => $method,
69 69
                 'url' => $uri,
70 70
                 'data' => $payload,
71
-            ) + $options;
71
+            )+$options;
72 72
         $this->addOptions(array($options));
73 73
         return $this;
74 74
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function addOptions(array $URLOptions)
82 82
     {
83 83
         foreach ($URLOptions as $options) {
84
-            $options = $options + $this->defaultOptions;
84
+            $options = $options+$this->defaultOptions;
85 85
             $request = Request::create()->addOptions($options)->applyOptions();
86 86
             if (isset($options['callback'])) {
87 87
                 $request->onEnd($options['callback']);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function sendAll()
112 112
     {
113
-        $sleepTime = 1000;//microsecond, prevent  CPU 100%
113
+        $sleepTime = 1000; //microsecond, prevent  CPU 100%
114 114
         do {
115 115
             curl_multi_exec(self::$multiHandler, $active);
116 116
             // bug in PHP 5.3.18+ where curl_multi_select can return -1
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 usleep($sleepTime);
120 120
             }
121 121
             usleep($sleepTime);
122
-        } while ($active);
122
+        }while ($active);
123 123
         $return = array();
124 124
         foreach (self::$requestPool as $request) {
125 125
             $return[] = $request->send(true);
Please login to merge, or discard this patch.
src/Helper.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@
 block discarded – undo
14 14
 
15 15
 class Helper
16 16
 {
17
-    public static function retry($maxTimes = 2, callable $task, $sleep = 0){
17
+    public static function retry($maxTimes = 2, callable $task, $sleep = 0) {
18 18
         $tryTimes = 0;
19
-        while(++$tryTimes <= $maxTimes){
20
-            if($task()) break;
21
-            else usleep(abs($sleep) * 1000000);
19
+        while (++$tryTimes <= $maxTimes) {
20
+            if ($task()) break;
21
+            else usleep(abs($sleep)*1000000);
22 22
         }
23 23
         return $tryTimes;
24 24
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,11 @@
 block discarded – undo
17 17
     public static function retry($maxTimes = 2, callable $task, $sleep = 0){
18 18
         $tryTimes = 0;
19 19
         while(++$tryTimes <= $maxTimes){
20
-            if($task()) break;
21
-            else usleep(abs($sleep) * 1000000);
20
+            if($task()) {
21
+            	break;
22
+            } else {
23
+            	usleep(abs($sleep) * 1000000);
24
+            }
22 25
         }
23 26
         return $tryTimes;
24 27
     }
Please login to merge, or discard this patch.
src/Http.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      * @param $method
52 52
      * @return bool
53 53
      */
54
-    public static function hasBody($method){
54
+    public static function hasBody($method) {
55 55
         return in_array($method, array(self::POST, self::PUT, self::PATCH, self::OPTIONS));
56 56
     }
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
src/Request.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     protected static $curlAlias = array(
29 29
         'url' => 'CURLOPT_URL',
30 30
         'uri' => 'CURLOPT_URL',
31
-        'debug' => 'CURLOPT_VERBOSE',//for debug verbose
31
+        'debug' => 'CURLOPT_VERBOSE', //for debug verbose
32 32
         'method' => 'CURLOPT_CUSTOMREQUEST',
33 33
         'data' => 'CURLOPT_POSTFIELDS', // array or string , file begin with '@'
34 34
         'ua' => 'CURLOPT_USERAGENT',
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
         'timeout_ms' => 'CURLOPT_TIMEOUT_MS', // milliseconds,  libcurl version > 7.36.0 ,
47 47
         'expects_mime' => null, //expected mime
48 48
         'send_mime' => null, //send mime
49
-        'ip' => null,//specify ip to send request
50
-        'callback' => null,//callback on end
49
+        'ip' => null, //specify ip to send request
50
+        'callback' => null, //callback on end
51 51
 
52 52
     );
53 53
     protected static $loggerHandler;
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
          */
78 78
         $options = array(
79 79
             'CURLOPT_MAXREDIRS' => 10,
80
-            'CURLOPT_SSL_VERIFYPEER' => false,//for https
81
-            'CURLOPT_SSL_VERIFYHOST' => 0,//for https
82
-            'CURLOPT_IPRESOLVE' => CURL_IPRESOLVE_V4,//ipv4 first
80
+            'CURLOPT_SSL_VERIFYPEER' => false, //for https
81
+            'CURLOPT_SSL_VERIFYHOST' => 0, //for https
82
+            'CURLOPT_IPRESOLVE' => CURL_IPRESOLVE_V4, //ipv4 first
83 83
 //            'CURLOPT_SAFE_UPLOAD' => false,// compatible with PHP 5.6.0
84 84
             'header' => true,
85 85
             'method' => self::GET,
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
             'follow_location' => true,
89 89
             'timeout' => 0,
90 90
             //        'ip' => null, //host, in string, .e.g: 172.16.1.1:888
91
-            'retry_times' => 1,//redo task when failed
92
-            'retry_duration' => 0,//in seconds
91
+            'retry_times' => 1, //redo task when failed
92
+            'retry_duration' => 0, //in seconds
93 93
         );
94 94
 
95 95
 
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
      */
154 154
     private static function combineUrl($parsedComponents)
155 155
     {
156
-        $scheme = isset($parsedComponents['scheme']) ? $parsedComponents['scheme'] . '://' : '';
156
+        $scheme = isset($parsedComponents['scheme']) ? $parsedComponents['scheme'].'://' : '';
157 157
         $host = isset($parsedComponents['host']) ? $parsedComponents['host'] : '';
158
-        $port = isset($parsedComponents['port']) ? ':' . $parsedComponents['port'] : '';
158
+        $port = isset($parsedComponents['port']) ? ':'.$parsedComponents['port'] : '';
159 159
         $user = isset($parsedComponents['user']) ? $parsedComponents['user'] : '';
160
-        $pass = isset($parsedComponents['pass']) ? ':' . $parsedComponents['pass'] : '';
160
+        $pass = isset($parsedComponents['pass']) ? ':'.$parsedComponents['pass'] : '';
161 161
         $pass = ($user || $pass) ? "$pass@" : '';
162 162
         $path = isset($parsedComponents['path']) ? $parsedComponents['path'] : '';
163
-        $query = isset($parsedComponents['query']) ? '?' . $parsedComponents['query'] : '';
164
-        $fragment = isset($parsedComponents['fragment']) ? '#' . $parsedComponents['fragment'] : '';
163
+        $query = isset($parsedComponents['query']) ? '?'.$parsedComponents['query'] : '';
164
+        $fragment = isset($parsedComponents['fragment']) ? '#'.$parsedComponents['fragment'] : '';
165 165
         return "$scheme$user$pass$host$port$path$query$fragment";
166 166
     }
167 167
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function addHeader($headerName, $value)
195 195
     {
196
-        $this->options['headers'][] = $headerName . ': ' . $value;
196
+        $this->options['headers'][] = $headerName.': '.$value;
197 197
         return $this;
198 198
     }
199 199
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     public function getIni($field = null)
259 259
     {
260
-        if(!$field) return $this->options;
260
+        if (!$field) return $this->options;
261 261
         $full = self::fullOption($field);
262 262
         return isset($this->options[$full]) ? $this->options[$full] : false;
263 263
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      */
329 329
     protected function ini($method, $url, $data, array $options = array())
330 330
     {
331
-        $options = array('url' => $url, 'method' => $method, 'data' => $data) + $options;
331
+        $options = array('url' => $url, 'method' => $method, 'data' => $data)+$options;
332 332
         $this->addOptions($options);
333 333
 
334 334
         return $this;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function addOptions(array $options = array())
342 342
     {
343
-        $this->options = $options + $this->options;
343
+        $this->options = $options+$this->options;
344 344
         $this->uri = $this->options['url'];
345 345
         return $this;
346 346
     }
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
             $response = $this->makeResponse($isMultiCurl);
443 443
             $response->parse();
444 444
         } catch (\Exception $e) {
445
-            if(!isset($response)) $response = Response::create($this, null, null, null, null);
445
+            if (!isset($response)) $response = Response::create($this, null, null, null, null);
446 446
             $response->error = $e->getMessage();
447 447
             $response->errorCode = 999;
448 448
         }
@@ -487,11 +487,11 @@  discard block
 block discarded – undo
487 487
             $this->retryDuration = abs($this->options['retry_duration']);
488 488
         }
489 489
 
490
-        if(isset($this->options['expects_mime'])){
490
+        if (isset($this->options['expects_mime'])) {
491 491
             $this->expectsMime($this->options['expects_mime']);
492 492
         }
493 493
 
494
-        if(isset($this->options['send_mime'])){
494
+        if (isset($this->options['send_mime'])) {
495 495
             $this->sendMime($this->options['send_mime']);
496 496
         }
497 497
 
@@ -506,11 +506,11 @@  discard block
 block discarded – undo
506 506
         $this->serializeBody();
507 507
 
508 508
         //try fix url
509
-        if (strpos($this->options['url'], '://') === FALSE) $this->options['url'] = 'http://' . $this->options['url'];
509
+        if (strpos($this->options['url'], '://') === FALSE) $this->options['url'] = 'http://'.$this->options['url'];
510 510
         $components = parse_url($this->options['url']);
511
-        if(FALSE === $components) throw new InvalidArgumentException('formatting url occurs error: '. $this->options['url']);
512
-        if($this->withURIQuery){
513
-            if(isset($components['query'])) $components['query'] .= '&'. trim($this->withURIQuery);
511
+        if (FALSE === $components) throw new InvalidArgumentException('formatting url occurs error: '.$this->options['url']);
512
+        if ($this->withURIQuery) {
513
+            if (isset($components['query'])) $components['query'] .= '&'.trim($this->withURIQuery);
514 514
             else $components['query'] = trim($this->withURIQuery);
515 515
         }
516 516
         $this->options['url'] = self::combineUrl($components);
@@ -524,11 +524,11 @@  discard block
 block discarded – undo
524 524
             preg_match('/\/\/([^\/]+)/', $this->options['url'], $matches);
525 525
             $host = $matches[1];
526 526
             if (empty($this->options['headers']) || !is_array($this->options['headers'])) {
527
-                $this->options['headers'] = array('Host: ' . $host);
527
+                $this->options['headers'] = array('Host: '.$host);
528 528
             } else {
529
-                $this->options['headers'][] = 'Host: ' . $host;
529
+                $this->options['headers'][] = 'Host: '.$host;
530 530
             }
531
-            $this->options['url'] = preg_replace('/\/\/([^\/]+)/', '//' . $this->options['ip'], $this->options['url']);
531
+            $this->options['url'] = preg_replace('/\/\/([^\/]+)/', '//'.$this->options['ip'], $this->options['url']);
532 532
             unset($host);
533 533
         }
534 534
         //process version
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
         //convert secs to milliseconds
547 547
         if (defined('CURLOPT_TIMEOUT_MS')) {
548 548
             if (!isset($this->options['timeout_ms'])) {
549
-                $this->options['timeout_ms'] = intval($this->options['timeout'] * 1000);
549
+                $this->options['timeout_ms'] = intval($this->options['timeout']*1000);
550 550
             } else {
551 551
                 $this->options['timeout_ms'] = intval($this->options['timeout_ms']);
552 552
             }
553 553
         }
554 554
 
555 555
         $cURLOptions = self::filterAndRaw($this->options);
556
-        if(isset($this->body))$cURLOptions[CURLOPT_POSTFIELDS] = $this->body;//use serialized body not raw data
556
+        if (isset($this->body))$cURLOptions[CURLOPT_POSTFIELDS] = $this->body; //use serialized body not raw data
557 557
         curl_setopt_array($this->curlHandle, $cURLOptions);
558 558
 
559 559
         return $this;
@@ -564,10 +564,10 @@  discard block
 block discarded – undo
564 564
         if (isset($this->options['data'])) {
565 565
             if (isset($this->sendMime)) {
566 566
                 $method = $this->sendMime;
567
-                if (!method_exists($this, $method)) throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
567
+                if (!method_exists($this, $method)) throw new InvalidOperationException($method.' is not exists in '.__CLASS__);
568 568
                 $this->body = $this->$method($this->options['data']);
569 569
             } else {
570
-                $this->body =  $this->options['data'];
570
+                $this->body = $this->options['data'];
571 571
             }
572 572
 
573 573
         }
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
     public function onEnd(callable $callback)
581 581
     {
582 582
         if (!is_callable($callback)) {
583
-            throw new InvalidArgumentException('callback not is callable :' . print_r($callback, 1));
583
+            throw new InvalidArgumentException('callback not is callable :'.print_r($callback, 1));
584 584
         }
585 585
 
586 586
         $this->endCallback = $callback;
Please login to merge, or discard this patch.
Braces   +30 added lines, -11 removed lines patch added patch discarded remove patch
@@ -230,7 +230,9 @@  discard block
 block discarded – undo
230 230
     }
231 231
     public function expects($mime)
232 232
     {
233
-        if (empty($mime)) return $this;
233
+        if (empty($mime)) {
234
+        	return $this;
235
+        }
234 236
         $this->expected_type = Mime::getFullMime($mime);
235 237
         return $this;
236 238
     }
@@ -257,7 +259,9 @@  discard block
 block discarded – undo
257 259
      */
258 260
     public function getIni($field = null)
259 261
     {
260
-        if(!$field) return $this->options;
262
+        if(!$field) {
263
+        	return $this->options;
264
+        }
261 265
         $full = self::fullOption($field);
262 266
         return isset($this->options[$full]) ? $this->options[$full] : false;
263 267
     }
@@ -437,12 +441,15 @@  discard block
 block discarded – undo
437 441
     public function send($isMultiCurl = false)
438 442
     {
439 443
         try {
440
-            if (!$this->hasInitialized)
441
-                $this->applyOptions();
444
+            if (!$this->hasInitialized) {
445
+                            $this->applyOptions();
446
+            }
442 447
             $response = $this->makeResponse($isMultiCurl);
443 448
             $response->parse();
444 449
         } catch (\Exception $e) {
445
-            if(!isset($response)) $response = Response::create($this, null, null, null, null);
450
+            if(!isset($response)) {
451
+            	$response = Response::create($this, null, null, null, null);
452
+            }
446 453
             $response->error = $e->getMessage();
447 454
             $response->errorCode = 999;
448 455
         }
@@ -506,12 +513,19 @@  discard block
 block discarded – undo
506 513
         $this->serializeBody();
507 514
 
508 515
         //try fix url
509
-        if (strpos($this->options['url'], '://') === FALSE) $this->options['url'] = 'http://' . $this->options['url'];
516
+        if (strpos($this->options['url'], '://') === FALSE) {
517
+        	$this->options['url'] = 'http://' . $this->options['url'];
518
+        }
510 519
         $components = parse_url($this->options['url']);
511
-        if(FALSE === $components) throw new InvalidArgumentException('formatting url occurs error: '. $this->options['url']);
520
+        if(FALSE === $components) {
521
+        	throw new InvalidArgumentException('formatting url occurs error: '. $this->options['url']);
522
+        }
512 523
         if($this->withURIQuery){
513
-            if(isset($components['query'])) $components['query'] .= '&'. trim($this->withURIQuery);
514
-            else $components['query'] = trim($this->withURIQuery);
524
+            if(isset($components['query'])) {
525
+            	$components['query'] .= '&'. trim($this->withURIQuery);
526
+            } else {
527
+            	$components['query'] = trim($this->withURIQuery);
528
+            }
515 529
         }
516 530
         $this->options['url'] = self::combineUrl($components);
517 531
 
@@ -553,7 +567,10 @@  discard block
 block discarded – undo
553 567
         }
554 568
 
555 569
         $cURLOptions = self::filterAndRaw($this->options);
556
-        if(isset($this->body))$cURLOptions[CURLOPT_POSTFIELDS] = $this->body;//use serialized body not raw data
570
+        if(isset($this->body)) {
571
+        	$cURLOptions[CURLOPT_POSTFIELDS] = $this->body;
572
+        }
573
+        //use serialized body not raw data
557 574
         curl_setopt_array($this->curlHandle, $cURLOptions);
558 575
 
559 576
         return $this;
@@ -564,7 +581,9 @@  discard block
 block discarded – undo
564 581
         if (isset($this->options['data'])) {
565 582
             if (isset($this->sendMime)) {
566 583
                 $method = $this->sendMime;
567
-                if (!method_exists($this, $method)) throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
584
+                if (!method_exists($this, $method)) {
585
+                	throw new InvalidOperationException($method . ' is not exists in ' . __CLASS__);
586
+                }
568 587
                 $this->body = $this->$method($this->options['data']);
569 588
             } else {
570 589
                 $this->body =  $this->options['data'];
Please login to merge, or discard this patch.