Passed
Pull Request — master (#38)
by Dante
02:10
created
src/BaseClient.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         if (empty($response)) {
192 192
             return null;
193 193
         }
194
-        $responseBody = json_decode((string)$response->getBody(), true);
194
+        $responseBody = json_decode((string) $response->getBody(), true);
195 195
         if (!is_array($responseBody)) {
196 196
             return null;
197 197
         }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     protected function sendRequest(string $method, string $path, ?array $query = null, ?array $headers = null, $body = null): ResponseInterface
274 274
     {
275 275
         $uri = $this->requestUri($path, $query);
276
-        $headers = array_merge($this->defaultHeaders, (array)$headers);
276
+        $headers = array_merge($this->defaultHeaders, (array) $headers);
277 277
 
278 278
         // set default `Content-Type` if not set and $body not empty
279 279
         if (!empty($body)) {
@@ -310,16 +310,16 @@  discard block
 block discarded – undo
310 310
     {
311 311
         if (strpos($path, 'https://') !== 0 && strpos($path, 'http://') !== 0) {
312 312
             if (substr($path, 0, 1) !== '/') {
313
-                $path = '/' . $path;
313
+                $path = '/'.$path;
314 314
             }
315
-            $path = $this->apiBaseUrl . $path;
315
+            $path = $this->apiBaseUrl.$path;
316 316
         }
317 317
         $uri = new Uri($path);
318 318
 
319 319
         // if path contains query strings, remove them from path and add them to query filter
320 320
         parse_str($uri->getQuery(), $uriQuery);
321 321
         if ($query) {
322
-            $query = array_merge((array)$uriQuery, (array)$query);
322
+            $query = array_merge((array) $uriQuery, (array) $query);
323 323
             $uri = $uri->withQuery(http_build_query($query));
324 324
         }
325 325
 
Please login to merge, or discard this patch.
src/BEditaClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -247,14 +247,14 @@
 block discarded – undo
247 247
     {
248 248
         $response = $this->post(sprintf('/%s', $type), json_encode($body));
249 249
         if (empty($response)) {
250
-            throw new BEditaClientException('Invalid response from POST ' . sprintf('/%s', $type));
250
+            throw new BEditaClientException('Invalid response from POST '.sprintf('/%s', $type));
251 251
         }
252 252
         $id = $response['data']['id'];
253 253
         $data = compact('id', 'type');
254 254
         $body = compact('data');
255 255
         $response = $this->patch(sprintf('/streams/%s/relationships/object', $streamId), json_encode($body));
256 256
         if (empty($response)) {
257
-            throw new BEditaClientException('Invalid response from PATCH ' . sprintf('/streams/%s/relationships/object', $id));
257
+            throw new BEditaClientException('Invalid response from PATCH '.sprintf('/streams/%s/relationships/object', $id));
258 258
         }
259 259
 
260 260
         return $this->getObject($data['id'], $data['type']);
Please login to merge, or discard this patch.