@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @return int|null |
| 308 | 308 | * @throws \InvalidArgumentException |
| 309 | 309 | */ |
| 310 | - private function filterPort($port):?int{ |
|
| 310 | + private function filterPort($port): ?int{ |
|
| 311 | 311 | |
| 312 | 312 | if($port === null){ |
| 313 | 313 | return null; |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | /** |
| 326 | 326 | * @inheritdoc |
| 327 | 327 | */ |
| 328 | - public function getPort():?int{ |
|
| 328 | + public function getPort(): ?int{ |
|
| 329 | 329 | return $this->port; |
| 330 | 330 | } |
| 331 | 331 | |
@@ -169,7 +169,7 @@ |
||
| 169 | 169 | /** |
| 170 | 170 | * @inheritdoc |
| 171 | 171 | */ |
| 172 | - public function getSize():?int{ |
|
| 172 | + public function getSize(): ?int{ |
|
| 173 | 173 | |
| 174 | 174 | if($this->size !== null){ |
| 175 | 175 | return $this->size; |
@@ -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 | /** |
| 18 | 20 | * @property resource $stream |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * @inheritdoc |
| 158 | 158 | */ |
| 159 | - public function getSize():?int{ |
|
| 159 | + public function getSize(): ?int{ |
|
| 160 | 160 | return $this->size; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | /** |
| 171 | 171 | * @inheritdoc |
| 172 | 172 | */ |
| 173 | - public function getClientFilename():?string{ |
|
| 173 | + public function getClientFilename(): ?string{ |
|
| 174 | 174 | return $this->clientFilename; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | 178 | * @inheritdoc |
| 179 | 179 | */ |
| 180 | - public function getClientMediaType():?string{ |
|
| 180 | + public function getClientMediaType(): ?string{ |
|
| 181 | 181 | return $this->clientMediaType; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -14,7 +14,8 @@ |
||
| 14 | 14 | |
| 15 | 15 | use chillerlan\HTTP\{Psr17, Psr17\StreamFactory}; |
| 16 | 16 | use Psr\Http\Message\{StreamInterface, UploadedFileInterface}; |
| 17 | -use InvalidArgumentException, RuntimeException; |
|
| 17 | +use InvalidArgumentException; |
|
| 18 | +use RuntimeException; |
|
| 18 | 19 | |
| 19 | 20 | final class UploadedFile implements UploadedFileInterface{ |
| 20 | 21 | |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | private function hasHeader(array $headers, string $key):bool{ |
| 158 | 158 | $lowercaseHeader = strtolower($key); |
| 159 | 159 | |
| 160 | - foreach ($headers as $k => $v) { |
|
| 161 | - if (strtolower($k) === $lowercaseHeader) { |
|
| 160 | + foreach($headers as $k => $v){ |
|
| 161 | + if(strtolower($k) === $lowercaseHeader){ |
|
| 162 | 162 | return true; |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | /** |
| 177 | 177 | * @inheritdoc |
| 178 | 178 | */ |
| 179 | - public function getSize():?int{ |
|
| 179 | + public function getSize(): ?int{ |
|
| 180 | 180 | return $this->stream->getSize() + strlen($this->boundary) + 6; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -14,8 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace chillerlan\HTTP\Psr7; |
| 16 | 16 | |
| 17 | +use InvalidArgumentException; |
|
| 18 | +use RuntimeException; |
|
| 17 | 19 | use chillerlan\HTTP\Psr17; |
| 18 | -use InvalidArgumentException, RuntimeException; |
|
| 19 | 20 | |
| 20 | 21 | /** |
| 21 | 22 | * @property \chillerlan\HTTP\Psr7\Stream $stream |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | namespace chillerlan\HTTP\Psr18; |
| 14 | 14 | |
| 15 | 15 | use chillerlan\HTTP\{HTTPOptions, Psr7, Psr17}; |
| 16 | -use chillerlan\HTTP\Psr7\Request; |
|
| 17 | 16 | use chillerlan\HTTP\Psr17\ResponseFactory; |
| 17 | +use chillerlan\HTTP\Psr7\Request; |
|
| 18 | 18 | use chillerlan\Settings\SettingsContainerInterface; |
| 19 | 19 | use Psr\Http\Message\{ResponseFactoryInterface, ResponseInterface}; |
| 20 | 20 | use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger}; |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | * @inheritdoc |
| 99 | 99 | * @codeCoverageIgnore |
| 100 | 100 | */ |
| 101 | - public function getSize():?int{ |
|
| 101 | + public function getSize(): ?int{ |
|
| 102 | 102 | return $this->stream->getSize(); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | $requestUri = (string)$uri->withFragment(''); |
| 54 | 54 | |
| 55 | - set_error_handler(function ($severity, $msg, $file, $line){ |
|
| 55 | + set_error_handler(function($severity, $msg, $file, $line){ |
|
| 56 | 56 | throw new \ErrorException($msg, 0, $severity, $file, $line); |
| 57 | 57 | }); |
| 58 | 58 | |