@@ -192,7 +192,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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)) { |
@@ -596,13 +596,13 @@ discard block |
||
| 596 | 596 | $uri = new Uri($this->apiBaseUrl); |
| 597 | 597 | // add starting '/' if missing |
| 598 | 598 | if (substr($path, 0, 1) !== '/') { |
| 599 | - $path = '/' . $path; |
|
| 599 | + $path = '/'.$path; |
|
| 600 | 600 | } |
| 601 | - $uri = $uri->withPath($uri->getPath() . $path); |
|
| 601 | + $uri = $uri->withPath($uri->getPath().$path); |
|
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | if ($query) { |
| 605 | - $uri = $uri->withQuery(http_build_query((array)$query)); |
|
| 605 | + $uri = $uri->withQuery(http_build_query((array) $query)); |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | return $uri; |