@@ -160,7 +160,7 @@ |
||
160 | 160 | |
161 | 161 | $headers = $this->getHeaders(); |
162 | 162 | if ($key = current(preg_grep("~^{$name}$~i", array_keys($headers)))) { |
163 | - unset($headers[$key]); |
|
163 | + unset($headers[$key]); |
|
164 | 164 | } |
165 | 165 | $headers[$name] = $value; |
166 | 166 |
@@ -189,7 +189,7 @@ |
||
189 | 189 | public function withAddedHeader($name, $value): self |
190 | 190 | { |
191 | 191 | if ($this->hasHeader($name)) { |
192 | - $value = array_merge_recursive(array_values($this->getHeader($name)), (array)$value); |
|
192 | + $value = array_merge_recursive(array_values($this->getHeader($name)), (array) $value); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | return $this->withHeader($name, $value); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $port = null; |
146 | 146 | } |
147 | 147 | |
148 | - return $port > 0 ? (int)$port : null; |
|
148 | + return $port > 0 ? (int) $port : null; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | if (is_array($data)) { |
362 | 362 | return array_map([$this, __FUNCTION__], $data); |
363 | 363 | } |
364 | - return rawurldecode((string)$data); |
|
364 | + return rawurldecode((string) $data); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | $helper = (new HelperFactory())->createHelper($instance->getInnerObject()); |
397 | 397 | $helper->setObjectProperty('parts', $component + $helper->getObjectProperty('parts', [])); |
398 | - $helper->setObjectProperty('string', (string)$instance); |
|
398 | + $helper->setObjectProperty('string', (string) $instance); |
|
399 | 399 | if ($component === PHP_URL_SCHEME) { |
400 | 400 | $helper->getObjectProperty('secure', stripos($value, 'https') === 0); |
401 | 401 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function __construct(string $method, $uri) |
32 | 32 | { |
33 | 33 | $request = $this->getInnerObject(); |
34 | - $this->setObjectProperty($request->method , 'value', $method); |
|
34 | + $this->setObjectProperty($request->method, 'value', $method); |
|
35 | 35 | |
36 | 36 | $this->uri = (new UriFactory())->createUri($uri); |
37 | 37 | $this->body = (new StreamFactory())->createStream(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->setObjectProperty( |
50 | - $this->object , |
|
50 | + $this->object, |
|
51 | 51 | 'client', |
52 | 52 | new AuraRequest\Client($this->object->server->get()) |
53 | 53 | ); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function withUri(UriInterface $uri, $preserveHost = false): self |
135 | 135 | { |
136 | 136 | if (!$uri instanceof Uri) { |
137 | - $uri = (new UriFactory())->createUri((string)$uri); |
|
137 | + $uri = (new UriFactory())->createUri((string) $uri); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $instance = clone($this); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $request->server->exchangeArray(['REQUEST_METHOD' => $method] + $serverParams); |
36 | 36 | |
37 | 37 | $this->setObjectProperty( |
38 | - $request , |
|
38 | + $request, |
|
39 | 39 | 'headers', |
40 | 40 | new AuraRequest\Headers($request->server->get()) |
41 | 41 | ); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $data = $this->getInnerObject()->post->get(); |
179 | 179 | |
180 | 180 | if ((ArrayObject::ARRAY_AS_PROPS & $this->getInnerObject()->post->getFlags()) > 0) { |
181 | - return (object)$data; |
|
181 | + return (object) $data; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | return $data ?: null; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | $instance = clone($this); |
201 | - $instance->getInnerObject()->post->exchangeArray((array)$data); |
|
201 | + $instance->getInnerObject()->post->exchangeArray((array) $data); |
|
202 | 202 | |
203 | 203 | if (is_object($data)) { |
204 | 204 | $instance->getInnerObject()->post->setFlags(ArrayObject::ARRAY_AS_PROPS); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | throw new RuntimeException('stream is not seekable'); |
179 | 179 | } |
180 | 180 | |
181 | - if (fseek($this->resource, $offset, (int)$whence) === -1) { |
|
181 | + if (fseek($this->resource, $offset, (int) $whence) === -1) { |
|
182 | 182 | throw new RuntimeException('unable to seek stream to position'); |
183 | 183 | } |
184 | 184 | } |
@@ -247,11 +247,11 @@ discard block |
||
247 | 247 | throw new RuntimeException('could not read from stream'); |
248 | 248 | } |
249 | 249 | |
250 | - if ((int)$length < 1) { |
|
250 | + if ((int) $length < 1) { |
|
251 | 251 | return ''; |
252 | 252 | } |
253 | 253 | |
254 | - $part = fread($this->resource, (int)$length); |
|
254 | + $part = fread($this->resource, (int) $length); |
|
255 | 255 | if ($part === false) { |
256 | 256 | throw new RuntimeException('error whilst reading the stream'); |
257 | 257 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | return false; |
106 | 106 | } |
107 | 107 | |
108 | - return is_string($uploadedFileEntry['tmp_name']) || is_string(current((array)$uploadedFileEntry['tmp_name'])); |
|
108 | + return is_string($uploadedFileEntry['tmp_name']) || is_string(current((array) $uploadedFileEntry['tmp_name'])); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |