Completed
Push — 6.0 ( da97d3...0c7635 )
by liu
08:32 queued 03:31
created
src/think/middleware/TraceDebug.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: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\middleware;
14 14
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
         // 注册日志监听
62 62
         if ($debug) {
63
-            $this->app->event->listen(LogWrite::class, function ($event) {
63
+            $this->app->event->listen(LogWrite::class, function($event) {
64 64
                 if (empty($this->config['channel']) || $this->config['channel'] == $event->channel) {
65 65
                     $this->log = array_merge_recursive($this->log, $event->log);
66 66
                 }
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
                 // trace调试信息注入
99 99
                 $pos = strripos($content, '</body>');
100 100
                 if (false !== $pos) {
101
-                    $content = substr($content, 0, $pos) . $output . substr($content, $pos);
101
+                    $content = substr($content, 0, $pos).$output.substr($content, $pos);
102 102
                 } else {
103
-                    $content = $content . $output;
103
+                    $content = $content.$output;
104 104
                 }
105 105
             }
106 106
         }
Please login to merge, or discard this patch.
src/think/Db.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: 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
 block discarded – undo
67 67
     public function getConfig(string $name = '', $default = null)
68 68
     {
69 69
         if ('' !== $name) {
70
-            return $this->config->get('database.' . $name, $default);
70
+            return $this->config->get('database.'.$name, $default);
71 71
         }
72 72
 
73 73
         return $this->config->get('database');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function event(string $event, callable $callback): void
93 93
     {
94 94
         if ($this->event) {
95
-            $this->event->listen('db.' . $event, $callback);
95
+            $this->event->listen('db.'.$event, $callback);
96 96
         }
97 97
     }
98 98
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public function trigger(string $event, $params = null, bool $once = false)
108 108
     {
109 109
         if ($this->event) {
110
-            return $this->event->trigger('db.' . $event, $params, $once);
110
+            return $this->event->trigger('db.'.$event, $params, $once);
111 111
         }
112 112
     }
113 113
 }
Please login to merge, or discard this patch.
src/think/route/Url.php 1 patch
Spacing   +21 added lines, -21 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
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                 }
173 173
             }
174 174
         } elseif (false === strpos($domain, '.') && 0 !== strpos($domain, $rootDomain)) {
175
-            $domain .= '.' . $rootDomain;
175
+            $domain .= '.'.$rootDomain;
176 176
         }
177 177
 
178 178
         if (false !== strpos($domain, '://')) {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             $scheme = $request->isSsl() ? 'https://' : 'http://';
182 182
         }
183 183
 
184
-        return $scheme . $domain;
184
+        return $scheme.$domain;
185 185
     }
186 186
 
