@@ -332,7 +332,7 @@ |
||
| 332 | 332 | case RequestMethodInterface::METHOD_PATCH: |
| 333 | 333 | $function = $this->method === RequestMethodInterface::METHOD_PUT ? 'replace' : 'update'; |
| 334 | 334 | |
| 335 | - $keys = array_map(function ($doc) { |
|
| 335 | + $keys = array_map(function($doc) { |
|
| 336 | 336 | if (isset($doc['_key'])) { |
| 337 | 337 | return ['_key' => $doc['_key']]; |
| 338 | 338 | } |
@@ -213,7 +213,7 @@ |
||
| 213 | 213 | return true; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if (! $this->streamHandler->hasMore() || $this->streamHandler->cursorId() === null) { |
|
| 216 | + if (!$this->streamHandler->hasMore() || $this->streamHandler->cursorId() === null) { |
|
| 217 | 217 | return false; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -108,18 +108,18 @@ discard block |
||
| 108 | 108 | $this->options[self::OPTION_ENDPOINT] |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | - if (! isset($this->options[self::OPTION_ENDPOINT])) { |
|
| 111 | + if (!isset($this->options[self::OPTION_ENDPOINT])) { |
|
| 112 | 112 | throw new LogicException('Endpoint not specified'); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if (isset($this->options[self::OPTION_AUTH_TYPE]) |
| 116 | - && ! in_array($this->options[self::OPTION_AUTH_TYPE], self::getSupportedAuthTypes(), true) |
|
| 116 | + && !in_array($this->options[self::OPTION_AUTH_TYPE], self::getSupportedAuthTypes(), true) |
|
| 117 | 117 | ) { |
| 118 | 118 | throw new LogicException('Unsupported authorization method: ' . $this->options[self::OPTION_AUTH_TYPE]); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | if (isset($this->options[self::OPTION_CONNECTION]) |
| 122 | - && ! in_array($this->options[self::OPTION_CONNECTION], self::getSupportedConnectionTypes(), true) |
|
| 122 | + && !in_array($this->options[self::OPTION_CONNECTION], self::getSupportedConnectionTypes(), true) |
|
| 123 | 123 | ) { |
| 124 | 124 | throw new LogicException('Unsupported connection value: ' . $this->options[self::OPTION_CONNECTION]); |
| 125 | 125 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function offsetGet($offset) |
| 159 | 159 | { |
| 160 | - if (! array_key_exists($offset, $this->options)) { |
|
| 160 | + if (!array_key_exists($offset, $this->options)) { |
|
| 161 | 161 | throw new LogicException('Invalid option ' . $offset); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $key = trim($parts[0]); |
| 42 | 42 | $value = isset($parts[1]) ? trim($parts[1]) : ''; |
| 43 | 43 | |
| 44 | - if (! isset($headers[$key])) { |
|
| 44 | + if (!isset($headers[$key])) { |
|
| 45 | 45 | $headers[$key] = []; |
| 46 | 46 | } |
| 47 | 47 | $headers[$key][] = $value; |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | $data = Json::decode($response->getBody()->getContents()); |
| 48 | 48 | |
| 49 | - if (! isset($data['_id'])) { |
|
| 49 | + if (!isset($data['_id'])) { |
|
| 50 | 50 | throw UnexpectedResponse::forType($type, $response); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $data = Json::decode($response->getBody()->getContents()); |
| 48 | 48 | |
| 49 | - if (! isset($data['id'])) { |
|
| 49 | + if (!isset($data['id'])) { |
|
| 50 | 50 | throw UnexpectedResponse::forType($type, $response); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $data = Json::decode($response->getBody()->getContents()); |
| 86 | 86 | |
| 87 | - if (! isset($data['count'])) { |
|
| 87 | + if (!isset($data['count'])) { |
|
| 88 | 88 | throw UnexpectedResponse::forType($type, $response); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $customHeaders = $request->getHeaders(); |
| 160 | 160 | unset($customHeaders['Connection'], $customHeaders['Content-Length']); |
| 161 | 161 | |
| 162 | - if (! isset($customHeaders['Content-Type'])) { |
|
| 162 | + if (!isset($customHeaders['Content-Type'])) { |
|
| 163 | 163 | $customHeaders['Content-Type'] = ['application/json']; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if (true === $status['timed_out']) { |
| 194 | 194 | throw TimeoutException::ofRequest($request); |
| 195 | 195 | } |
| 196 | - if (! $this->useKeepAlive) { |
|
| 196 | + if (!$this->useKeepAlive) { |
|
| 197 | 197 | $this->close(); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | && $method !== 'HEAD' |
| 242 | 242 | && 1 === preg_match('/content-length: (\d+)/i', $message, $matches) |
| 243 | 243 | ) { |
| 244 | - $contentLength = (int)$matches[1]; |
|
| 244 | + $contentLength = (int) $matches[1]; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | if ($bodyLength === 0) { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $bodyLength = $bodyStart + $contentLength + 4; |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | - } while ($readTotal < $bodyLength && ! feof($this->handle)); |
|
| 254 | + } while ($readTotal < $bodyLength && !feof($this->handle)); |
|
| 255 | 255 | |
| 256 | 256 | return $message; |
| 257 | 257 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | private function open(RequestInterface $request): void |
| 302 | 302 | { |
| 303 | 303 | if ($this->useKeepAlive && $this->handle !== null && is_resource($this->handle)) { // @phpstan-ignore-line |
| 304 | - if (! feof($this->handle)) { |
|
| 304 | + if (!feof($this->handle)) { |
|
| 305 | 305 | return; |
| 306 | 306 | } |
| 307 | 307 | |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | 114 | if (0 !== count($guards)) { |
| 115 | - \array_walk($guards, static function ($guard) use ($response): void { |
|
| 115 | + \array_walk($guards, static function($guard) use ($response): void { |
|
| 116 | 116 | $guard($response); |
| 117 | 117 | }); |
| 118 | 118 | } |