@@ -12,7 +12,9 @@ |
||
12 | 12 | |
13 | 13 | namespace chillerlan\HTTP\Psr7; |
14 | 14 | |
15 | -use Exception, InvalidArgumentException, RuntimeException; |
|
15 | +use Exception; |
|
16 | +use InvalidArgumentException; |
|
17 | +use RuntimeException; |
|
16 | 18 | |
17 | 19 | use function clearstatcache, fclose, feof, fread, fstat, ftell, fwrite, is_resource, stream_get_contents, |
18 | 20 | stream_get_meta_data, trigger_error; |
@@ -130,7 +130,7 @@ |
||
130 | 130 | /** |
131 | 131 | * @inheritDoc |
132 | 132 | */ |
133 | - public function getSize():?int{ |
|
133 | + public function getSize(): ?int{ |
|
134 | 134 | |
135 | 135 | if($this->size !== null){ |
136 | 136 | return $this->size; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * @return int|null |
313 | 313 | * @throws \InvalidArgumentException |
314 | 314 | */ |
315 | - protected function filterPort($port):?int{ |
|
315 | + protected function filterPort($port): ?int{ |
|
316 | 316 | |
317 | 317 | if($port === null){ |
318 | 318 | return null; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | /** |
331 | 331 | * @inheritDoc |
332 | 332 | */ |
333 | - public function getPort():?int{ |
|
333 | + public function getPort(): ?int{ |
|
334 | 334 | return $this->port; |
335 | 335 | } |
336 | 336 |
@@ -173,7 +173,7 @@ |
||
173 | 173 | /** |
174 | 174 | * @inheritDoc |
175 | 175 | */ |
176 | - public function getSize():?int{ |
|
176 | + public function getSize(): ?int{ |
|
177 | 177 | return $this->stream->getSize() + strlen($this->boundary) + 6; |
178 | 178 | } |
179 | 179 |
@@ -14,7 +14,8 @@ |
||
14 | 14 | |
15 | 15 | namespace chillerlan\HTTP\Psr7; |
16 | 16 | |
17 | -use InvalidArgumentException, RuntimeException; |
|
17 | +use InvalidArgumentException; |
|
18 | +use RuntimeException; |
|
18 | 19 | |
19 | 20 | use function chillerlan\HTTP\Psr17\{create_stream, create_stream_from_input}; |
20 | 21 | use function array_merge, basename, is_string, pathinfo, random_bytes, sha1, strlen, strtolower, substr; |
@@ -231,7 +231,7 @@ |
||
231 | 231 | } |
232 | 232 | else{ |
233 | 233 | $this->headerNames[$normalized] = $name; |
234 | - $this->headers[$name] = $value; |
|
234 | + $this->headers[$name] = $value; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | * @inheritDoc |
101 | 101 | * @codeCoverageIgnore |
102 | 102 | */ |
103 | - public function getSize():?int{ |
|
103 | + public function getSize(): ?int{ |
|
104 | 104 | return $this->stream->getSize(); |
105 | 105 | } |
106 | 106 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $this->logger->error($e->getTraceAsString()); |
56 | 56 | |
57 | 57 | if(!$e instanceof ClientExceptionInterface){ |
58 | - throw new ClientException('unexpected exception, does not implement "ClientExceptionInterface": '.get_class($e)); // @codeCoverageIgnore |
|
58 | + throw new ClientException('unexpected exception, does not implement "ClientExceptionInterface": '.get_class($e)); // @codeCoverageIgnore |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** @noinspection PhpUnhandledExceptionInspection */ |
@@ -32,6 +32,6 @@ |
||
32 | 32 | * @return \Psr\Http\Message\RequestInterface|null an optional replacement request if the previous request failed |
33 | 33 | * @internal |
34 | 34 | */ |
35 | - public function handleResponse(ResponseInterface $response, RequestInterface $request, int $id, array $curl_info):?RequestInterface; |
|
35 | + public function handleResponse(ResponseInterface $response, RequestInterface $request, int $id, array $curl_info): ?RequestInterface; |
|
36 | 36 | |
37 | 37 | } |
@@ -14,7 +14,8 @@ |
||
14 | 14 | |
15 | 15 | use chillerlan\HTTP\Psr17\StreamFactory; |
16 | 16 | use Psr\Http\Message\{StreamInterface, UploadedFileInterface}; |
17 | -use InvalidArgumentException, RuntimeException; |
|
17 | +use InvalidArgumentException; |
|
18 | +use RuntimeException; |
|
18 | 19 | |
19 | 20 | use function chillerlan\HTTP\Psr17\create_stream_from_input; |
20 | 21 | use function in_array, is_file, is_string, is_writable, move_uploaded_file, php_sapi_name,rename; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | use InvalidArgumentException, RuntimeException; |
18 | 18 | |
19 | 19 | use function chillerlan\HTTP\Psr17\create_stream_from_input; |
20 | -use function in_array, is_file, is_string, is_writable, move_uploaded_file, php_sapi_name,rename; |
|
20 | +use function in_array, is_file, is_string, is_writable, move_uploaded_file, php_sapi_name, rename; |
|
21 | 21 | |
22 | 22 | use const UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_INI_SIZE, |
23 | 23 | UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_OK, UPLOAD_ERR_PARTIAL; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** |
162 | 162 | * @inheritDoc |
163 | 163 | */ |
164 | - public function getSize():?int{ |
|
164 | + public function getSize(): ?int{ |
|
165 | 165 | return $this->size; |
166 | 166 | } |
167 | 167 | |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | /** |
176 | 176 | * @inheritDoc |
177 | 177 | */ |
178 | - public function getClientFilename():?string{ |
|
178 | + public function getClientFilename(): ?string{ |
|
179 | 179 | return $this->clientFilename; |
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | 183 | * @inheritDoc |
184 | 184 | */ |
185 | - public function getClientMediaType():?string{ |
|
185 | + public function getClientMediaType(): ?string{ |
|
186 | 186 | return $this->clientMediaType; |
187 | 187 | } |
188 | 188 |