Passed
Push — master ( be88e3...87c6b6 )
by Fran
04:17
created
src/base/types/helpers/ServiceHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     }
16 16
 
17 17
     public static function parseRawData($type, array $params = []) {
18
-        switch($type) {
18
+        switch ($type) {
19 19
             default:
20 20
             case self::TYPE_HTTP:
21 21
                 $parsedParams = http_build_query($params);
Please login to merge, or discard this patch.
src/base/Service.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     protected $isMultipart = false;
71 71
 
72 72
     private function closeConnection() {
73
-        if(null !== $this->con) {
73
+        if (null !== $this->con) {
74 74
             curl_close($this->con);
75 75
         }
76 76
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function setIsJson($isJson = true) {
235 235
         $this->isJson = $isJson;
236
-        if($isJson) {
236
+        if ($isJson) {
237 237
             $this->setIsMultipart(false);
238 238
         }
239 239
     }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public function setIsMultipart($isMultipart = true) {
253 253
         $this->isMultipart = $isMultipart;
254
-        if($isMultipart) {
254
+        if ($isMultipart) {
255 255
             $this->setIsJson(false);
256 256
         }
257 257
     }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         $this->url = NULL;
272 272
         $this->params = array();
273 273
         $this->headers = array();
274
-        Logger::log('Context service for ' . static::class . ' cleared!');
274
+        Logger::log('Context service for '.static::class.' cleared!');
275 275
         $this->closeConnection();
276 276
     }
277 277
 
@@ -314,18 +314,18 @@  discard block
 block discarded – undo
314 314
     }
315 315
 
316 316
     protected function applyOptions() {
317
-        if(count($this->options)) {
317
+        if (count($this->options)) {
318 318
             curl_setopt_array($this->con, $this->options);
319 319
         }
320 320
     }
321 321
 
322 322
     protected function applyHeaders() {
323 323
         $headers = [];
324
-        foreach($this->headers as $key => $value) {
325
-            $headers[] = $key . ': ' . $value;
324
+        foreach ($this->headers as $key => $value) {
325
+            $headers[] = $key.': '.$value;
326 326
         }
327 327
         $headers[self::PSFS_TRACK_HEADER] = Logger::getUid();
328
-        if(count($headers)) {
328
+        if (count($headers)) {
329 329
             curl_setopt($this->con, CURLOPT_HTTPHEADER, $headers);
330 330
         }
331 331
     }
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
      * @return int
335 335
      */
336 336
     private function parseServiceType() {
337
-        if($this->getIsJson()) {
337
+        if ($this->getIsJson()) {
338 338
             return ServiceHelper::TYPE_JSON;
339 339
         }
340
-        if($this->getIsMultipart()) {
340
+        if ($this->getIsMultipart()) {
341 341
             return ServiceHelper::TYPE_MULTIPART;
342 342
         }
343 343
         return ServiceHelper::TYPE_HTTP;
@@ -350,9 +350,9 @@  discard block
 block discarded – undo
350 350
             case Request::VERB_GET:
351 351
             default:
352 352
                 $this->addOption(CURLOPT_CUSTOMREQUEST, Request::VERB_GET);
353
-                if(!empty($this->params)) {
353
+                if (!empty($this->params)) {
354 354
                     $sep = false !== strpos($this->getUrl(), '?') ? '?' : '';
355
-                    $this->url = $this->url . $sep . http_build_query($this->params);
355
+                    $this->url = $this->url.$sep.http_build_query($this->params);
356 356
                 }
357 357
                 break;
358 358
             case Request::VERB_POST:
@@ -384,14 +384,14 @@  discard block
 block discarded – undo
384 384
         $this->applyOptions();
385 385
         $this->applyHeaders();
386 386
         $verbose = null;
387
-        if('debug' === Config::getParam('log.level')) {
387
+        if ('debug' === Config::getParam('log.level')) {
388 388
             curl_setopt($this->con, CURLOPT_VERBOSE, true);
389 389
             $verbose = fopen('php://temp', 'wb+');
390 390
             curl_setopt($this->con, CURLOPT_STDERR, $verbose);
391 391
         }
392 392
         $result = curl_exec($this->con);
393 393
         $this->result = $this->isJson ? json_decode($result, true) : $result;
394
-        if('debug' === Config::getParam('log.level')) {
394
+        if ('debug' === Config::getParam('log.level')) {
395 395
             rewind($verbose);
396 396
             $verboseLog = stream_get_contents($verbose);
397 397
             Logger::log($verboseLog, LOG_DEBUG, [
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             ]);
402 402
             $this->info['verbose'] = $verboseLog;
403 403
         }
404
-        Logger::log($this->url . ' response: ', LOG_DEBUG, is_array($this->result) ? $this->result : [$this->result]);
404
+        Logger::log($this->url.' response: ', LOG_DEBUG, is_array($this->result) ? $this->result : [$this->result]);
405 405
         $this->info = array_merge($this->info, curl_getinfo($this->con));
406 406
     }
407 407
 
Please login to merge, or discard this patch.