187 187
     /**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             }
201 201
         }
202 202
 
203
-        return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.' . $suffix;
203
+        return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.'.$suffix;
204 204
     }
205 205
 
206 206
     /**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                 $app        = empty($path) ? $app : array_pop($path);
238 238
             }
239 239
 
240
-            $url = $controller . '/' . $action;
240
+            $url = $controller.'/'.$action;
241 241
 
242 242
             if ($app && $this->app->config->get('app.auto_multi_app')) {
243 243
                 $bind = $this->app->config->get('app.domain_bind', []);
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
                     $map = $this->app->config->get('app.app_map', []);
248 248
 
249 249
                     if ($key = array_search($app, $map)) {
250
-                        $url = $key . '/' . $url;
250
+                        $url = $key.'/'.$url;
251 251
                     } else {
252
-                        $url = $app . '/' . $url;
252
+                        $url = $app.'/'.$url;
253 253
                     }
254 254
                 }
255 255
             }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             }
315 315
 
316 316
             if (!in_array($request->port(), [80, 443])) {
317
-                $domain .= ':' . $request->port();
317
+                $domain .= ':'.$request->port();
318 318
             }
319 319
 
320 320
             if (empty($pattern)) {
@@ -325,12 +325,12 @@  discard block
 block discarded – undo
325 325
 
326 326
             foreach ($pattern as $key => $val) {
327 327
                 if (isset($vars[$key])) {
328
-                    $url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key, '<' . $key . '>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url);
328
+                    $url = str_replace(['[:'.$key.']', '<'.$key.'?>', ':'.$key, '<'.$key.'>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url);
329 329
                     unset($vars[$key]);
330 330
                     $url    = str_replace(['/?', '-?'], ['/', '-'], $url);
331 331
                     $result = [rtrim($url, '?/-'), $domain, $suffix];
332 332
                 } elseif (2 == $val) {
333
-                    $url    = str_replace(['/[:' . $key . ']', '[:' . $key . ']', '<' . $key . '?>'], '', $url);
333
+                    $url    = str_replace(['/[:'.$key.']', '[:'.$key.']', '<'.$key.'?>'], '', $url);
334 334
                     $url    = str_replace(['/?', '-?'], ['/', '-'], $url);
335 335
                     $result = [rtrim($url, '?/-'), $domain, $suffix];
336 336
                 } else {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         if (0 === strpos($url, '[') && $pos = strpos($url, ']')) {
359 359
             // [name] 表示使用路由命名标识生成URL
360 360
             $name = substr($url, 1, $pos - 1);
361
-            $url  = 'name' . substr($url, $pos + 1);
361
+            $url  = 'name'.substr($url, $pos + 1);
362 362
         }
363 363
 
364 364
         if (false === strpos($url, '://') && 0 !== strpos($url, '/')) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         }
386 386
 
387 387
         if ($url) {
388
-            $checkName   = isset($name) ? $name : $url . (isset($info['query']) ? '?' . $info['query'] : '');
388
+            $checkName   = isset($name) ? $name : $url.(isset($info['query']) ? '?'.$info['query'] : '');
389 389
             $checkDomain = $domain && is_string($domain) ? $domain : null;
390 390
 
391 391
             $rule = $this->route->getName($checkName, $checkDomain);
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
             }
413 413
 
414 414
             if ($request->app() && $this->app->config->get('app.auto_multi_app') && !$this->app->http->isBindDomain()) {
415
-                $url = $request->app() . '/' . $url;
415
+                $url = $request->app().'/'.$url;
416 416
             }
417 417
         } elseif (!empty($rule) && isset($name)) {
418
-            throw new \InvalidArgumentException('route name not exists:' . $name);
418
+            throw new \InvalidArgumentException('route name not exists:'.$name);
419 419
         } else {
420 420
             // 检测URL绑定
421 421
             $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
             $file = str_replace('\\', '/', dirname($file));
454 454
         }
455 455
 
456
-        $url = rtrim($file, '/') . '/' . $url;
456
+        $url = rtrim($file, '/').'/'.$url;
457 457
 
458 458
         // URL后缀
459 459
         if ('/' == substr($url, -1) || '' == $url) {
@@ -463,32 +463,32 @@  discard block
 block discarded – undo
463 463
         }
464 464
 
465 465
         // 锚点
466
-        $anchor = !empty($anchor) ? '#' . $anchor : '';
466
+        $anchor = !empty($anchor) ? '#'.$anchor : '';
467 467
 
468 468
         // 参数组装
469 469
         if (!empty($vars)) {
470 470
             // 添加参数
471 471
             if ($this->route->config('url_common_param')) {
472 472
                 $vars = http_build_query($vars);
473
-                $url .= $suffix . '?' . $vars . $anchor;
473
+                $url .= $suffix.'?'.$vars.$anchor;
474 474
             } else {
475 475
                 foreach ($vars as $var => $val) {
476 476
                     if ('' !== $val) {
477
-                        $url .= $depr . $var . $depr . urlencode((string) $val);
477
+                        $url .= $depr.$var.$depr.urlencode((string) $val);
478 478
                     }
479 479
                 }
480 480
 
481
-                $url .= $suffix . $anchor;
481
+                $url .= $suffix.$anchor;
482 482
             }
483 483
         } else {
484
-            $url .= $suffix . $anchor;
484
+            $url .= $suffix.$anchor;
485 485
         }
486 486
 
487 487
         // 检测域名
488 488
         $domain = $this->parseDomain($url, $domain);
489 489
 
490 490
         // URL组装
491
-        return $domain . rtrim($this->root, '/') . '/' . ltrim($url, '/');
491
+        return $domain.rtrim($this->root, '/').'/'.ltrim($url, '/');
492 492
     }
493 493
 
494 494
     public function __toString()
Please login to merge, or discard this patch.