@@ -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 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $customHeaders = $request->getHeaders(); |
| 118 | 118 | unset($customHeaders['Connection'], $customHeaders['Content-Length']); |
| 119 | 119 | |
| 120 | - if (! isset($customHeaders['Content-Type'])) { |
|
| 120 | + if (!isset($customHeaders['Content-Type'])) { |
|
| 121 | 121 | $customHeaders['Content-Type'] = ['application/json']; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if (true === $status['timed_out']) { |
| 152 | 152 | throw TimeoutException::ofRequest($request); |
| 153 | 153 | } |
| 154 | - if (! $this->useKeepAlive) { |
|
| 154 | + if (!$this->useKeepAlive) { |
|
| 155 | 155 | $this->close(); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | && $method !== 'HEAD' |
| 200 | 200 | && 1 === preg_match('/content-length: (\d+)/i', $message, $matches) |
| 201 | 201 | ) { |
| 202 | - $contentLength = (int)$matches[1]; |
|
| 202 | + $contentLength = (int) $matches[1]; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if ($bodyLength === 0) { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $bodyLength = $bodyStart + $contentLength + 4; |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | - } while ($readTotal < $bodyLength && ! feof($this->handle)); |
|
| 212 | + } while ($readTotal < $bodyLength && !feof($this->handle)); |
|
| 213 | 213 | |
| 214 | 214 | return $message; |
| 215 | 215 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | private function open(RequestInterface $request): void |
| 260 | 260 | { |
| 261 | 261 | if ($this->useKeepAlive && $this->handle !== null && is_resource($this->handle)) { |
| 262 | - if (! feof($this->handle)) { |
|
| 262 | + if (!feof($this->handle)) { |
|
| 263 | 263 | return; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | 141 | if (0 !== count($guards)) { |
| 142 | - \array_walk($guards, static function ($guard) use ($response) { |
|
| 142 | + \array_walk($guards, static function($guard) use ($response) { |
|
| 143 | 143 | $guard($response); |
| 144 | 144 | }); |
| 145 | 145 | } |
@@ -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 | |
@@ -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 | |
@@ -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; |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | { |
| 112 | 112 | switch ($this->resultType) { |
| 113 | 113 | case self::RESULT_TYPE_OBJECT: |
| 114 | - return (object)$vpack->toArray(); |
|
| 114 | + return (object) $vpack->toArray(); |
|
| 115 | 115 | case self::RESULT_TYPE_ARRAY: |
| 116 | 116 | return $vpack->toArray(); |
| 117 | 117 | case self::RESULT_TYPE_BINARY: |