Passed
Pull Request — 5.1 (#2217)
by
unknown
13:33
created
library/think/route/RuleName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
                     $val['domain'] = $ruleDomain;
74 74
 
75 75
                     foreach (['method', 'rule', 'name', 'route', 'pattern', 'option'] as $param) {
76
-                        $call        = 'get' . $param;
76
+                        $call        = 'get'.$param;
77 77
                         $val[$param] = $item->$call();
78 78
                     }
79 79
 
Please login to merge, or discard this patch.
library/think/route/dispatch/Module.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                     $module = $bindModule;
47 47
                 }
48 48
                 $available = true;
49
-            } elseif (!in_array($module, $this->rule->getConfig('deny_module_list')) && is_dir($this->app->getAppPath() . $module)) {
49
+            } elseif (!in_array($module, $this->rule->getConfig('deny_module_list')) && is_dir($this->app->getAppPath().$module)) {
50 50
                 $available = true;
51 51
             } elseif ($this->rule->getConfig('empty_module')) {
52 52
                 $module    = $this->rule->getConfig('empty_module');
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 $this->request->setModule($module);
60 60
                 $this->app->init($module);
61 61
             } else {
62
-                throw new HttpException(404, 'module not exists:' . $module);
62
+                throw new HttpException(404, 'module not exists:'.$module);
63 63
             }
64 64
         }
65 65
 
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
                 $this->rule->getConfig('controller_suffix'),
94 94
                 $this->rule->getConfig('empty_controller'));
95 95
         } catch (ClassNotFoundException $e) {
96
-            throw new HttpException(404, 'controller not exists:' . $e->getClass());
96
+            throw new HttpException(404, 'controller not exists:'.$e->getClass());
97 97
         }
98 98
 
