@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function only($keys) |
67 | 67 | { |
68 | - $params = []; |
|
68 | + $params = [ ]; |
|
69 | 69 | |
70 | 70 | foreach ((array) $keys as $key) { |
71 | - $params[$key] = $this->get($key); |
|
71 | + $params[ $key ] = $this->get($key); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $params; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function exists($key) |
91 | 91 | { |
92 | - return array_reduce((array) $key, function ($carry, $item) { |
|
92 | + return array_reduce((array) $key, function($carry, $item) { |
|
93 | 93 | return $carry && array_key_exists($item, $this->all()); |
94 | 94 | }, true); |
95 | 95 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function has($key) |
101 | 101 | { |
102 | - return array_reduce((array) $key, function ($carry, $item) { |
|
102 | + return array_reduce((array) $key, function($carry, $item) { |
|
103 | 103 | return $carry && !$this->isEmptyString($item); |
104 | 104 | }, true); |
105 | 105 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | $segments = explode('/', trim($this->getUri()->getPath(), '/')); |
125 | 125 | |
126 | - return array_values(array_filter($segments, function ($segment) { |
|
126 | + return array_values(array_filter($segments, function($segment) { |
|
127 | 127 | return trim($segment) !== ''; |
128 | 128 | })); |
129 | 129 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @return Response |
15 | 15 | */ |
16 | - public function html(string $content = null, int $status = 200, array $headers = []) : Response; |
|
16 | + public function html(string $content = null, int $status = 200, array $headers = [ ]) : Response; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param mixed $content |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return Response |
25 | 25 | */ |
26 | - public function make($content = '', int $status = 200, array $headers = []) : Response; |
|
26 | + public function make($content = '', int $status = 200, array $headers = [ ]) : Response; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param array|Arrayable $content |
@@ -33,5 +33,5 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @return Response |
35 | 35 | */ |
36 | - public function json($content = [], int $status = 200, array $headers = [], int $option = 79) : Response; |
|
36 | + public function json($content = [ ], int $status = 200, array $headers = [ ], int $option = 79) : Response; |
|
37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * @var array |
13 | 13 | */ |
14 | - protected $pipes = []; |
|
14 | + protected $pipes = [ ]; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @var Emitter |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | ob_start(); |
40 | 40 | $bufferLevel = ob_get_level(); |
41 | 41 | |
42 | - $response = array_reduce(array_reverse($this->pipes), function ($next, $pipe) use ($request) { |
|
43 | - return $pipe($request, function () use ($next) { |
|
42 | + $response = array_reduce(array_reverse($this->pipes), function($next, $pipe) use ($request) { |
|
43 | + return $pipe($request, function() use ($next) { |
|
44 | 44 | return $next; |
45 | 45 | }); |
46 | 46 | }); |
@@ -24,23 +24,23 @@ |
||
24 | 24 | public function getDefinitions() : array |
25 | 25 | { |
26 | 26 | return [ |
27 | - RequestInterface::class => function () { |
|
27 | + RequestInterface::class => function() { |
|
28 | 28 | return new Request( |
29 | 29 | ServerRequestFactory::fromGlobals() |
30 | 30 | ); |
31 | 31 | }, |
32 | - ResponseInterface::class => function () { |
|
32 | + ResponseInterface::class => function() { |
|
33 | 33 | return new Response( |
34 | 34 | new DiactorosResponse |
35 | 35 | ); |
36 | 36 | }, |
37 | - ResponseFactoryInterface::class => function () { |
|
37 | + ResponseFactoryInterface::class => function() { |
|
38 | 38 | return new ResponseFactory; |
39 | 39 | }, |
40 | - Psr7Request::class => function (Container $container) { |
|
40 | + Psr7Request::class => function(Container $container) { |
|
41 | 41 | return $container->make(RequestInterface::class)->toPsr7(); |
42 | 42 | }, |
43 | - Psr7Response::class => function (Container $container) { |
|
43 | + Psr7Response::class => function(Container $container) { |
|
44 | 44 | return $container->make(ResponseInterface::class)->toPsr7(); |
45 | 45 | } |
46 | 46 | ]; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @return ResponseContract |
20 | 20 | */ |
21 | - public function html(string $content = null, int $status = 200, array $headers = []) : ResponseContract |
|
21 | + public function html(string $content = null, int $status = 200, array $headers = [ ]) : ResponseContract |
|
22 | 22 | { |
23 | 23 | if (!$content) { |
24 | 24 | return $this->emptyResponse($status, $headers); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return ResponseContract |
38 | 38 | */ |
39 | - public function make($content = '', int $status = 200, array $headers = []) : ResponseContract |
|
39 | + public function make($content = '', int $status = 200, array $headers = [ ]) : ResponseContract |
|
40 | 40 | { |
41 | 41 | if ($content instanceof ResponseContract) { |
42 | 42 | return $content; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return ResponseContract |
59 | 59 | */ |
60 | - public function json($content = [], int $status = 200, array $headers = [], int $option = 79) : ResponseContract |
|
60 | + public function json($content = [ ], int $status = 200, array $headers = [ ], int $option = 79) : ResponseContract |
|
61 | 61 | { |
62 | 62 | if ($content instanceof Arrayable) { |
63 | 63 | $content = $content->toArray(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return ResponseContract |
76 | 76 | */ |
77 | - private function emptyResponse(int $status = 200, array $headers = []) : ResponseContract |
|
77 | + private function emptyResponse(int $status = 200, array $headers = [ ]) : ResponseContract |
|
78 | 78 | { |
79 | 79 | return new Response( |
80 | 80 | new EmptyResponse($status, $headers) |