Passed
Pull Request — master (#12)
by Stefano
02:39
created
src/BEditaClient.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         if (empty($response)) {
193 193
             return null;
194 194
         }
195
-        $responseBody = json_decode((string)$response->getBody(), true);
195
+        $responseBody = json_decode((string) $response->getBody(), true);
196 196
         if (!is_array($responseBody)) {
197 197
             return null;
198 198
         }
@@ -399,14 +399,14 @@  discard block
 block discarded – undo
399 399
     {
400 400
         $response = $this->post(sprintf('/%s', $type), json_encode($body));
401 401
         if (empty($response)) {
402
-            throw new BEditaClientException('Invalid response from POST ' . sprintf('/%s', $type));
402
+            throw new BEditaClientException('Invalid response from POST '.sprintf('/%s', $type));
403 403
         }
404 404
         $id = $response['data']['id'];
405 405
         $data = compact('id', 'type');
406 406
         $body = compact('data');
407 407
         $response = $this->patch(sprintf('/streams/%s/relationships/object', $streamId), json_encode($body));
408 408
         if (empty($response)) {
409
-            throw new BEditaClientException('Invalid response from PATCH ' . sprintf('/streams/%s/relationships/object', $id));
409
+            throw new BEditaClientException('Invalid response from PATCH '.sprintf('/streams/%s/relationships/object', $id));
410 410
         }
411 411
 
412 412
         return $this->getObject($data['id'], $data['type']);
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
     protected function sendRequest(string $method, string $path, ?array $query = null, ?array $headers = null, $body = null) : ResponseInterface
561 561
     {
562 562
         $uri = $this->requestUri($path, $query);
563
-        $headers = array_merge($this->defaultHeaders, (array)$headers);
563
+        $headers = array_merge($this->defaultHeaders, (array) $headers);
564 564
 
565 565
         // set default `Content-Type` if not set and $body not empty
566 566
         if (!empty($body)) {
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
             $statusCode = $this->getStatusCode();
575 575
             $response = $this->getResponseBody();
576 576
 
577
-            $code = (string)$statusCode;
577
+            $code = (string) $statusCode;
578 578
             $reason = $this->getStatusMessage();
579 579
             if (!empty($response['error']['code'])) {
580 580
                 $code = $response['error']['code'];
@@ -605,13 +605,13 @@  discard block
 block discarded – undo
605 605
             $uri = new Uri($this->apiBaseUrl);
606 606
             // add starting '/' if missing
607 607
             if (substr($path, 0, 1) !== '/') {
608
-                $path = '/' . $path;
608
+                $path = '/'.$path;
609 609
             }
610
-            $uri = $uri->withPath($uri->getPath() . $path);
610
+            $uri = $uri->withPath($uri->getPath().$path);
611 611
         }
612 612
 
613 613
         if ($query) {
614
-            $uri = $uri->withQuery(http_build_query((array)$query));
614
+            $uri = $uri->withQuery(http_build_query((array) $query));
615 615
         }
616 616
 
617 617
         return $uri;
Please login to merge, or discard this patch.