99
-        $this->app['middleware']->controller(function (Request $request, $next) use ($instance) {
99
+        $this->app['middleware']->controller(function(Request $request, $next) use ($instance) {
100 100
             // 获取当前操作名
101
-            $action = $this->actionName . $this->rule->getConfig('action_suffix');
101
+            $action = $this->actionName.$this->rule->getConfig('action_suffix');
102 102
 
103 103
             if (is_callable([$instance, $action])) {
104 104
                 // 执行操作方法
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 $reflect = new ReflectionMethod($instance, '_empty');
124 124
             } else {
125 125
                 // 操作不存在
126
-                throw new HttpException(404, 'method not exists:' . get_class($instance) . '->' . $action . '()');
126
+                throw new HttpException(404, 'method not exists:'.get_class($instance).'->'.$action.'()');
127 127
             }
128 128
 
129 129
             $this->app['hook']->listen('action_begin', $call);
Please login to merge, or discard this patch.
library/think/route/Rule.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
     {
727 727
         if (is_string($route) && isset($option['prefix'])) {
728 728
             // 路由地址前缀
729
-            $route = $option['prefix'] . $route;
729
+            $route = $option['prefix'].$route;
730 730
         }
731 731
 
732 732
         // 替换路由地址中的变量
@@ -734,10 +734,10 @@  discard block
 block discarded – undo
734 734
             $search = $replace = [];
735 735
 
736 736
             foreach ($matches as $key => $value) {
737
-                $search[]  = '<' . $key . '>';
737
+                $search[]  = '<'.$key.'>';
738 738
                 $replace[] = $value;
739 739
 
740
-                $search[]  = ':' . $key;
740
+                $search[]  = ':'.$key;
741 741
                 $replace[] = $value;
742 742
             }
743 743
 
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
         if ($this->getConfig('use_action_prefix') && $this->router->getMethodPrefix($method)) {
867 867
             $prefix = $this->router->getMethodPrefix($method);
868 868
             // 操作方法前缀支持
869
-            $action = 0 !== strpos($action, $prefix) ? $prefix . $action : $action;
869
+            $action = 0 !== strpos($action, $prefix) ? $prefix.$action : $action;
870 870
         }
871 871
 
872 872
         // 设置当前请求的路由变量
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
         // AJAX PJAX 请求检查
896 896
         foreach (['ajax', 'pjax', 'mobile'] as $item) {
897 897
             if (isset($option[$item])) {
898
-                $call = 'is' . $item;
898
+                $call = 'is'.$item;
899 899
                 if ($option[$item] && !$request->$call() || !$option[$item] && $request->$call()) {
900 900
                     return false;
901 901
                 }
@@ -903,8 +903,8 @@  discard block
 block discarded – undo
903 903
         }
904 904
 
905 905
         // 伪静态后缀检测
906
-        if ($request->url() != '/' && ((isset($option['ext']) && false === stripos('|' . $option['ext'] . '|', '|' . $request->ext() . '|'))
907
-            || (isset($option['deny_ext']) && false !== stripos('|' . $option['deny_ext'] . '|', '|' . $request->ext() . '|')))) {
906
+        if ($request->url() != '/' && ((isset($option['ext']) && false === stripos('|'.$option['ext'].'|', '|'.$request->ext().'|'))
907
+            || (isset($option['deny_ext']) && false !== stripos('|'.$option['deny_ext'].'|', '|'.$request->ext().'|')))) {
908 908
             return false;
909 909
         }
910 910
 
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
             if ($this->getConfig('url_param_type')) {
945 945
                 $var += explode('|', $url);
946 946
             } else {
947
-                preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) {
947
+                preg_replace_callback('/(\w+)\|([^\|]+)/', function($match) use (&$var) {
948 948
                     $var[$match[1]] = strip_tags($match[2]);
949 949
                 }, $url);
950 950
             }
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
             $regex .= '\/';
1018 1018
         }
1019 1019
 
1020
-        return $regex . ($completeMatch ? '$' : '');
1020
+        return $regex.($completeMatch ? '$' : '');
1021 1021
     }
1022 1022
 
1023 1023
     /**
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
         $slash    = substr($name, 0, 1);
1035 1035
 
1036 1036
         if (in_array($slash, ['/', '-'])) {
1037
-            $prefix = '\\' . $slash;
1037
+            $prefix = '\\'.$slash;
1038 1038
             $name   = substr($name, 1);
1039 1039
             $slash  = substr($name, 0, 1);
1040 1040
         } else {
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
         }
1043 1043
 
1044 1044
         if ('<' != $slash) {
1045
-            return $prefix . preg_quote($name, '/');
1045
+            return $prefix.preg_quote($name, '/');
1046 1046
         }
1047 1047
 
1048 1048
         if (strpos($name, '?')) {
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
             $nameRule = $this->getConfig('default_route_pattern');
1062 1062
         }
1063 1063
 
1064
-        return '(' . $prefix . '(?<' . $name . $suffix . '>' . $nameRule . '))' . $optional;
1064
+        return '('.$prefix.'(?<'.$name.$suffix.'>'.$nameRule.'))'.$optional;
1065 1065
     }
1066 1066
 
1067 1067
     /**
Please login to merge, or discard this patch.
library/think/route/Dispatch.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
         // 指定Header数据
121 121
         if (!empty($option['header'])) {
122 122
             $header = $option['header'];
123
-            $this->app['hook']->add('response_send', function ($response) use ($header) {
123
+            $this->app['hook']->add('response_send', function($response) use ($header) {
124 124
                 $response->header($header);
125 125
             });
126 126
         }
Please login to merge, or discard this patch.
library/think/route/Domain.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             $this->parseBindAppendParam($bind);
120 120
 
121 121
             // 记录绑定信息
122
-            Container::get('app')->log('[ BIND ] ' . var_export($bind, true));
122
+            Container::get('app')->log('[ BIND ] '.var_export($bind, true));
123 123
 
124 124
             // 如果有URL绑定 则进行绑定检测
125 125
             $type = substr($bind, 0, 1);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $this->parseUrlParams($request, $array[2], $param);
189 189
         }
190 190
 
191
-        return new CallbackDispatch($request, $this, [$namespace . '\\' . Loader::parseName($class, 1), $method], $param);
191
+        return new CallbackDispatch($request, $this, [$namespace.'\\'.Loader::parseName($class, 1), $method], $param);
192 192
     }
193 193
 
194 194
     /**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $this->parseUrlParams($request, $array[1], $param);
210 210
         }
211 211
 
212
-        return new ControllerDispatch($request, $this, $controller . '/' . $action, $param);
212
+        return new ControllerDispatch($request, $this, $controller.'/'.$action, $param);
213 213
     }
214 214
 
215 215
     /**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $this->parseUrlParams($request, $array[1], $param);
231 231
         }
232 232
 
233
-        return new ModuleDispatch($request, $this, $controller . '/' . $action, $param);
233
+        return new ModuleDispatch($request, $this, $controller.'/'.$action, $param);
234 234
     }
235 235
 
236 236
 }
Please login to merge, or discard this patch.
library/think/console/output/question/Choice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         $multiselect  = $this->multiselect;
109 109
         $isAssoc      = $this->isAssoc($choices);
110 110
 
111
-        return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) {
111
+        return function($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) {
112 112
             // Collapse all spaces.
113 113
             $selectedChoices = str_replace(' ', '', $selected);
114 114
 
Please login to merge, or discard this patch.
library/think/console/output/question/Confirmation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         $default = $this->getDefault();
42 42
         $regex   = $this->trueAnswerRegex;
43 43
 
44
-        return function ($answer) use ($default, $regex) {
44
+        return function($answer) use ($default, $regex) {
45 45
             if (is_bool($answer)) {
46 46
                 return $answer;
47 47
             }
Please login to merge, or discard this patch.
library/think/console/output/driver/Console.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             proc_close($process);
232 232
 
233 233
             if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
234
-                return $matches[2] . 'x' . $matches[1];
234
+                return $matches[2].'x'.$matches[1];
235 235
             }
236 236
         }
237 237
         return;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $lines      = [];
265 265
         $line       = '';
266 266
         foreach (preg_split('//u', $utf8String) as $char) {
267
-            if (mb_strwidth($line . $char, 'utf8') <= $width) {
267
+            if (mb_strwidth($line.$char, 'utf8') <= $width) {
268 268
                 $line .= $char;
269 269
                 continue;
270 270
             }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         if (null === $stream) {
341 341
             $stream = $this->stdout;
342 342
         }
343
-        if (false === @fwrite($stream, $message . ($newline ? PHP_EOL : ''))) {
343
+        if (false === @fwrite($stream, $message.($newline ? PHP_EOL : ''))) {
344 344
             throw new \RuntimeException('Unable to write output.');
345 345
         }
346 346
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     {
357 357
         if (DIRECTORY_SEPARATOR === '\\') {
358 358
             return
359
-            '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD
359
+            '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
360 360
             || false !== getenv('ANSICON')
361 361
             || 'ON' === getenv('ConEmuANSI')
362 362
             || 'xterm' === getenv('TERM');
Please login to merge, or discard this patch.
library/think/console/output/Ask.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
         $that = $this;
52 52
 
53
-        $interviewer = function () use ($that) {
53
+        $interviewer = function() use ($that) {
54 54
             return $that->doAsk();
55 55
         };
56 56
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     protected function getHiddenResponse($inputStream)
193 193
     {
194 194
         if ('\\' === DIRECTORY_SEPARATOR) {
195
-            $exe = __DIR__ . '/../bin/hiddeninput.exe';
195
+            $exe = __DIR__.'/../bin/hiddeninput.exe';
196 196
 
197 197
             $value = rtrim(shell_exec($exe));
198 198
             $this->output->writeln('');
Please login to merge, or discard this patch.