@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | public function testWithHeaders(): void |
| 18 | 18 | { |
| 19 | - $headers = [ |
|
| 19 | + $headers = [ |
|
| 20 | 20 | new Header('X-Powered-By', 'ReactPHP 7'), |
| 21 | 21 | new Header('X-Foo', 'Bar'), |
| 22 | 22 | ]; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | public function testWithRandomHeaders(): void |
| 18 | 18 | { |
| 19 | - $headers = [ |
|
| 19 | + $headers = [ |
|
| 20 | 20 | new Header('X-Hamsterred-By', 'ReactPHP 7'), |
| 21 | 21 | new Header('X-Foo', 'Bar'), |
| 22 | 22 | new Header('X-Bar', 'Foo'), |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $count = 0; |
| 29 | 29 | |
| 30 | 30 | foreach ($headers as $header) { |
| 31 | - if (! $requestWithHeaders->hasHeader($header->name())) { |
|
| 31 | + if (!$requestWithHeaders->hasHeader($header->name())) { |
|
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function __invoke(ServerRequestInterface $request, callable $next): PromiseInterface |
| 24 | 24 | { |
| 25 | - return resolve($next($request))->then(function (ResponseInterface $response): ResponseInterface { |
|
| 25 | + return resolve($next($request))->then(function(ResponseInterface $response): ResponseInterface { |
|
| 26 | 26 | foreach ($this->headers as $header) { |
| 27 | 27 | $response = $response->withHeader($header->name(), $header->contents()); |
| 28 | 28 | } |
@@ -51,14 +51,14 @@ |
||
| 51 | 51 | |
| 52 | 52 | public function __invoke(ServerRequestInterface $request, callable $next): PromiseInterface |
| 53 | 53 | { |
| 54 | - return resolve($next($request))->then(function (ResponseInterface $response): ResponseInterface { |
|
| 54 | + return resolve($next($request))->then(function(ResponseInterface $response): ResponseInterface { |
|
| 55 | 55 | $count = random_int($this->minimum, $this->maximum); |
| 56 | 56 | $headers = $this->headers; |
| 57 | 57 | for ($i = ZERO; $i < $count; $i++) { |
| 58 | 58 | $randomizer = array_keys($headers); |
| 59 | - $header = $randomizer[random_int(ZERO, count($headers) - ONE)]; |
|
| 60 | - $response = $response->withHeader($headers[$header]->name(), $headers[$header]->contents()); |
|
| 61 | - unset($headers[$header]); |
|
| 59 | + $header = $randomizer[ random_int(ZERO, count($headers) - ONE) ]; |
|
| 60 | + $response = $response->withHeader($headers[ $header ]->name(), $headers[ $header ]->contents()); |
|
| 61 | + unset($headers[ $header ]); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | return $response; |