@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $customHeaders = $request->getHeaders(); |
| 109 | 109 | unset($customHeaders['Connection'], $customHeaders['Content-Length']); |
| 110 | 110 | |
| 111 | - if (! isset($customHeaders['Content-Type'])) { |
|
| 111 | + if (!isset($customHeaders['Content-Type'])) { |
|
| 112 | 112 | $customHeaders['Content-Type'] = ['application/json']; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | // TODO https://docs.arangodb.com/3.4/Manual/Architecture/DeploymentModes/ActiveFailover/Architecture.html |
| 140 | 140 | $status = stream_get_meta_data($this->handle); |
| 141 | 141 | |
| 142 | - if (! empty($status['timed_out'])) { |
|
| 142 | + if (!empty($status['timed_out'])) { |
|
| 143 | 143 | throw TimeoutException::ofRequest($request); |
| 144 | 144 | } |
| 145 | - if (! $this->useKeepAlive) { |
|
| 145 | + if (!$this->useKeepAlive) { |
|
| 146 | 146 | $this->close(); |
| 147 | 147 | } |
| 148 | 148 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | && $method !== 'HEAD' |
| 191 | 191 | && 1 === preg_match('/content-length: (\d+)/i', $message, $matches) |
| 192 | 192 | ) { |
| 193 | - $contentLength = (int)$matches[1]; |
|
| 193 | + $contentLength = (int) $matches[1]; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | if ($bodyLength === 0) { |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $bodyLength = $bodyStart + $contentLength + 4; |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | - } while ($readTotal < $bodyLength && ! feof($this->handle)); |
|
| 203 | + } while ($readTotal < $bodyLength && !feof($this->handle)); |
|
| 204 | 204 | |
| 205 | 205 | return $message; |
| 206 | 206 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | private function open(RequestInterface $request): void |
| 251 | 251 | { |
| 252 | 252 | if ($this->useKeepAlive && $this->handle !== null && is_resource($this->handle)) { |
| 253 | - if (! feof($this->handle)) { |
|
| 253 | + if (!feof($this->handle)) { |
|
| 254 | 254 | return; |
| 255 | 255 | } |
| 256 | 256 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $key = trim($parts[0]); |
| 46 | 46 | $value = isset($parts[1]) ? trim($parts[1]) : ''; |
| 47 | 47 | |
| 48 | - if (! isset($headers[$key])) { |
|
| 48 | + if (!isset($headers[$key])) { |
|
| 49 | 49 | $headers[$key] = []; |
| 50 | 50 | } |
| 51 | 51 | $headers[$key][] = $value; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | $value = Json::decode($body->getContents())[$key] ?? null; |
| 88 | 88 | |
| 89 | - if ($value !== null && ! \is_scalar($value)) { |
|
| 89 | + if ($value !== null && !\is_scalar($value)) { |
|
| 90 | 90 | $value = Json::encode($value); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function toJson(): string |
| 45 | 45 | { |
| 46 | - if (! is_string($this->data)) { |
|
| 46 | + if (!is_string($this->data)) { |
|
| 47 | 47 | return Json::encode($this->data); |
| 48 | 48 | } |
| 49 | 49 | return $this->data; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | RequestFactoryInterface $requestFactory, |
| 168 | 168 | array $options = [] |
| 169 | 169 | ) { |
| 170 | - if (! isset($options[self::ENTRY_TYPE])) { |
|
| 170 | + if (!isset($options[self::ENTRY_TYPE])) { |
|
| 171 | 171 | $options[self::ENTRY_TYPE] = self::ENTRY_TYPE_JSON; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | switch ($this->options[self::ENTRY_TYPE]) { |
| 250 | 250 | case self::ENTRY_TYPE_OBJECT: |
| 251 | - return (object)$this->data; |
|
| 251 | + return (object) $this->data; |
|
| 252 | 252 | case self::ENTRY_TYPE_ARRAY: |
| 253 | 253 | return $this->data; |
| 254 | 254 | case self::ENTRY_TYPE_JSON: |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | { |
| 302 | 302 | switch ($this->options[self::ENTRY_TYPE]) { |
| 303 | 303 | case self::ENTRY_TYPE_OBJECT: |
| 304 | - return (object)$this->data[$this->position]; |
|
| 304 | + return (object) $this->data[$this->position]; |
|
| 305 | 305 | case self::ENTRY_TYPE_ARRAY: |
| 306 | 306 | return $this->data[$this->position]; |
| 307 | 307 | case self::ENTRY_TYPE_JSON: |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return true; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - if (! $this->hasMore || $this->id === null) { |
|
| 334 | + if (!$this->hasMore || $this->id === null) { |
|
| 335 | 335 | return false; |
| 336 | 336 | } |
| 337 | 337 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function send(array $params = [], bool $waitForSync = false): ResponseInterface |
| 82 | 82 | { |
| 83 | - if (! empty($this->types)) { |
|
| 83 | + if (!empty($this->types)) { |
|
| 84 | 84 | $batch = Batch::fromTypes(...$this->types); |
| 85 | 85 | $responseBatch = $this->client->sendRequest($batch->toRequest($this->requestFactory)); |
| 86 | 86 | |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | )->toRequest($this->requestFactory) |
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | - if (! empty($guards)) { |
|
| 133 | - \array_walk($guards, function ($guard) use ($response) { |
|
| 132 | + if (!empty($guards)) { |
|
| 133 | + \array_walk($guards, function($guard) use ($response) { |
|
| 134 | 134 | $guard($response); |
| 135 | 135 | }); |
| 136 | 136 | } |