| @@ -40,9 +40,9 @@ discard block | ||
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 | $protocol = $server['SERVER_PROTOCOL'] ?? '1.1'; | 
| 43 | -        $protocol = str_replace('HTTP/', '',  $protocol); | |
| 43 | +        $protocol = str_replace('HTTP/', '', $protocol); | |
| 44 | 44 | |
| 45 | -        if (! ($uri instanceof UriInterface)) { | |
| 45 | +        if (!($uri instanceof UriInterface)) { | |
| 46 | 46 | $uriFactory = new UriFactory(); | 
| 47 | 47 | $uri = $uriFactory->createUri($uri); | 
| 48 | 48 | } | 
| @@ -58,8 +58,8 @@ discard block | ||
| 58 | 58 | $protocol, | 
| 59 | 59 | $server, // from extract. | 
| 60 | 60 | $cookie, // from extract. | 
| 61 | - $post, // from extract. | |
| 62 | - $get, // from extract. | |
| 61 | + $post, // from extract. | |
| 62 | + $get, // from extract. | |
| 63 | 63 | $files // from extract. | 
| 64 | 64 | ); | 
| 65 | 65 | } | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | |
| 85 | 85 | // HTTP protocal version. | 
| 86 | 86 | $protocol = $server['SERVER_PROTOCOL'] ?? '1.1'; | 
| 87 | -        $protocol = str_replace('HTTP/', '',  $protocol); | |
| 87 | +        $protocol = str_replace('HTTP/', '', $protocol); | |
| 88 | 88 | |
| 89 | 89 | $uri = UriFactory::fromGlobal(); | 
| 90 | 90 | |
| @@ -99,8 +99,8 @@ discard block | ||
| 99 | 99 | $protocol, | 
| 100 | 100 | $server, // from extract. | 
| 101 | 101 | $cookie, // from extract. | 
| 102 | - $post, // from extract. | |
| 103 | - $get, // from extract. | |
| 102 | + $post, // from extract. | |
| 103 | + $get, // from extract. | |
| 104 | 104 | $files // from extract. | 
| 105 | 105 | ); | 
| 106 | 106 | } | 
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | extract(SuperGlobal::extract()); | 
| 35 | 35 | |
| 36 | 36 | $protocol = $server['SERVER_PROTOCOL'] ?? '1.1'; | 
| 37 | -        $protocol = str_replace('HTTP/', '',  $protocol); | |
| 37 | +        $protocol = str_replace('HTTP/', '', $protocol); | |
| 38 | 38 | |
| 39 | 39 | $streamFactory = new streamFactory(); | 
| 40 | 40 | |
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 |      { | 
| 37 | 37 |          $resource = @fopen('php://temp', 'r+'); | 
| 38 | 38 | |
| 39 | -        if (! is_resource($resource)) { | |
| 39 | +        if (!is_resource($resource)) { | |
| 40 | 40 | throw new RuntimeException( | 
| 41 | 41 | 'Unable to open "php://temp" resource.' | 
| 42 | 42 | ); | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | */ | 
| 54 | 54 | public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface | 
| 55 | 55 |      { | 
| 56 | -        if ($mode === '' || ! preg_match('/^[rwaxce]{1}[bt]{0,1}[+]{0,1}+$/', $mode)) { | |
| 56 | +        if ($mode === '' || !preg_match('/^[rwaxce]{1}[bt]{0,1}[+]{0,1}+$/', $mode)) { | |
| 57 | 57 | throw new InvalidArgumentException( | 
| 58 | 58 | sprintf( | 
| 59 | 59 | 'Invalid file opening mode "%s"', | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | |
| 65 | 65 | $resource = @fopen($filename, $mode); | 
| 66 | 66 | |
| 67 | -        if (! is_resource($resource)) { | |
| 67 | +        if (!is_resource($resource)) { | |
| 68 | 68 | throw new RuntimeException( | 
| 69 | 69 | sprintf( | 
| 70 | 70 | 'Unable to open file at "%s"', | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | */ | 
| 82 | 82 | public function createStreamFromResource($resource): StreamInterface | 
| 83 | 83 |      { | 
| 84 | -        if (! is_resource($resource)) { | |
| 84 | +        if (!is_resource($resource)) { | |
| 85 | 85 |              $resource = fopen('php://temp', 'r+'); | 
| 86 | 86 | } | 
| 87 | 87 | |
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | string $clientMediaType = null | 
| 35 | 35 | ): UploadedFileInterface | 
| 36 | 36 |      { | 
| 37 | -        if (! $stream->isReadable()) { | |
| 37 | +        if (!$stream->isReadable()) { | |
| 38 | 38 | throw new InvalidArgumentException( | 
| 39 | 39 | 'File is not readable.' | 
| 40 | 40 | ); | 
| @@ -35,7 +35,7 @@ | ||
| 35 | 35 | extract(SuperGlobal::extract()); | 
| 36 | 36 | |
| 37 | 37 | $protocol = $server['SERVER_PROTOCOL'] ?? '1.1'; | 
| 38 | -        $protocol = str_replace('HTTP/', '',  $protocol); | |
| 38 | +        $protocol = str_replace('HTTP/', '', $protocol); | |
| 39 | 39 | |
| 40 | 40 | $uriFactory = new UriFactory(); | 
| 41 | 41 | $streamFactory = new StreamFactory(); | 
| @@ -70,10 +70,10 @@ | ||
| 70 | 70 | */ | 
| 71 | 71 | public static function mockCliEnvironment(array $server = []): void | 
| 72 | 72 |      { | 
| 73 | - $_POST = $_POST ?? []; | |
| 73 | + $_POST = $_POST ?? []; | |
| 74 | 74 | $_COOKIE = $_COOKIE ?? []; | 
| 75 | - $_GET = $_GET ?? []; | |
| 76 | - $_FILES = $_FILES ?? []; | |
| 75 | + $_GET = $_GET ?? []; | |
| 76 | + $_FILES = $_FILES ?? []; | |
| 77 | 77 | $_SERVER = $_SERVER ?? []; | 
| 78 | 78 | |
| 79 | 79 | $defaultServerParams = [ | 
| @@ -25,5 +25,5 @@ | ||
| 25 | 25 | /** | 
| 26 | 26 |       * {@inheritdoc} | 
| 27 | 27 | */ | 
| 28 | - abstract function process(ServerRequestInterface $request,RequestHandlerInterface $handler): ResponseInterface; | |
| 28 | + abstract function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface; | |
| 29 | 29 | } | 
| 30 | 30 | \ No newline at end of file | 
| @@ -82,7 +82,7 @@ | ||
| 82 | 82 | */ | 
| 83 | 83 | protected function final(ServerRequestInterface $request): ResponseInterface | 
| 84 | 84 |      { | 
| 85 | -        if (! $this->fallbackHandler) { | |
| 85 | +        if (!$this->fallbackHandler) { | |
| 86 | 86 | return new Response(); | 
| 87 | 87 | } | 
| 88 | 88 | |
| @@ -282,7 +282,7 @@ discard block | ||
| 282 | 282 | $num = count($headers); | 
| 283 | 283 | |
| 284 | 284 |          if ($num > 1) { | 
| 285 | -            $headers = array_merge(...array_map(function ($line) { | |
| 285 | +            $headers = array_merge(...array_map(function($line) { | |
| 286 | 286 | $name = trim($line[1]); | 
| 287 | 287 | $field = trim($line[2]); | 
| 288 | 288 | return [$name => $field]; | 
| @@ -359,7 +359,7 @@ discard block | ||
| 359 | 359 | // digit => 0-9 | 
| 360 | 360 | // others => !#$%&\'*+-.^_`|~ | 
| 361 | 361 | |
| 362 | -        if (! preg_match('/^[a-zA-Z0-9!#$%&\'*+-.^_`|~]+$/', $name)) { | |
| 362 | +        if (!preg_match('/^[a-zA-Z0-9!#$%&\'*+-.^_`|~]+$/', $name)) { | |
| 363 | 363 | throw new InvalidArgumentException( | 
| 364 | 364 | sprintf( | 
| 365 | 365 | '"%s" is not valid header name, it must be an RFC 7230 compatible string.', | 
| @@ -382,7 +382,7 @@ discard block | ||
| 382 | 382 |      { | 
| 383 | 383 |          if (is_array($value)) { | 
| 384 | 384 |              foreach ($value as $item) { | 
| 385 | -                if (! is_scalar($item) || is_bool($item)) { | |
| 385 | +                if (!is_scalar($item) || is_bool($item)) { | |
| 386 | 386 | throw new InvalidArgumentException( | 
| 387 | 387 | sprintf( | 
| 388 | 388 | 'The header values only accept string and number, but "%s" provided.', | 
| @@ -402,7 +402,7 @@ discard block | ||
| 402 | 402 | |
| 403 | 403 | // I THINK THAT obs-text SHOULD N0T BE USED. | 
| 404 | 404 | // OR EVEN I CAN PASS CHINESE CHARACTERS, THAT'S WEIRD. | 
| 405 | -                if (! preg_match('/^[ \t\x21-\x7e]+$/', $item)) { | |
| 405 | +                if (!preg_match('/^[ \t\x21-\x7e]+$/', $item)) { | |
| 406 | 406 | throw new InvalidArgumentException( | 
| 407 | 407 | sprintf( | 
| 408 | 408 | '"%s" is not valid header value, it must contains visible ASCII characters only.', | 
| @@ -432,7 +432,7 @@ discard block | ||
| 432 | 432 | */ | 
| 433 | 433 | protected function assertProtocolVersion(string $version): void | 
| 434 | 434 |      { | 
| 435 | -        if (! in_array($version, $this->validProtocolVersions)) { | |
| 435 | +        if (!in_array($version, $this->validProtocolVersions)) { | |
| 436 | 436 | throw new InvalidArgumentException( | 
| 437 | 437 | sprintf( | 
| 438 | 438 | 'Unsupported HTTP protocol version number. "%s" provided.', |