Passed
Push — 6.0 ( 8c5058...70d030 )
by liu
10:35 queued 04:27
created
src/think/route/dispatch/Controller.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         if (strpos($controller, '.')) {
55 55
             $pos              = strrpos($controller, '.');
56
-            $this->controller = substr($controller, 0, $pos) . '.' . Str::studly(substr($controller, $pos + 1));
56
+            $this->controller = substr($controller, 0, $pos).'.'.Str::studly(substr($controller, $pos + 1));
57 57
         } else {
58 58
             $this->controller = Str::studly($controller);
59 59
         }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             // 实例化控制器
74 74
             $instance = $this->controller($this->controller);
75 75
         } catch (ClassNotFoundException $e) {
76
-            throw new HttpException(404, 'controller not exists:' . $e->getClass());
76
+            throw new HttpException(404, 'controller not exists:'.$e->getClass());
77 77
         }
78 78
 
79 79
         // 注册控制器中间件
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 
82 82
         return $this->app->middleware->pipeline('controller')
83 83
             ->send($this->request)
84
-            ->then(function () use ($instance) {
84
+            ->then(function() use ($instance) {
85 85
                 // 获取当前操作名
86 86
                 $suffix = $this->rule->config('action_suffix');
87
-                $action = $this->actionName . $suffix;
87
+                $action = $this->actionName.$suffix;
88 88
 
89 89
                 if (is_callable([$instance, $action])) {
90 90
                     $vars = $this->request->param();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                     }
105 105
                 } else {
106 106
                     // 操作不存在
107
-                    throw new HttpException(404, 'method not exists:' . get_class($instance) . '->' . $action . '()');
107
+                    throw new HttpException(404, 'method not exists:'.get_class($instance).'->'.$action.'()');
108 108
                 }
109 109
 
110 110
                 $data = $this->app->invokeReflectMethod($instance, $reflect, $vars);
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 
132 132
             foreach ($middlewares as $key => $val) {
133 133
                 if (!is_int($key)) {
134
-                    if (isset($val['only']) && !in_array($this->request->action(true), array_map(function ($item) {
134
+                    if (isset($val['only']) && !in_array($this->request->action(true), array_map(function($item) {
135 135
                         return strtolower($item);
136 136
                     }, is_string($val['only']) ? explode(",", $val['only']) : $val['only']))) {
137 137
                         continue;
138
-                    } elseif (isset($val['except']) && in_array($this->request->action(true), array_map(function ($item) {
138
+                    } elseif (isset($val['except']) && in_array($this->request->action(true), array_map(function($item) {
139 139
                         return strtolower($item);
140 140
                     }, is_string($val['except']) ? explode(',', $val['except']) : $val['except']))) {
141 141
                         continue;
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
         $controllerLayer = $this->rule->config('controller_layer') ?: 'controller';
168 168
         $emptyController = $this->rule->config('empty_controller') ?: 'Error';
169 169
 
170
-        $class = $this->app->parseClass($controllerLayer, $name . $suffix);
170
+        $class = $this->app->parseClass($controllerLayer, $name.$suffix);
171 171
 
172 172
         if (class_exists($class)) {
173 173
             return $this->app->make($class, [], true);
174
-        } elseif ($emptyController && class_exists($emptyClass = $this->app->parseClass($controllerLayer, $emptyController . $suffix))) {
174
+        } elseif ($emptyController && class_exists($emptyClass = $this->app->parseClass($controllerLayer, $emptyController.$suffix))) {
175 175
             return $this->app->make($emptyClass, [], true);
176 176
         }
177 177
 
178
-        throw new ClassNotFoundException('class not exists:' . $class, $class);
178
+        throw new ClassNotFoundException('class not exists:'.$class, $class);
179 179
     }
180 180
 }
Please login to merge, or discard this patch.
src/think/Middleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
     public function pipeline(string $type = 'global')
134 134
     {
135 135
         return (new Pipeline())
136
-            ->through(array_map(function ($middleware) {
137
-                return function ($request, $next) use ($middleware) {
136
+            ->through(array_map(function($middleware) {
137
+                return function($request, $next) use ($middleware) {
138 138
                     [$call, $params] = $middleware;
139 139
                     if (is_array($call) && is_string($call[0])) {
140 140
                         $call = [$this->app->make($call[0]), $call[1]];
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     protected function sortMiddleware(array $middlewares)
230 230
     {
231 231
         $priority = $this->app->config->get('middleware.priority', []);
232
-        uasort($middlewares, function ($a, $b) use ($priority) {
232
+        uasort($middlewares, function($a, $b) use ($priority) {
233 233
             $aPriority = $this->getMiddlewarePriority($priority, $a);
234 234
             $bPriority = $this->getMiddlewarePriority($priority, $b);
235 235
             return $bPriority - $aPriority;
Please login to merge, or discard this patch.
src/think/session/Store.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
      */
119 119
     public function setId($id = null): void
120 120
     {
121
-        $this->id = is_string($id) && strlen($id) === 32 && ctype_alnum($id) ? $id : md5(microtime(true) . session_create_id());
121
+        $this->id = is_string($id) && strlen($id) === 32 && ctype_alnum($id) ? $id : md5(microtime(true).session_create_id());
122 122
     }
123 123
 
124 124
     /**
Please login to merge, or discard this patch.
src/think/log/driver/Socket.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: luofei614 <weibo.com/luofei614>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\log\driver;
14 14
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             if ($this->app->exists('request')) {
93 93
                 $currentUri = $this->app->request->url(true);
94 94
             } else {
95
-                $currentUri = 'cmd:' . implode(' ', $_SERVER['argv'] ?? []);
95
+                $currentUri = 'cmd:'.implode(' ', $_SERVER['argv'] ?? []);
96 96
             }
97 97
 
98 98
             if (!empty($this->config['format_head'])) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         foreach ($log as $type => $val) {
117 117
             $trace[] = [
118 118
                 'type' => isset($expandLevel[$type]) ? 'group' : 'groupCollapsed',
119
-                'msg'  => '[ ' . $type . ' ]',
119
+                'msg'  => '[ '.$type.' ]',
120 120
                 'css'  => $this->css[$type] ?? '',
121 121
             ];
122 122
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         ];
203 203
 
204 204
         $msg     = json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR);
205
-        $address = '/' . $clientId; //将client_id作为地址, server端通过地址判断将日志发布给谁
205
+        $address = '/'.$clientId; //将client_id作为地址, server端通过地址判断将日志发布给谁
206 206
 
207 207
         $this->send($this->config['host'], $this->config['port'], $msg, $address);
208 208
     }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     protected function send($host, $port, $message = '', $address = '/')
287 287
     {
288
-        $url = 'http://' . $host . ':' . $port . $address;
288
+        $url = 'http://'.$host.':'.$port.$address;
289 289
         $ch  = curl_init();
290 290
 
291 291
         curl_setopt($ch, CURLOPT_URL, $url);
Please login to merge, or discard this patch.
src/think/App.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function __construct(string $rootPath = '')
164 164
     {
165
-        $this->thinkPath   = dirname(__DIR__) . DIRECTORY_SEPARATOR;
166
-        $this->rootPath    = $rootPath ? rtrim($rootPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $this->getDefaultRootPath();
167
-        $this->appPath     = $this->rootPath . 'app' . DIRECTORY_SEPARATOR;
168
-        $this->runtimePath = $this->rootPath . 'runtime' . DIRECTORY_SEPARATOR;
165
+        $this->thinkPath   = dirname(__DIR__).DIRECTORY_SEPARATOR;
166
+        $this->rootPath    = $rootPath ? rtrim($rootPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $this->getDefaultRootPath();
167
+        $this->appPath     = $this->rootPath.'app'.DIRECTORY_SEPARATOR;
168
+        $this->runtimePath = $this->rootPath.'runtime'.DIRECTORY_SEPARATOR;
169 169
 
170
-        if (is_file($this->appPath . 'provider.php')) {
171
-            $this->bind(include $this->appPath . 'provider.php');
170
+        if (is_file($this->appPath.'provider.php')) {
171
+            $this->bind(include $this->appPath.'provider.php');
172 172
         }
173 173
 
174 174
         static::setInstance($this);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     public function getService($service)
229 229
     {
230 230
         $name = is_string($service) ? $service : get_class($service);
231
-        return array_values(array_filter($this->services, function ($value) use ($name) {
231
+        return array_values(array_filter($this->services, function($value) use ($name) {
232 232
             return $value instanceof $name;
233 233
         }, ARRAY_FILTER_USE_BOTH))[0] ?? null;
234 234
     }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function getBasePath(): string
306 306
     {
307
-        return $this->rootPath . 'app' . DIRECTORY_SEPARATOR;
307
+        return $this->rootPath.'app'.DIRECTORY_SEPARATOR;
308 308
     }
309 309
 
310 310
     /**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
      */
363 363
     public function getConfigPath(): string
364 364
     {
365
-        return $this->rootPath . 'config' . DIRECTORY_SEPARATOR;
365
+        return $this->rootPath.'config'.DIRECTORY_SEPARATOR;
366 366
     }
367 367
 
368 368
     /**
@@ -408,8 +408,8 @@  discard block
 block discarded – undo
408 408
         $this->beginMem  = memory_get_usage();
409 409
 
410 410
         // 加载环境变量
411
-        if (is_file($this->rootPath . '.env')) {
412
-            $this->env->load($this->rootPath . '.env');
411
+        if (is_file($this->rootPath.'.env')) {
412
+            $this->env->load($this->rootPath.'.env');
413 413
         }
414 414
 
415 415
         $this->configExt = $this->env->get('config_ext', '.php');
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         // 加载框架默认语言包
423 423
         $langSet = $this->lang->defaultLangSet();
424 424
 
425
-        $this->lang->load($this->thinkPath . 'lang' . DIRECTORY_SEPARATOR . $langSet . '.php');
425
+        $this->lang->load($this->thinkPath.'lang'.DIRECTORY_SEPARATOR.$langSet.'.php');
426 426
 
427 427
         // 加载应用默认语言包
428 428
         $this->loadLangPack($langSet);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         }
462 462
 
463 463
         // 加载系统语言包
464
-        $files = glob($this->appPath . 'lang' . DIRECTORY_SEPARATOR . $langset . '.*');
464
+        $files = glob($this->appPath.'lang'.DIRECTORY_SEPARATOR.$langset.'.*');
465 465
         $this->lang->load($files);
466 466
 
467 467
         // 加载扩展(自定义)语言包
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     public function boot(): void
481 481
     {
482
-        array_walk($this->services, function ($service) {
482
+        array_walk($this->services, function($service) {
483 483
             $this->bootService($service);
484 484
         });
485 485
     }
@@ -493,30 +493,30 @@  discard block
 block discarded – undo
493 493
     {
494 494
         $appPath = $this->getAppPath();
495 495
 
496
-        if (is_file($appPath . 'common.php')) {
497
-            include_once $appPath . 'common.php';
496
+        if (is_file($appPath.'common.php')) {
497
+            include_once $appPath.'common.php';
498 498
         }
499 499
 
500
-        include_once $this->thinkPath . 'helper.php';
500
+        include_once $this->thinkPath.'helper.php';
501 501
 
502 502
         $configPath = $this->getConfigPath();
503 503
 
504 504
         $files = [];
505 505
 
506 506
         if (is_dir($configPath)) {
507
-            $files = glob($configPath . '*' . $this->configExt);
507
+            $files = glob($configPath.'*'.$this->configExt);
508 508
         }
509 509
 
510 510
         foreach ($files as $file) {
511 511
             $this->config->load($file, pathinfo($file, PATHINFO_FILENAME));
512 512
         }
513 513
 
514
-        if (is_file($appPath . 'event.php')) {
515
-            $this->loadEvent(include $appPath . 'event.php');
514
+        if (is_file($appPath.'event.php')) {
515
+            $this->loadEvent(include $appPath.'event.php');
516 516
         }
517 517
 
518
-        if (is_file($appPath . 'service.php')) {
519
-            $services = include $appPath . 'service.php';
518
+        if (is_file($appPath.'service.php')) {
519
+            $services = include $appPath.'service.php';
520 520
             foreach ($services as $service) {
521 521
                 $this->register($service);
522 522
             }
@@ -581,9 +581,9 @@  discard block
 block discarded – undo
581 581
         $name  = str_replace(['/', '.'], '\\', $name);
582 582
         $array = explode('\\', $name);
583 583
         $class = Str::studly(array_pop($array));
584
-        $path  = $array ? implode('\\', $array) . '\\' : '';
584
+        $path  = $array ? implode('\\', $array).'\\' : '';
585 585
 
586
-        return $this->namespace . '\\' . $layer . '\\' . $path . $class;
586
+        return $this->namespace.'\\'.$layer.'\\'.$path.$class;
587 587
     }
588 588
 
589 589
     /**
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
      */
603 603
     protected function getDefaultRootPath(): string
604 604
     {
605
-        return dirname($this->thinkPath, 4) . DIRECTORY_SEPARATOR;
605
+        return dirname($this->thinkPath, 4).DIRECTORY_SEPARATOR;
606 606
     }
607 607
 
608 608
 }
Please login to merge, or discard this patch.
src/think/console/command/Clear.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 
31 31
     protected function execute(Input $input, Output $output)
32 32
     {
33
-        $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR;
33
+        $runtimePath = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR;
34 34
 
35 35
         if ($input->getOption('cache')) {
36
-            $path = $runtimePath . 'cache';
36
+            $path = $runtimePath.'cache';
37 37
         } elseif ($input->getOption('log')) {
38
-            $path = $runtimePath . 'log';
38
+            $path = $runtimePath.'log';
39 39
         } else {
40 40
             $path = $input->getOption('path') ?: $runtimePath;
41 41
         }
42 42
 
43 43
         $rmdir = $input->getOption('dir') ? true : false;
44
-        $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir);
44
+        $this->clear(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, $rmdir);
45 45
 
46 46
         $output->writeln("<info>Clear Successed</info>");
47 47
     }
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
         $files = is_dir($path) ? scandir($path) : [];
52 52
 
53 53
         foreach ($files as $file) {
54
-            if ('.' != $file && '..' != $file && is_dir($path . $file)) {
55
-                $this->clear($path . $file . DIRECTORY_SEPARATOR, $rmdir);
54
+            if ('.' != $file && '..' != $file && is_dir($path.$file)) {
55
+                $this->clear($path.$file.DIRECTORY_SEPARATOR, $rmdir);
56 56
                 if ($rmdir) {
57
-                    rmdir($path . $file);
57
+                    rmdir($path.$file);
58 58
                 }
59
-            } elseif ('.gitignore' != $file && is_file($path . $file)) {
60
-                unlink($path . $file);
59
+            } elseif ('.gitignore' != $file && is_file($path.$file)) {
60
+                unlink($path.$file);
61 61
             }
62 62
         }
63 63
     }
Please login to merge, or discard this patch.
src/helper.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 //------------------------
14 14
 // ThinkPHP 助手函数
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
         $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output);
191 191
 
192 192
         if (PHP_SAPI == 'cli') {
193
-            $output = PHP_EOL . $output . PHP_EOL;
193
+            $output = PHP_EOL.$output.PHP_EOL;
194 194
         } else {
195 195
             if (!extension_loaded('xdebug')) {
196 196
                 $output = htmlspecialchars($output, ENT_SUBSTITUTE);
197 197
             }
198
-            $output = '<pre>' . $output . '</pre>';
198
+            $output = '<pre>'.$output.'</pre>';
199 199
         }
200 200
 
201 201
         echo $output;
@@ -274,8 +274,7 @@  discard block
 block discarded – undo
274 274
         }
275 275
 
276 276
         return isset($has) ?
277
-        request()->has($key, $method) :
278
-        request()->$method($key, $default, $filter);
277
+        request()->has($key, $method) : request()->$method($key, $default, $filter);
279 278
     }
280 279
 }
281 280
 
@@ -352,7 +351,7 @@  discard block
 block discarded – undo
352 351
     function parse_name(string $name, int $type = 0, bool $ucfirst = true): string
353 352
     {
354 353
         if ($type) {
355
-            $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) {
354
+            $name = preg_replace_callback('/_([a-zA-Z])/', function($match) {
356 355
                 return strtoupper($match[1]);
357 356
             }, $name);
358 357
 
@@ -453,7 +452,7 @@  discard block
 block discarded – undo
453 452
     {
454 453
         $token = Request::buildToken($name, $type);
455 454
 
456
-        return '<input type="hidden" name="' . $name . '" value="' . $token . '" />';
455
+        return '<input type="hidden" name="'.$name.'" value="'.$token.'" />';
457 456
     }
458 457
 }
459 458
 
@@ -468,7 +467,7 @@  discard block
 block discarded – undo
468 467
     {
469 468
         $token = Request::buildToken($name, $type);
470 469
 
471
-        return '<meta name="csrf-token" content="' . $token . '">';
470
+        return '<meta name="csrf-token" content="'.$token.'">';
472 471
     }
473 472
 }
474 473
 
@@ -593,7 +592,7 @@  discard block
 block discarded – undo
593 592
      */
594 593
     function app_path($path = '')
595 594
     {
596
-        return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
595
+        return app()->getAppPath().($path ? $path.DIRECTORY_SEPARATOR : $path);
597 596
     }
598 597
 }
599 598
 
@@ -606,7 +605,7 @@  discard block
 block discarded – undo
606 605
      */
607 606
     function base_path($path = '')
608 607
     {
609
-        return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
608
+        return app()->getBasePath().($path ? $path.DIRECTORY_SEPARATOR : $path);
610 609
     }
611 610
 }
612 611
 
@@ -619,7 +618,7 @@  discard block
 block discarded – undo
619 618
      */
620 619
     function config_path($path = '')
621 620
     {
622
-        return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
621
+        return app()->getConfigPath().($path ? $path.DIRECTORY_SEPARATOR : $path);
623 622
     }
624 623
 }
625 624
 
@@ -632,7 +631,7 @@  discard block
 block discarded – undo
632 631
      */
633 632
     function public_path($path = '')
634 633
     {
635
-        return app()->getRootPath() . 'public' . DIRECTORY_SEPARATOR . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path);
634
+        return app()->getRootPath().'public'.DIRECTORY_SEPARATOR.($path ? ltrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path);
636 635
     }
637 636
 }
638 637
 
@@ -645,7 +644,7 @@  discard block
 block discarded – undo
645 644
      */
646 645
     function runtime_path($path = '')
647 646
     {
648
-        return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
647
+        return app()->getRuntimePath().($path ? $path.DIRECTORY_SEPARATOR : $path);
649 648
     }
650 649
 }
651 650
 
@@ -658,6 +657,6 @@  discard block
 block discarded – undo
658 657
      */
659 658
     function root_path($path = '')
660 659
     {
661
-        return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
660
+        return app()->getRootPath().($path ? $path.DIRECTORY_SEPARATOR : $path);
662 661
     }
663 662
 }
Please login to merge, or discard this patch.
src/think/console/Output.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
     public function __construct($driver = 'console')
76 76
     {
77
-        $class = '\\think\\console\\output\\driver\\' . ucwords($driver);
77
+        $class = '\\think\\console\\output\\driver\\'.ucwords($driver);
78 78
 
79 79
         $this->handle = new $class($this);
80 80
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         if ($this->handle && method_exists($this->handle, $method)) {
226 226
             return call_user_func_array([$this->handle, $method], $args);
227 227
         } else {
228
-            throw new Exception('method not exists:' . __CLASS__ . '->' . $method);
228
+            throw new Exception('method not exists:'.__CLASS__.'->'.$method);
229 229
         }
230 230
     }
231 231
 }
Please login to merge, or discard this patch.
src/think/route/RuleGroup.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         }
95 95
 
96 96
         if ($this->parent && $this->parent->getFullName()) {
97
-            $this->fullName = $this->parent->getFullName() . ($this->name ? '/' . $this->name : '');
97
+            $this->fullName = $this->parent->getFullName().($this->name ? '/'.$this->name : '');
98 98
         } else {
99 99
             $this->fullName = $this->name;
100 100
         }
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
     protected function checkMergeRuleRegex(Request $request, array &$rules, string $url, bool $completeMatch)
279 279
     {
280 280
         $depr  = $this->router->config('pathinfo_depr');
281
-        $url   = $depr . str_replace('|', $depr, $url);
281
+        $url   = $depr.str_replace('|', $depr, $url);
282 282
         $regex = [];
283 283
         $items = [];
284 284
 
285 285
         foreach ($rules as $key => $val) {
286 286
             $item = $val[1];
287 287
             if ($item instanceof RuleItem) {
288
-                $rule = $depr . str_replace('/', $depr, $item->getRule());
288
+                $rule = $depr.str_replace('/', $depr, $item->getRule());
289 289
                 if ($depr == $rule && $depr != $url) {
290 290
                     unset($rules[$key]);
291 291
                     continue;
@@ -302,21 +302,21 @@  discard block
 block discarded – undo
302 302
                     continue;
303 303
                 }
304 304
 
305
-                $slash = preg_quote('/-' . $depr, '/');
305
+                $slash = preg_quote('/-'.$depr, '/');
306 306
 
307
-                if ($matchRule = preg_split('/[' . $slash . ']<\w+\??>/', $rule, 2)) {
307
+                if ($matchRule = preg_split('/['.$slash.']<\w+\??>/', $rule, 2)) {
308 308
                     if ($matchRule[0] && 0 !== strncasecmp($rule, $url, strlen($matchRule[0]))) {
309 309
                         unset($rules[$key]);
310 310
                         continue;
311 311
                     }
312 312
                 }
313 313
 
314
-                if (preg_match_all('/[' . $slash . ']?<?\w+\??>?/', $rule, $matches)) {
314
+                if (preg_match_all('/['.$slash.']?<?\w+\??>?/', $rule, $matches)) {
315 315
                     unset($rules[$key]);
316 316
                     $pattern = array_merge($this->getPattern(), $item->getPattern());
317 317
                     $option  = array_merge($this->getOption(), $item->getOption());
318 318
 
319
-                    $regex[$key] = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $complete, '_THINK_' . $key);
319
+                    $regex[$key] = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $complete, '_THINK_'.$key);
320 320
                     $items[$key] = $item;
321 321
                 }
322 322
             }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         }
328 328
 
329 329
         try {
330
-            $result = preg_match('/^(?:' . implode('|', $regex) . ')/u', $url, $match);
330
+            $result = preg_match('/^(?:'.implode('|', $regex).')/u', $url, $match);
331 331
         } catch (\Exception $e) {
332 332
             throw new Exception('route pattern error');
333 333
         }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
             if (!isset($pos)) {
346 346
                 foreach ($regex as $key => $item) {
347
-                    if (0 === strpos(str_replace(['\/', '\-', '\\' . $depr], ['/', '-', $depr], $item), $match[0])) {
347
+                    if (0 === strpos(str_replace(['\/', '\-', '\\'.$depr], ['/', '-', $depr], $item), $match[0])) {
348 348
                         $pos = $key;
349 349
                         break;
350 350
                     }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      * @access public
374 374
      * @return RuleItem|null
375 375
      */
376
-    public function getMissRule():  ? RuleItem
376
+    public function getMissRule(): ? RuleItem
377 377
     {
378 378
         return $this->miss;
379 379
     }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
     public function prefix(string $prefix)
460 460
     {
461 461
         if ($this->parent && $this->parent->getOption('prefix')) {
462
-            $prefix = $this->parent->getOption('prefix') . $prefix;
462
+            $prefix = $this->parent->getOption('prefix').$prefix;
463 463
         }
464 464
 
465 465
         return $this->setOption('prefix', $prefix);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             return $this->rules;
499 499
         }
500 500
 
501
-        return array_filter($this->rules, function ($item) use ($method) {
501
+        return array_filter($this->rules, function($item) use ($method) {
502 502
             return $method == $item[0] || $item[0] = '*';
503 503
         });
504 504
     }
Please login to merge, or discard this patch.