Passed
Push — master ( e5ba8d...954323 )
by Terry
01:36
created
src/Psr17/ServerRequestFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Psr17/ResponseFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Psr17/RequestFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Psr17/Utils/SuperGlobal.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
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 = [
Please login to merge, or discard this patch.
src/Psr15/Middleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,5 +25,5 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Psr15/RequestHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Psr7/Message.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.',
Please login to merge, or discard this patch.
src/Psr7/Uri.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         $authority .= $this->getHost();
147 147
 
148
-        if (! empty($this->getPort())) {
148
+        if (!empty($this->getPort())) {
149 149
             $authority .= ':' . $this->getPort();
150 150
         }
151 151
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     {
160 160
         $userInfo = $this->user;
161 161
 
162
-        if (! empty($this->pass)) {
162
+        if (!empty($this->pass)) {
163 163
             $userInfo .= ':' . $this->pass;
164 164
         }
165 165
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
             'fragment'
379 379
         ];
380 380
 
381
-        foreach($components as $v) {
381
+        foreach ($components as $v) {
382 382
             $this->{$v} = isset($data[$v]) ? $this->filter($v, $data[$v]) : '';
383 383
         }
384 384
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         if ($regex) {
440 440
             return preg_replace_callback(
441 441
                 $regex,
442
-                function ($match) {
442
+                function($match) {
443 443
                     return rawurlencode($match[0]);
444 444
                 },
445 445
                 $value
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             2 => 'https',
469 469
         ];
470 470
 
471
-        if (! in_array($scheme, $validSchemes)) {
471
+        if (!in_array($scheme, $validSchemes)) {
472 472
             throw new InvalidArgumentException(
473 473
                 sprintf(
474 474
                     'The string "%s" is not a valid scheme.',
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     protected function assertString($value, string $name = 'it'): void
492 492
     {
493
-        if (! is_string($value)) {
493
+        if (!is_string($value)) {
494 494
             throw new InvalidArgumentException(
495 495
                 sprintf(
496 496
                     ucfirst($name) . ' must be a string, but %s provided.',
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
     {
514 514
         $this->assertString($uri, 'uri');
515 515
 
516
-        if (! filter_var($uri, FILTER_VALIDATE_URL)) {
516
+        if (!filter_var($uri, FILTER_VALIDATE_URL)) {
517 517
             throw new InvalidArgumentException(
518 518
                 sprintf(
519 519
                     '"%s" is not a valid URI',
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
             return;
543 543
         }
544 544
 
545
-        if (! filter_var($host, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
545
+        if (!filter_var($host, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
546 546
             throw new InvalidArgumentException(
547 547
                 sprintf(
548 548
                     '"%s" is not a valid host',
@@ -564,8 +564,8 @@  discard block
 block discarded – undo
564 564
     protected function assertPort($port): void
565 565
     {
566 566
         if (
567
-            ! is_null($port) && 
568
-            ! is_integer($port)
567
+            !is_null($port) && 
568
+            !is_integer($port)
569 569
         ) {
570 570
             throw new InvalidArgumentException(
571 571
                 sprintf(
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
             );
576 576
         }
577 577
 
578
-        if (! ($port > 0 && $port < 65535)) {
578
+        if (!($port > 0 && $port < 65535)) {
579 579
             throw new InvalidArgumentException(
580 580
                 sprintf(
581 581
                     'Port number should be in a range of 0-65535, but %s provided.',
Please login to merge, or discard this patch.
src/Psr7/Response.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
     public function __construct(
144 144
         int    $status  = 200  ,
145 145
         array  $headers = []   ,
146
-               $body    = ''   ,
146
+                $body    = ''   ,
147 147
         string $version = '1.1',
148 148
         string $reason  = 'OK'
149 149
     ) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
      * @param string                 $reason  Reaspnse HTTP reason phrase.
142 142
      */
143 143
     public function __construct(
144
-        int    $status  = 200  ,
145
-        array  $headers = []   ,
146
-               $body    = ''   ,
144
+        int    $status  = 200,
145
+        array  $headers = [],
146
+               $body    = '',
147 147
         string $version = '1.1',
148 148
         string $reason  = 'OK'
149 149
     ) {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      */
212 212
     protected function assertStatus($code)
213 213
     {
214
-        if (! is_integer($code)) {
214
+        if (!is_integer($code)) {
215 215
             throw new InvalidArgumentException(
216 216
                 sprintf(
217 217
                     'Status code should be an integer value, but "%s" provided.',
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             );
221 221
         }
222 222
 
223
-        if (! ($code > 100 && $code < 599)) {
223
+        if (!($code > 100 && $code < 599)) {
224 224
             throw new InvalidArgumentException(
225 225
                 sprintf(
226 226
                     'Status code should be in a range of 100-599, but "%s" provided.',
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             return;
246 246
         }
247 247
 
248
-        if (! is_string($reasonPhrase)) {
248
+        if (!is_string($reasonPhrase)) {
249 249
             throw new InvalidArgumentException(
250 250
                 sprintf(
251 251
                     'Reason phrase must be a string, but "%s" provided.',
Please login to merge, or discard this patch.