@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // +---------------------------------------------------------------------- |
| 9 | 9 | // | Author: Slince <[email protected]> |
| 10 | 10 | // +---------------------------------------------------------------------- |
| 11 | -declare (strict_types = 1); |
|
| 11 | +declare(strict_types=1); |
|
| 12 | 12 | |
| 13 | 13 | namespace think; |
| 14 | 14 | |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | public function pipeline(string $type = 'route') |
| 118 | 118 | { |
| 119 | 119 | return (new Pipeline()) |
| 120 | - ->through(array_map(function ($middleware) { |
|
| 121 | - return function ($request, $next) use ($middleware) { |
|
| 120 | + ->through(array_map(function($middleware) { |
|
| 121 | + return function($request, $next) use ($middleware) { |
|
| 122 | 122 | list($call, $param) = $middleware; |
| 123 | 123 | if (is_array($call) && is_string($call[0])) { |
| 124 | 124 | $call = [$this->app->make($call[0]), $call[1]]; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | foreach ($this->queue as $queue) { |
| 144 | 144 | foreach ($queue as $middleware) { |
| 145 | - list($call, ) = $middleware; |
|
| 145 | + list($call,) = $middleware; |
|
| 146 | 146 | if (is_array($call) && is_string($call[0])) { |
| 147 | 147 | $instance = $this->app->make($call[0]); |
| 148 | 148 | if (method_exists($instance, 'end')) { |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | protected function sortMiddleware(array $middlewares) |
| 216 | 216 | { |
| 217 | 217 | $priority = $this->app->config->get('middleware.priority', []); |
| 218 | - uasort($middlewares, function ($a, $b) use ($priority) { |
|
| 218 | + uasort($middlewares, function($a, $b) use ($priority) { |
|
| 219 | 219 | $aPriority = $this->getMiddlewarePriority($priority, $a); |
| 220 | 220 | $bPriority = $this->getMiddlewarePriority($priority, $b); |
| 221 | 221 | return $bPriority - $aPriority; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | protected function getMiddlewarePriority($priority, $middleware) |
| 234 | 234 | { |
| 235 | - list($call, ) = $middleware; |
|
| 235 | + list($call,) = $middleware; |
|
| 236 | 236 | if (is_array($call) && is_string($call[0])) { |
| 237 | 237 | $index = array_search($call[0], array_reverse($priority)); |
| 238 | 238 | return $index === false ? -1 : $index; |