@@ -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\console\command; |
14 | 14 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $port = $input->getOption('port'); |
38 | 38 | $root = $input->getOption('root'); |
39 | 39 | if (empty($root)) { |
40 | - $root = $this->app->getRootPath() . 'public'; |
|
40 | + $root = $this->app->getRootPath().'public'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $command = sprintf( |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $host, |
46 | 46 | $port, |
47 | 47 | escapeshellarg($root), |
48 | - escapeshellarg($root . DIRECTORY_SEPARATOR . 'router.php') |
|
48 | + escapeshellarg($root.DIRECTORY_SEPARATOR.'router.php') |
|
49 | 49 | ); |
50 | 50 | |
51 | 51 | $output->writeln(sprintf('ThinkPHP Development server is started On <http://%s:%s/>', '0.0.0.0' == $host ? '127.0.0.1' : $host, $port)); |
@@ -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 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function getEnv(string $name, $default = null) |
69 | 69 | { |
70 | - $result = getenv('PHP_' . $name); |
|
70 | + $result = getenv('PHP_'.$name); |
|
71 | 71 | |
72 | 72 | if (false === $result) { |
73 | 73 | return $default; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | foreach ($env as $key => $val) { |
102 | 102 | if (is_array($val)) { |
103 | 103 | foreach ($val as $k => $v) { |
104 | - $this->data[$key . '_' . strtoupper($k)] = $v; |
|
104 | + $this->data[$key.'_'.strtoupper($k)] = $v; |
|
105 | 105 | } |
106 | 106 | } else { |
107 | 107 | $this->data[$key] = $val; |
@@ -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 | |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | $this->ruleName = new RuleName(); |
161 | 161 | $this->setDefaultDomain(); |
162 | 162 | |
163 | - if (is_file($this->app->getRuntimePath() . 'route.php')) { |
|
163 | + if (is_file($this->app->getRuntimePath().'route.php')) { |
|
164 | 164 | // 读取路由映射文件 |
165 | - $this->import(include $this->app->getRuntimePath() . 'route.php'); |
|
165 | + $this->import(include $this->app->getRuntimePath().'route.php'); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -392,14 +392,14 @@ discard block |
||
392 | 392 | if (is_null($domain)) { |
393 | 393 | $domain = $this->host; |
394 | 394 | } elseif (false === strpos($domain, '.') && $this->request) { |
395 | - $domain .= '.' . $this->request->rootDomain(); |
|
395 | + $domain .= '.'.$this->request->rootDomain(); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | if ($this->request) { |
399 | 399 | $subDomain = $this->request->subDomain(); |
400 | 400 | |
401 | 401 | if (strpos($subDomain, '.')) { |
402 | - $name = '*' . strstr($subDomain, '.'); |
|
402 | + $name = '*'.strstr($subDomain, '.'); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | |
744 | 744 | return $this->app->middleware->pipeline('route') |
745 | 745 | ->send($request) |
746 | - ->then(function () use ($dispatch) { |
|
746 | + ->then(function() use ($dispatch) { |
|
747 | 747 | return $dispatch->run(); |
748 | 748 | }); |
749 | 749 | } |
@@ -792,10 +792,10 @@ discard block |
||
792 | 792 | $path = $pathinfo; |
793 | 793 | } elseif ($suffix) { |
794 | 794 | // 去除正常的URL后缀 |
795 | - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); |
|
795 | + $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo); |
|
796 | 796 | } else { |
797 | 797 | // 允许任何后缀访问 |
798 | - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); |
|
798 | + $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo); |
|
799 | 799 | } |
800 | 800 | |
801 | 801 | return $path; |
@@ -838,9 +838,9 @@ discard block |
||
838 | 838 | $item = $this->domains[$this->host]; |
839 | 839 | } elseif (isset($this->domains[$subDomain])) { |
840 | 840 | $item = $this->domains[$subDomain]; |
841 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
841 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
842 | 842 | // 泛三级域名 |
843 | - $item = $this->domains['*.' . $domain2]; |
|
843 | + $item = $this->domains['*.'.$domain2]; |
|
844 | 844 | $panDomain = $domain3; |
845 | 845 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
846 | 846 | // 泛二级域名 |
@@ -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 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function hasScene(string $name): bool |
369 | 369 | { |
370 | - return isset($this->scene[$name]) || method_exists($this, 'scene' . $name); |
|
370 | + return isset($this->scene[$name]) || method_exists($this, 'scene'.$name); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | if (strpos($field, '_confirm')) { |
719 | 719 | $rule = strstr($field, '_confirm', true); |
720 | 720 | } else { |
721 | - $rule = $field . '_confirm'; |
|
721 | + $rule = $field.'_confirm'; |
|
722 | 722 | } |
723 | 723 | } |
724 | 724 | |
@@ -869,9 +869,9 @@ discard block |
||
869 | 869 | if (isset($this->type[$rule])) { |
870 | 870 | // 注册的验证规则 |
871 | 871 | $result = call_user_func_array($this->type[$rule], [$value]); |
872 | - } elseif (function_exists('ctype_' . $rule)) { |
|
872 | + } elseif (function_exists('ctype_'.$rule)) { |
|
873 | 873 | // ctype验证规则 |
874 | - $ctypeFun = 'ctype_' . $rule; |
|
874 | + $ctypeFun = 'ctype_'.$rule; |
|
875 | 875 | $result = $ctypeFun($value); |
876 | 876 | } elseif (isset($this->filter[$rule])) { |
877 | 877 | // Filter_var验证规则 |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | |
1510 | 1510 | if (is_string($rule) && 0 !== strpos($rule, '/') && !preg_match('/\/[imsU]{0,4}$/', $rule)) { |
1511 | 1511 | // 不是正则表达式则两端补上/ |
1512 | - $rule = '/^' . $rule . '$/'; |
|
1512 | + $rule = '/^'.$rule.'$/'; |
|
1513 | 1513 | } |
1514 | 1514 | |
1515 | 1515 | return is_scalar($value) && 1 === preg_match($rule, (string) $value); |
@@ -1562,8 +1562,8 @@ discard block |
||
1562 | 1562 | */ |
1563 | 1563 | protected function getRuleMsg(string $attribute, string $title, string $type, $rule) |
1564 | 1564 | { |
1565 | - if (isset($this->message[$attribute . '.' . $type])) { |
|
1566 | - $msg = $this->message[$attribute . '.' . $type]; |
|
1565 | + if (isset($this->message[$attribute.'.'.$type])) { |
|
1566 | + $msg = $this->message[$attribute.'.'.$type]; |
|
1567 | 1567 | } elseif (isset($this->message[$attribute][$type])) { |
1568 | 1568 | $msg = $this->message[$attribute][$type]; |
1569 | 1569 | } elseif (isset($this->message[$attribute])) { |
@@ -1573,7 +1573,7 @@ discard block |
||
1573 | 1573 | } elseif (0 === strpos($type, 'require')) { |
1574 | 1574 | $msg = $this->typeMsg['require']; |
1575 | 1575 | } else { |
1576 | - $msg = $title . $this->lang->get('not conform to the rules'); |
|
1576 | + $msg = $title.$this->lang->get('not conform to the rules'); |
|
1577 | 1577 | } |
1578 | 1578 | |
1579 | 1579 | if (is_array($msg)) { |
@@ -1653,8 +1653,8 @@ discard block |
||
1653 | 1653 | { |
1654 | 1654 | $this->only = $this->append = $this->remove = []; |
1655 | 1655 | |
1656 | - if (method_exists($this, 'scene' . $scene)) { |
|
1657 | - call_user_func([$this, 'scene' . $scene]); |
|
1656 | + if (method_exists($this, 'scene'.$scene)) { |
|
1657 | + call_user_func([$this, 'scene'.$scene]); |
|
1658 | 1658 | } elseif (isset($this->scene[$scene])) { |
1659 | 1659 | // 如果设置了验证适用场景 |
1660 | 1660 | $this->only = $this->scene[$scene]; |
@@ -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\file; |
14 | 14 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $target = $this->getTargetFile($directory, $name); |
57 | 57 | |
58 | - set_error_handler(function ($type, $msg) use (&$error) { |
|
58 | + set_error_handler(function($type, $msg) use (&$error) { |
|
59 | 59 | $error = $msg; |
60 | 60 | }); |
61 | 61 |
@@ -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; |
14 | 14 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | protected function resolveClass(string $type): string |
94 | 94 | { |
95 | 95 | if ($this->namespace || false !== strpos($type, '\\')) { |
96 | - $class = false !== strpos($type, '\\') ? $type : $this->namespace . Str::studly($type); |
|
96 | + $class = false !== strpos($type, '\\') ? $type : $this->namespace.Str::studly($type); |
|
97 | 97 | |
98 | 98 | if (class_exists($class)) { |
99 | 99 | return $class; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $type = $this->resolveType($name); |
127 | 127 | |
128 | - $method = 'create' . Str::studly($type) . 'Driver'; |
|
128 | + $method = 'create'.Str::studly($type).'Driver'; |
|
129 | 129 | |
130 | 130 | $params = $this->resolveParams($name); |
131 | 131 |
@@ -8,7 +8,7 @@ |
||
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 |
@@ -8,7 +8,7 @@ |
||
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\filesystem; |
14 | 14 |
@@ -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\filesystem; |
14 | 14 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function putFileAs(string $path, File $file, string $name, array $options = []) |
116 | 116 | { |
117 | 117 | $stream = fopen($file->getRealPath(), 'r'); |
118 | - $path = trim($path . '/' . $name, '/'); |
|
118 | + $path = trim($path.'/'.$name, '/'); |
|
119 | 119 | |
120 | 120 | $result = $this->putStream($path, $stream, $options); |
121 | 121 |