@@ -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 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | public function pipeline(string $type = 'global') |
129 | 129 | { |
130 | 130 | return (new Pipeline()) |
131 | - ->through(array_map(function ($middleware) { |
|
132 | - return function ($request, $next) use ($middleware) { |
|
131 | + ->through(array_map(function($middleware) { |
|
132 | + return function($request, $next) use ($middleware) { |
|
133 | 133 | list($call, $param) = $middleware; |
134 | 134 | if (is_array($call) && is_string($call[0])) { |
135 | 135 | $call = [$this->app->make($call[0]), $call[1]]; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | protected function sortMiddleware(array $middlewares) |
227 | 227 | { |
228 | 228 | $priority = $this->app->config->get('middleware.priority', []); |
229 | - uasort($middlewares, function ($a, $b) use ($priority) { |
|
229 | + uasort($middlewares, function($a, $b) use ($priority) { |
|
230 | 230 | $aPriority = $this->getMiddlewarePriority($priority, $a); |
231 | 231 | $bPriority = $this->getMiddlewarePriority($priority, $b); |
232 | 232 | return $bPriority - $aPriority; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\route\dispatch; |
14 | 14 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($bind && preg_match('/^[a-z]/is', $bind)) { |
48 | 48 | $bind = str_replace('/', $depr, $bind); |
49 | 49 | // 如果有域名绑定 |
50 | - $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr); |
|
50 | + $url = $bind.('.' != substr($bind, -1) ? $depr : '').ltrim($url, $depr); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $path = $this->rule->parseUrlPath($url); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $controller = !empty($path) ? array_shift($path) : null; |
60 | 60 | |
61 | 61 | if ($controller && !preg_match('/^[A-Za-z][\w|\.]*$/', $controller)) { |
62 | - throw new HttpException(404, 'controller not exists:' . $controller); |
|
62 | + throw new HttpException(404, 'controller not exists:'.$controller); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // 解析操作 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | // 解析额外参数 |
70 | 70 | if ($path) { |
71 | - preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) { |
|
71 | + preg_replace_callback('/(\w+)\|([^\|]+)/', function($match) use (&$var) { |
|
72 | 72 | $var[$match[1]] = strip_tags($match[2]); |
73 | 73 | }, implode('|', $path)); |
74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $route = [$controller, $action]; |
87 | 87 | |
88 | 88 | if ($this->hasDefinedRoute($route)) { |
89 | - throw new HttpException(404, 'invalid request:' . str_replace('|', $depr, $url)); |
|
89 | + throw new HttpException(404, 'invalid request:'.str_replace('|', $depr, $url)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $route; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | list($controller, $action) = $route; |
104 | 104 | |
105 | 105 | // 检查地址是否被定义过路由 |
106 | - $name = strtolower(Str::studly($controller) . '/' . $action); |
|
106 | + $name = strtolower(Str::studly($controller).'/'.$action); |
|
107 | 107 | |
108 | 108 | $host = $this->request->host(true); |
109 | 109 | $method = $this->request->method(); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | $this->ruleName = new RuleName(); |
171 | 171 | $this->setDefaultDomain(); |
172 | 172 | |
173 | - if (is_file($this->app->getRuntimePath() . 'route.php')) { |
|
173 | + if (is_file($this->app->getRuntimePath().'route.php')) { |
|
174 | 174 | // 读取路由映射文件 |
175 | - $this->import(include $this->app->getRuntimePath() . 'route.php'); |
|
175 | + $this->import(include $this->app->getRuntimePath().'route.php'); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
@@ -402,13 +402,13 @@ discard block |
||
402 | 402 | if (is_null($domain)) { |
403 | 403 | $domain = $this->host; |
404 | 404 | } elseif (false === strpos($domain, '.')) { |
405 | - $domain .= '.' . $this->request->rootDomain(); |
|
405 | + $domain .= '.'.$this->request->rootDomain(); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | $subDomain = $this->request->subDomain(); |
409 | 409 | |
410 | 410 | if (strpos($subDomain, '.')) { |
411 | - $name = '*' . strstr($subDomain, '.'); |
|
411 | + $name = '*'.strstr($subDomain, '.'); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | if (isset($this->bind[$domain])) { |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | $this->init(); |
741 | 741 | |
742 | 742 | if ($withRoute) { |
743 | - $checkCallback = function () use ($withRoute) { |
|
743 | + $checkCallback = function() use ($withRoute) { |
|
744 | 744 | //加载路由 |
745 | 745 | $withRoute(); |
746 | 746 | return $this->check(); |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | |
762 | 762 | return $this->app->middleware->pipeline('route') |
763 | 763 | ->send($request) |
764 | - ->then(function () use ($dispatch) { |
|
764 | + ->then(function() use ($dispatch) { |
|
765 | 765 | return $dispatch->run(); |
766 | 766 | }); |
767 | 767 | } |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $closure = $this->config['route_check_cache_key']; |
779 | 779 | $routeKey = $closure($request); |
780 | 780 | } else { |
781 | - $routeKey = md5($request->baseUrl(true) . ':' . $request->method()); |
|
781 | + $routeKey = md5($request->baseUrl(true).':'.$request->method()); |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | return $routeKey; |
@@ -828,10 +828,10 @@ discard block |
||
828 | 828 | $path = $pathinfo; |
829 | 829 | } elseif ($suffix) { |
830 | 830 | // 去除正常的URL后缀 |
831 | - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); |
|
831 | + $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo); |
|
832 | 832 | } else { |
833 | 833 | // 允许任何后缀访问 |
834 | - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); |
|
834 | + $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo); |
|
835 | 835 | } |
836 | 836 | |
837 | 837 | return $path; |
@@ -874,9 +874,9 @@ discard block |
||
874 | 874 | $item = $this->domains[$this->host]; |
875 | 875 | } elseif (isset($this->domains[$subDomain])) { |
876 | 876 | $item = $this->domains[$subDomain]; |
877 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
877 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
878 | 878 | // 泛三级域名 |
879 | - $item = $this->domains['*.' . $domain2]; |
|
879 | + $item = $this->domains['*.'.$domain2]; |
|
880 | 880 | $panDomain = $domain3; |
881 | 881 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
882 | 882 | // 泛二级域名 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $route = m::mock(Route::class); |
49 | 49 | |
50 | - $route->shouldReceive('dispatch')->withArgs(function ($req, $withRoute) use ($request) { |
|
50 | + $route->shouldReceive('dispatch')->withArgs(function($req, $withRoute) use ($request) { |
|
51 | 51 | if ($withRoute) { |
52 | 52 | $withRoute(); |
53 | 53 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | ], |
78 | 78 | ]); |
79 | 79 | |
80 | - $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url() . DIRECTORY_SEPARATOR); |
|
81 | - $this->app->shouldReceive('getRootPath')->andReturn($root->url() . DIRECTORY_SEPARATOR); |
|
80 | + $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url().DIRECTORY_SEPARATOR); |
|
81 | + $this->app->shouldReceive('getRootPath')->andReturn($root->url().DIRECTORY_SEPARATOR); |
|
82 | 82 | |
83 | 83 | $request = m::mock(Request::class)->makePartial(); |
84 | 84 | $response = m::mock(Response::class)->makePartial(); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->app = $app; |
54 | 54 | |
55 | - $this->routePath = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR; |
|
55 | + $this->routePath = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | |
200 | 200 | return $this->app->middleware->pipeline() |
201 | 201 | ->send($request) |
202 | - ->then(function ($request) { |
|
202 | + ->then(function($request) { |
|
203 | 203 | return $this->dispatchToRoute($request); |
204 | 204 | }); |
205 | 205 | } |
206 | 206 | |
207 | 207 | protected function dispatchToRoute($request) |
208 | 208 | { |
209 | - $withRoute = $this->app->config->get('app.with_route', true) ? function () { |
|
209 | + $withRoute = $this->app->config->get('app.with_route', true) ? function() { |
|
210 | 210 | $this->loadRoutes(); |
211 | 211 | } : null; |
212 | 212 | |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | */ |
219 | 219 | protected function loadMiddleware(): void |
220 | 220 | { |
221 | - if (is_file($this->app->getBasePath() . 'middleware.php')) { |
|
222 | - $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php'); |
|
221 | + if (is_file($this->app->getBasePath().'middleware.php')) { |
|
222 | + $this->app->middleware->import(include $this->app->getBasePath().'middleware.php'); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $routePath = $this->getRoutePath(); |
235 | 235 | |
236 | 236 | if (is_dir($routePath)) { |
237 | - $files = glob($routePath . '*.php'); |
|
237 | + $files = glob($routePath.'*.php'); |
|
238 | 238 | foreach ($files as $file) { |
239 | 239 | include $file; |
240 | 240 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\route; |
14 | 14 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | } elseif (false === strpos($domain, '.') && 0 !== strpos($domain, $rootDomain)) { |
193 | - $domain .= '.' . $rootDomain; |
|
193 | + $domain .= '.'.$rootDomain; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if (false !== strpos($domain, '://')) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $scheme = $this->https || $request->isSsl() ? 'https://' : 'http://'; |
200 | 200 | } |
201 | 201 | |
202 | - return $scheme . $domain; |
|
202 | + return $scheme.$domain; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
221 | - return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.' . $suffix; |
|
221 | + return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.'.$suffix; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | { |
288 | 288 | $request = $this->app->request; |
289 | 289 | if (is_string($allowDomain) && false === strpos($allowDomain, '.')) { |
290 | - $allowDomain .= '.' . $request->rootDomain(); |
|
290 | + $allowDomain .= '.'.$request->rootDomain(); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | foreach ($rule as $item) { |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | if (!in_array($request->port(), [80, 443])) { |
308 | - $domain .= ':' . $request->port(); |
|
308 | + $domain .= ':'.$request->port(); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | if (empty($pattern)) { |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | |
317 | 317 | foreach ($pattern as $key => $val) { |
318 | 318 | if (isset($vars[$key])) { |
319 | - $url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key, '<' . $key . '>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url); |
|
319 | + $url = str_replace(['[:'.$key.']', '<'.$key.'?>', ':'.$key, '<'.$key.'>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url); |
|
320 | 320 | unset($vars[$key]); |
321 | 321 | $url = str_replace(['/?', '-?'], ['/', '-'], $url); |
322 | 322 | $result = [rtrim($url, '?/-'), $domain, $suffix]; |
323 | 323 | } elseif (2 == $val) { |
324 | - $url = str_replace(['/[:' . $key . ']', '[:' . $key . ']', '<' . $key . '?>'], '', $url); |
|
324 | + $url = str_replace(['/[:'.$key.']', '[:'.$key.']', '<'.$key.'?>'], '', $url); |
|
325 | 325 | $url = str_replace(['/?', '-?'], ['/', '-'], $url); |
326 | 326 | $result = [rtrim($url, '?/-'), $domain, $suffix]; |
327 | 327 | } else { |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | if (0 === strpos($url, '[') && $pos = strpos($url, ']')) { |
350 | 350 | // [name] 表示使用路由命名标识生成URL |
351 | 351 | $name = substr($url, 1, $pos - 1); |
352 | - $url = 'name' . substr($url, $pos + 1); |
|
352 | + $url = 'name'.substr($url, $pos + 1); |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | if (false === strpos($url, '://') && 0 !== strpos($url, '/')) { |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | if ($url) { |
379 | - $checkName = isset($name) ? $name : $url . (isset($info['query']) ? '?' . $info['query'] : ''); |
|
379 | + $checkName = isset($name) ? $name : $url.(isset($info['query']) ? '?'.$info['query'] : ''); |
|
380 | 380 | $checkDomain = $domain && is_string($domain) ? $domain : null; |
381 | 381 | |
382 | 382 | $rule = $this->route->getName($checkName, $checkDomain); |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $suffix = $match[2]; |
403 | 403 | } |
404 | 404 | } elseif (!empty($rule) && isset($name)) { |
405 | - throw new \InvalidArgumentException('route name not exists:' . $name); |
|
405 | + throw new \InvalidArgumentException('route name not exists:'.$name); |
|
406 | 406 | } else { |
407 | 407 | // 检测URL绑定 |
408 | 408 | $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | $file = str_replace('\\', '/', dirname($file)); |
441 | 441 | } |
442 | 442 | |
443 | - $url = rtrim($file, '/') . '/' . $url; |
|
443 | + $url = rtrim($file, '/').'/'.$url; |
|
444 | 444 | |
445 | 445 | // URL后缀 |
446 | 446 | if ('/' == substr($url, -1) || '' == $url) { |
@@ -450,32 +450,32 @@ discard block |
||
450 | 450 | } |
451 | 451 | |
452 | 452 | // 锚点 |
453 | - $anchor = !empty($anchor) ? '#' . $anchor : ''; |
|
453 | + $anchor = !empty($anchor) ? '#'.$anchor : ''; |
|
454 | 454 | |
455 | 455 | // 参数组装 |
456 | 456 | if (!empty($vars)) { |
457 | 457 | // 添加参数 |
458 | 458 | if ($this->route->config('url_common_param')) { |
459 | 459 | $vars = http_build_query($vars); |
460 | - $url .= $suffix . '?' . $vars . $anchor; |
|
460 | + $url .= $suffix.'?'.$vars.$anchor; |
|
461 | 461 | } else { |
462 | 462 | foreach ($vars as $var => $val) { |
463 | 463 | if ('' !== $val) { |
464 | - $url .= $depr . $var . $depr . urlencode((string) $val); |
|
464 | + $url .= $depr.$var.$depr.urlencode((string) $val); |
|
465 | 465 | } |
466 | 466 | } |
467 | 467 | |
468 | - $url .= $suffix . $anchor; |
|
468 | + $url .= $suffix.$anchor; |
|
469 | 469 | } |
470 | 470 | } else { |
471 | - $url .= $suffix . $anchor; |
|
471 | + $url .= $suffix.$anchor; |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | // 检测域名 |
475 | 475 | $domain = $this->parseDomain($url, $domain); |
476 | 476 | |
477 | 477 | // URL组装 |
478 | - return $domain . rtrim($this->root, '/') . '/' . ltrim($url, '/'); |
|
478 | + return $domain.rtrim($this->root, '/').'/'.ltrim($url, '/'); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | public function __toString() |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\console; |
14 | 14 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | ]; |
405 | 405 | $replacements = [ |
406 | 406 | $name, |
407 | - $_SERVER['PHP_SELF'] . ' ' . $name, |
|
407 | + $_SERVER['PHP_SELF'].' '.$name, |
|
408 | 408 | ]; |
409 | 409 | |
410 | 410 | return str_replace($placeholders, $replacements, $this->getHelp()); |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | { |
30 | 30 | $dir = $input->getOption('dir'); |
31 | 31 | |
32 | - $path = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : ''); |
|
32 | + $path = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.($dir ? $dir.DIRECTORY_SEPARATOR : ''); |
|
33 | 33 | |
34 | - $filename = $path . 'route.php'; |
|
34 | + $filename = $path.'route.php'; |
|
35 | 35 | if (is_file($filename)) { |
36 | 36 | unlink($filename); |
37 | 37 | } |
@@ -46,21 +46,21 @@ discard block |
||
46 | 46 | $this->app->route->lazy(false); |
47 | 47 | |
48 | 48 | // 路由检测 |
49 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : ''); |
|
49 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.($dir ? $dir.DIRECTORY_SEPARATOR : ''); |
|
50 | 50 | |
51 | 51 | $files = is_dir($path) ? scandir($path) : []; |
52 | 52 | |
53 | 53 | foreach ($files as $file) { |
54 | 54 | if (strpos($file, '.php')) { |
55 | - include $path . $file; |
|
55 | + include $path.$file; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | //触发路由载入完成事件 |
60 | 60 | $this->app->event->trigger(RouteLoaded::class); |
61 | 61 | |
62 | - $content = '<?php ' . PHP_EOL . 'return '; |
|
63 | - $content .= '\Opis\Closure\unserialize(\'' . \Opis\Closure\serialize($this->app->route->getName()) . '\');'; |
|
62 | + $content = '<?php '.PHP_EOL.'return '; |
|
63 | + $content .= '\Opis\Closure\unserialize(\''.\Opis\Closure\serialize($this->app->route->getName()).'\');'; |
|
64 | 64 | return $content; |
65 | 65 | } |
66 | 66 |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | $dir = $input->getOption('dir'); |
44 | 44 | |
45 | 45 | if ($dir) { |
46 | - $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . 'route_list.php'; |
|
46 | + $filename = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.'route_list.php'; |
|
47 | 47 | } else { |
48 | - $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'route_list.php'; |
|
48 | + $filename = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.'route_list.php'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if (is_file($filename)) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | $content = $this->getRouteList($dir); |
58 | - file_put_contents($filename, 'Route List' . PHP_EOL . $content); |
|
58 | + file_put_contents($filename, 'Route List'.PHP_EOL.$content); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | protected function getRouteList(string $dir = null): string |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | $this->app->route->clear(); |
65 | 65 | |
66 | 66 | if ($dir) { |
67 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR; |
|
67 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR; |
|
68 | 68 | } else { |
69 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR; |
|
69 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $files = is_dir($path) ? scandir($path) : []; |
73 | 73 | |
74 | 74 | foreach ($files as $file) { |
75 | 75 | if (strpos($file, '.php')) { |
76 | - include $path . $file; |
|
76 | + include $path.$file; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $sort = $this->sortBy[$sort]; |
113 | 113 | } |
114 | 114 | |
115 | - uasort($rows, function ($a, $b) use ($sort) { |
|
115 | + uasort($rows, function($a, $b) use ($sort) { |
|
116 | 116 | $itemA = $a[$sort] ?? null; |
117 | 117 | $itemB = $b[$sort] ?? null; |
118 | 118 |