@@ -191,7 +191,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -247,14 +247,14 @@ |
||
| 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']); |