@@ -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])) { |
@@ -741,9 +741,9 @@ discard block |
||
741 | 741 | |
742 | 742 | return $this->app->middleware->pipeline() |
743 | 743 | ->send($request) |
744 | - ->then(function ($request) use ($withRoute) { |
|
744 | + ->then(function($request) use ($withRoute) { |
|
745 | 745 | if ($withRoute) { |
746 | - $checkCallback = function () use ($withRoute) { |
|
746 | + $checkCallback = function() use ($withRoute) { |
|
747 | 747 | //加载路由 |
748 | 748 | $withRoute(); |
749 | 749 | return $this->check(); |
@@ -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 | // 泛二级域名 |
@@ -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\exception; |
14 | 14 | |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | 'code' => $this->getCode($exception), |
70 | 70 | 'message' => $this->getMessage($exception), |
71 | 71 | ]; |
72 | - $log = "[{$data['code']}]{$data['message']}"; |
|
72 | + $log = "[{$data['code']}]{$data['message']}"; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($this->app->config->get('log.record_trace')) { |
76 | - $log .= PHP_EOL . $exception->getTraceAsString(); |
|
76 | + $log .= PHP_EOL.$exception->getTraceAsString(); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $this->app->log->record($log, 'error'); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ob_start(); |
214 | 214 | $data = $this->convertExceptionToArray($exception); |
215 | 215 | extract($data); |
216 | - include $this->app->config->get('app.exception_tmpl') ?: __DIR__ . '/../../tpl/think_exception.tpl'; |
|
216 | + include $this->app->config->get('app.exception_tmpl') ?: __DIR__.'/../../tpl/think_exception.tpl'; |
|
217 | 217 | |
218 | 218 | return ob_get_clean(); |
219 | 219 | } |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | |
256 | 256 | if (strpos($message, ':')) { |
257 | 257 | $name = strstr($message, ':', true); |
258 | - $message = $lang->has($name) ? $lang->get($name) . strstr($message, ':') : $message; |
|
258 | + $message = $lang->has($name) ? $lang->get($name).strstr($message, ':') : $message; |
|
259 | 259 | } elseif (strpos($message, ',')) { |
260 | 260 | $name = strstr($message, ',', true); |
261 | - $message = $lang->has($name) ? $lang->get($name) . ':' . substr(strstr($message, ','), 1) : $message; |
|
261 | + $message = $lang->has($name) ? $lang->get($name).':'.substr(strstr($message, ','), 1) : $message; |
|
262 | 262 | } elseif ($lang->has($message)) { |
263 | 263 | $message = $lang->get($message); |
264 | 264 | } |