@@ -43,7 +43,7 @@ discard block |
||
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; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | return $this->data; |
163 | 163 | } |
164 | 164 | |
165 | - if (! is_string($this->data)) { |
|
165 | + if (!is_string($this->data)) { |
|
166 | 166 | $this->data = Json::encode($this->data); |
167 | 167 | } |
168 | 168 | return $this->data; |
@@ -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 |
@@ -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 | break; |
253 | 253 | case self::ENTRY_TYPE_ARRAY: |
254 | 254 | return $this->data; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | { |
305 | 305 | switch ($this->options[self::ENTRY_TYPE]) { |
306 | 306 | case self::ENTRY_TYPE_OBJECT: |
307 | - return (object)$this->data[$this->position]; |
|
307 | + return (object) $this->data[$this->position]; |
|
308 | 308 | case self::ENTRY_TYPE_ARRAY: |
309 | 309 | return $this->data[$this->position]; |
310 | 310 | case self::ENTRY_TYPE_JSON: |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | return true; |
335 | 335 | } |
336 | 336 | |
337 | - if (! $this->hasMore || $this->id === null) { |
|
337 | + if (!$this->hasMore || $this->id === null) { |
|
338 | 338 | return false; |
339 | 339 | } |
340 | 340 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $return = []; |
87 | 87 | $guards = []; |
88 | 88 | |
89 | - if (! empty($this->types)) { |
|
89 | + if (!empty($this->types)) { |
|
90 | 90 | $batch = Batch::fromTypes(...$this->types); |
91 | 91 | $responseBatch = $this->client->sendRequest($batch->toRequest($this->requestFactory)); |
92 | 92 | BatchResult::fromResponse($responseBatch, $this->responseFactory)->validateBatch($batch); |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | )->toRequest($this->requestFactory) |
128 | 128 | ); |
129 | 129 | |
130 | - if (! empty($guards)) { |
|
131 | - \array_walk($guards, function ($guard) use ($response) { |
|
130 | + if (!empty($guards)) { |
|
131 | + \array_walk($guards, function($guard) use ($response) { |
|
132 | 132 | $guard($response); |
133 | 133 | }); |
134 | 134 | } |