@@ -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']); |
@@ -533,11 +533,11 @@ discard block |
||
| 533 | 533 | protected function sendRequest(string $method, string $path, ?array $query = null, ?array $headers = null, $body = null) : ResponseInterface |
| 534 | 534 | { |
| 535 | 535 | $uri = new Uri($this->apiBaseUrl); |
| 536 | - $uri = $uri->withPath($uri->getPath() . '/' . $path); |
|
| 536 | + $uri = $uri->withPath($uri->getPath().'/'.$path); |
|
| 537 | 537 | if ($query) { |
| 538 | - $uri = $uri->withQuery(http_build_query((array)$query)); |
|
| 538 | + $uri = $uri->withQuery(http_build_query((array) $query)); |
|
| 539 | 539 | } |
| 540 | - $headers = array_merge($this->defaultHeaders, (array)$headers); |
|
| 540 | + $headers = array_merge($this->defaultHeaders, (array) $headers); |
|
| 541 | 541 | |
| 542 | 542 | // set default `Content-Type` if not set and $body not empty |
| 543 | 543 | if (!empty($body)) { |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | $statusCode = $this->getStatusCode(); |
| 552 | 552 | $response = $this->getResponseBody(); |
| 553 | 553 | |
| 554 | - $code = (string)$statusCode; |
|
| 554 | + $code = (string) $statusCode; |
|
| 555 | 555 | $reason = $this->getStatusMessage(); |
| 556 | 556 | if (!empty($response['error']['code'])) { |
| 557 | 557 | $code = $response['error']['code']; |