Completed
Push — 6.0 ( 233e8a...e27de4 )
by liu
05:38
created
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.
src/think/console/command/ServiceDiscover.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: yunwuxin <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\console\command;
14 14
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function execute(Input $input, Output $output)
28 28
     {
29
-        if (is_file($path = $this->app->getRootPath() . 'vendor/composer/installed.json')) {
29
+        if (is_file($path = $this->app->getRootPath().'vendor/composer/installed.json')) {
30 30
             $packages = json_decode(@file_get_contents($path), true);
31 31
 
32 32
             $services = [];
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
                 }
37 37
             }
38 38
 
39
-            $header = '// This file is automatically generated at:' . date('Y-m-d H:i:s') . PHP_EOL . 'declare (strict_types = 1);' . PHP_EOL;
39
+            $header = '// This file is automatically generated at:'.date('Y-m-d H:i:s').PHP_EOL.'declare (strict_types = 1);'.PHP_EOL;
40 40
 
41
-            $content = '<?php ' . PHP_EOL . $header . "return " . var_export($services, true) . ';';
41
+            $content = '<?php '.PHP_EOL.$header."return ".var_export($services, true).';';
42 42
 
43
-            file_put_contents($this->app->getRootPath() . 'vendor/services.php', $content);
43
+            file_put_contents($this->app->getRootPath().'vendor/services.php', $content);
44 44
 
45 45
             $output->writeln('<info>Succeed!</info>');
46 46
         }
Please login to merge, or discard this patch.
src/think/initializer/RegisterService.php 1 patch
Spacing   +2 added lines, -2 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\initializer;
14 14
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function init(App $app)
33 33
     {
34
-        $file = $app->getRootPath() . 'vendor/services.php';
34
+        $file = $app->getRootPath().'vendor/services.php';
35 35
 
36 36
         $services = $this->services;
37 37
 
Please login to merge, or discard this patch.
src/think/log/ChannelSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 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\log;
14 14
 
Please login to merge, or discard this patch.
src/think/log/driver/Socket.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
         if ($this->config['debug']) {
75 75
 
76 76
             if (isset($_SERVER['HTTP_HOST'])) {
77
-                $current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
77
+                $current_uri = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
78 78
             } else {
79
-                $current_uri = 'cmd:' . implode(' ', $_SERVER['argv']);
79
+                $current_uri = 'cmd:'.implode(' ', $_SERVER['argv']);
80 80
             }
81 81
 
82 82
             // 基本信息
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         foreach ($log as $type => $val) {
91 91
             $trace[] = [
92 92
                 'type' => 'groupCollapsed',
93
-                'msg'  => '[ ' . $type . ' ]',
93
+                'msg'  => '[ '.$type.' ]',
94 94
                 'css'  => isset($this->css[$type]) ? $this->css[$type] : '',
95 95
             ];
96 96
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         ];
177 177
 
178 178
         $msg     = @json_encode($logs);
179
-        $address = '/' . $client_id; //将client_id作为地址, server端通过地址判断将日志发布给谁
179
+        $address = '/'.$client_id; //将client_id作为地址, server端通过地址判断将日志发布给谁
180 180
 
181 181
         $this->send($this->config['host'], $msg, $address);
182 182
     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     protected function send($host, $message = '', $address = '/')
251 251
     {
252
-        $url = 'http://' . $host . ':' . $this->port . $address;
252
+        $url = 'http://'.$host.':'.$this->port.$address;
253 253
         $ch  = curl_init();
254 254
 
255 255
         curl_setopt($ch, CURLOPT_URL, $url);
Please login to merge, or discard this patch.
src/think/log/Channel.php 1 patch
Spacing   +2 added lines, -2 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\log;
14 14
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if (is_string($msg) && !empty($context)) {
87 87
             $replace = [];
88 88
             foreach ($context as $key => $val) {
89
-                $replace['{' . $key . '}'] = $val;
89
+                $replace['{'.$key.'}'] = $val;
90 90
             }
91 91
 
92 92
             $msg = strtr($msg, $replace);
Please login to merge, or discard this patch.
src/think/exception/ErrorException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: 麦当苗儿 <[email protected]> <http://zjzit.cn>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\exception;
14 14
 
Please login to merge, or discard this patch.
src/think/exception/RouteNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 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\exception;
14 14
 
Please login to merge, or discard this patch.
src/think/exception/Handle.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: yunwuxin <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\exception;
14 14
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
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');
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
             ob_start();
206 206
             extract($data);
207
-            include $this->app->config->get('app.exception_tmpl') ?: __DIR__ . '/../../tpl/think_exception.tpl';
207
+            include $this->app->config->get('app.exception_tmpl') ?: __DIR__.'/../../tpl/think_exception.tpl';
208 208
 
209 209
             // 获取并清空缓存
210 210
             $data     = ob_get_clean();
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 
259 259
         if (strpos($message, ':')) {
260 260
             $name    = strstr($message, ':', true);
261
-            $message = $lang->has($name) ? $lang->get($name) . strstr($message, ':') : $message;
261
+            $message = $lang->has($name) ? $lang->get($name).strstr($message, ':') : $message;
262 262
         } elseif (strpos($message, ',')) {
263 263
             $name    = strstr($message, ',', true);
264
-            $message = $lang->has($name) ? $lang->get($name) . ':' . substr(strstr($message, ','), 1) : $message;
264
+            $message = $lang->has($name) ? $lang->get($name).':'.substr(strstr($message, ','), 1) : $message;
265 265
         } elseif ($lang->has($message)) {
266 266
             $message = $lang->get($message);
267 267
         }
Please login to merge, or discard this patch.