@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | if (empty($response)) { |
188 | 188 | return null; |
189 | 189 | } |
190 | - $responseBody = json_decode((string)$response->getBody(), true); |
|
190 | + $responseBody = json_decode((string) $response->getBody(), true); |
|
191 | 191 | |
192 | 192 | return is_array($responseBody) ? $responseBody : null; |
193 | 193 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | protected function sendRequest(string $method, string $path, ?array $query = null, ?array $headers = null, $body = null): ResponseInterface |
267 | 267 | { |
268 | 268 | $uri = $this->requestUri($path, $query); |
269 | - $headers = array_merge($this->defaultHeaders, (array)$headers); |
|
269 | + $headers = array_merge($this->defaultHeaders, (array) $headers); |
|
270 | 270 | |
271 | 271 | // set default `Content-Type` if not set and $body not empty |
272 | 272 | if (!empty($body)) { |
@@ -303,16 +303,16 @@ discard block |
||
303 | 303 | { |
304 | 304 | if (strpos($path, 'https://') !== 0 && strpos($path, 'http://') !== 0) { |
305 | 305 | if (substr($path, 0, 1) !== '/') { |
306 | - $path = '/' . $path; |
|
306 | + $path = '/'.$path; |
|
307 | 307 | } |
308 | - $path = $this->apiBaseUrl . $path; |
|
308 | + $path = $this->apiBaseUrl.$path; |
|
309 | 309 | } |
310 | 310 | $uri = new Uri($path); |
311 | 311 | |
312 | 312 | // if path contains query strings, remove them from path and add them to query filter |
313 | 313 | parse_str($uri->getQuery(), $uriQuery); |
314 | 314 | if ($query) { |
315 | - $query = array_merge((array)$uriQuery, (array)$query); |
|
315 | + $query = array_merge((array) $uriQuery, (array) $query); |
|
316 | 316 | $uri = $uri->withQuery(http_build_query($query)); |
317 | 317 | } |
318 | 318 |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | { |
264 | 264 | $response = $this->post(sprintf('/%s', $type), json_encode($body)); |
265 | 265 | if (empty($response)) { |
266 | - throw new BEditaClientException('Invalid response from POST ' . sprintf('/%s', $type)); |
|
266 | + throw new BEditaClientException('Invalid response from POST '.sprintf('/%s', $type)); |
|
267 | 267 | } |
268 | 268 | |
269 | - return (string)$response['data']['id']; |
|
269 | + return (string) $response['data']['id']; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | ]; |
289 | 289 | $response = $this->patch(sprintf('/streams/%s/relationships/object', $streamId), json_encode($body)); |
290 | 290 | if (empty($response)) { |
291 | - throw new BEditaClientException('Invalid response from PATCH ' . sprintf('/streams/%s/relationships/object', $id)); |
|
291 | + throw new BEditaClientException('Invalid response from PATCH '.sprintf('/streams/%s/relationships/object', $id)); |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 |