Completed
Push — 6.0 ( c1d13c...a5b60d )
by liu
07:12
created
src/think/console/Command.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
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         ];
405 405
         $replacements = [
406 406
             $name,
407
-            $_SERVER['PHP_SELF'] . ' ' . $name,
407
+            $_SERVER['PHP_SELF'].' '.$name,
408 408
         ];
409 409
 
410 410
         return str_replace($placeholders, $replacements, $this->getHelp());
@@ -508,6 +508,6 @@  discard block
 block discarded – undo
508 508
     protected function isMultiApp(): bool
509 509
     {
510 510
         $autoMulti = $this->app->config->get('app.auto_multi_app', false);
511
-        return $autoMulti || !is_dir($this->app->getBasePath() . 'controller');
511
+        return $autoMulti || !is_dir($this->app->getBasePath().'controller');
512 512
     }
513 513
 }
Please login to merge, or discard this patch.
src/think/Route.php 1 patch
Spacing   +12 added lines, -12 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
 
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
         $this->ruleName = new RuleName();
172 172
         $this->setDefaultDomain();
173 173
 
174
-        if (is_file($this->app->getRuntimePath() . 'route.php')) {
174
+        if (is_file($this->app->getRuntimePath().'route.php')) {
175 175
             // 读取路由映射文件
176
-            $this->import(include $this->app->getRuntimePath() . 'route.php');
176
+            $this->import(include $this->app->getRuntimePath().'route.php');
177 177
         }
178 178
     }
179 179
 
@@ -402,13 +402,13 @@  discard block
 block discarded – undo
402 402
         if (is_null($domain)) {
403 403
             $domain = $this->host;
404 404
         } elseif (false === strpos($domain, '.')) {
405
-            $domain .= '.' . $this->request->rootDomain();
405
+            $domain .= '.'.$this->request->rootDomain();
406 406
         }
407 407
 
408 408
         $subDomain = $this->request->subDomain();
409 409
 
410 410
         if (strpos($subDomain, '.')) {
411
-            $name = '*' . strstr($subDomain, '.');
411
+            $name = '*'.strstr($subDomain, '.');
412 412
         }
413 413
 
414 414
         if (isset($this->bind[$domain])) {
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
         $this->init();
741 741
 
742 742
         if ($withRoute) {
743
-            $checkCallback = function () use ($request, $withRoute) {
743
+            $checkCallback = function() use ($request, $withRoute) {
744 744
                 //加载路由
745 745
                 $withRoute();
746 746
                 return $this->check();
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 
760 760
         $dispatch->init($this->app);
761 761
 
762
-        $this->app->middleware->add(function () use ($dispatch) {
762
+        $this->app->middleware->add(function() use ($dispatch) {
763 763
             try {
764 764
                 $response = $dispatch->run();
765 765
             } catch (HttpResponseException $exception) {
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
             $closure  = $this->config['route_check_cache_key'];
784 784
             $routeKey = $closure($request);
785 785
         } else {
786
-            $routeKey = md5($request->baseUrl(true) . ':' . $request->method());
786
+            $routeKey = md5($request->baseUrl(true).':'.$request->method());
787 787
         }
788 788
 
789 789
         return $routeKey;
@@ -833,10 +833,10 @@  discard block
 block discarded – undo
833 833
             $path = $pathinfo;
834 834
         } elseif ($suffix) {
835 835
             // 去除正常的URL后缀
836
-            $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
836
+            $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo);
837 837
         } else {
838 838
             // 允许任何后缀访问
839
-            $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo);
839
+            $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo);
840 840
         }
841 841
 
842 842
         return $path;
@@ -879,9 +879,9 @@  discard block
 block discarded – undo
879 879
                 $item = $this->domains[$this->host];
880 880
             } elseif (isset($this->domains[$subDomain])) {
881 881
                 $item = $this->domains[$subDomain];
882
-            } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) {
882
+            } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) {
883 883
                 // 泛三级域名
884
-                $item      = $this->domains['*.' . $domain2];
884
+                $item      = $this->domains['*.'.$domain2];
885 885
                 $panDomain = $domain3;
886 886
             } elseif (isset($this->domains['*']) && !empty($domain2)) {
887 887
                 // 泛二级域名
Please login to merge, or discard this patch.
src/think/Http.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
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function __construct(App $app)
58 58
     {
59 59
         $this->app   = $app;
60
-        $this->multi = is_dir($this->app->getBasePath() . 'controller') ? false : true;
60
+        $this->multi = is_dir($this->app->getBasePath().'controller') ? false : true;
61 61
     }
62 62
 
63 63
     /**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
     protected function dispatchToRoute($request)
195 195
     {
196
-        $withRoute = $this->app->config->get('app.with_route', true) ? function () {
196
+        $withRoute = $this->app->config->get('app.with_route', true) ? function() {
197 197
             $this->loadRoutes();
198 198
         } : null;
199 199
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
      */
206 206
     protected function loadMiddleware(): void
207 207
     {
208
-        if (is_file($this->app->getBasePath() . 'middleware.php')) {
209
-            $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php');
208
+        if (is_file($this->app->getBasePath().'middleware.php')) {
209
+            $this->app->middleware->import(include $this->app->getBasePath().'middleware.php');
210 210
         }
211 211
     }
212 212
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $routePath = $this->getRoutePath();
222 222
 
223 223
         if (is_dir($routePath)) {
224
-            $files = glob($routePath . '*.php');
224
+            $files = glob($routePath.'*.php');
225 225
             foreach ($files as $file) {
226 226
                 include $file;
227 227
             }
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
      */
238 238
     protected function getRoutePath(): string
239 239
     {
240
-        if ($this->isMulti() && is_dir($this->app->getAppPath() . 'route')) {
241
-            return $this->app->getAppPath() . 'route' . DIRECTORY_SEPARATOR;
240
+        if ($this->isMulti() && is_dir($this->app->getAppPath().'route')) {
241
+            return $this->app->getAppPath().'route'.DIRECTORY_SEPARATOR;
242 242
         }
243 243
 
244
-        return $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . ($this->isMulti() ? $this->getName() . DIRECTORY_SEPARATOR : '');
244
+        return $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.($this->isMulti() ? $this->getName().DIRECTORY_SEPARATOR : '');
245 245
     }
246 246
 
247 247
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                         $appName = $map[$name];
329 329
                     }
330 330
                 } elseif ($name && (false !== array_search($name, $map) || in_array($name, $deny))) {
331
-                    throw new HttpException(404, 'app not exists:' . $name);
331
+                    throw new HttpException(404, 'app not exists:'.$name);
332 332
                 } elseif ($name && isset($map['*'])) {
333 333
                     $appName = $map['*'];
334 334
                 } else {
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                 }
337 337
 
338 338
                 if ($name) {
339
-                    $this->app->request->setRoot('/' . $name);
339
+                    $this->app->request->setRoot('/'.$name);
340 340
                     $this->app->request->setPathinfo(strpos($path, '/') ? ltrim(strstr($path, '/'), '/') : '');
341 341
                 }
342 342
             }
@@ -355,11 +355,11 @@  discard block
 block discarded – undo
355 355
     {
356 356
         $this->name = $appName;
357 357
         $this->app->request->setApp($appName);
358
-        $this->app->setAppPath($this->path ?: $this->app->getBasePath() . $appName . DIRECTORY_SEPARATOR);
359
-        $this->app->setRuntimePath($this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . $appName . DIRECTORY_SEPARATOR);
358
+        $this->app->setAppPath($this->path ?: $this->app->getBasePath().$appName.DIRECTORY_SEPARATOR);
359
+        $this->app->setRuntimePath($this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.$appName.DIRECTORY_SEPARATOR);
360 360
 
361 361
         // 设置应用命名空间
362
-        $this->app->setNamespace($this->app->config->get('app.app_namespace') ?: 'app\\' . $appName);
362
+        $this->app->setNamespace($this->app->config->get('app.app_namespace') ?: 'app\\'.$appName);
363 363
 
364 364
         //加载应用
365 365
         $this->loadApp($appName);
@@ -376,34 +376,34 @@  discard block
 block discarded – undo
376 376
         if (is_dir($this->app->getAppPath())) {
377 377
             $appPath = $this->app->getAppPath();
378 378
 
379
-            if (is_file($appPath . 'common.php')) {
380
-                include_once $appPath . 'common.php';
379
+            if (is_file($appPath.'common.php')) {
380
+                include_once $appPath.'common.php';
381 381
             }
382 382
 
383 383
             $configPath = $this->app->getConfigPath();
384 384
 
385 385
             $files = [];
386 386
 
387
-            if (is_dir($configPath . $appName)) {
388
-                $files = array_merge($files, glob($configPath . $appName . DIRECTORY_SEPARATOR . '*' . $this->app->getConfigExt()));
389
-            } elseif (is_dir($appPath . 'config')) {
390
-                $files = array_merge($files, glob($appPath . 'config' . DIRECTORY_SEPARATOR . '*' . $this->app->getConfigExt()));
387
+            if (is_dir($configPath.$appName)) {
388
+                $files = array_merge($files, glob($configPath.$appName.DIRECTORY_SEPARATOR.'*'.$this->app->getConfigExt()));
389
+            } elseif (is_dir($appPath.'config')) {
390
+                $files = array_merge($files, glob($appPath.'config'.DIRECTORY_SEPARATOR.'*'.$this->app->getConfigExt()));
391 391
             }
392 392
 
393 393
             foreach ($files as $file) {
394 394
                 $this->app->config->load($file, pathinfo($file, PATHINFO_FILENAME));
395 395
             }
396 396
 
397
-            if (is_file($appPath . 'event.php')) {
398
-                $this->app->loadEvent(include $appPath . 'event.php');
397
+            if (is_file($appPath.'event.php')) {
398
+                $this->app->loadEvent(include $appPath.'event.php');
399 399
             }
400 400
 
401
-            if (is_file($appPath . 'middleware.php')) {
402
-                $this->app->middleware->import(include $appPath . 'middleware.php');
401
+            if (is_file($appPath.'middleware.php')) {
402
+                $this->app->middleware->import(include $appPath.'middleware.php');
403 403
             }
404 404
 
405
-            if (is_file($appPath . 'provider.php')) {
406
-                $this->app->bind(include $appPath . 'provider.php');
405
+            if (is_file($appPath.'provider.php')) {
406
+                $this->app->bind(include $appPath.'provider.php');
407 407
             }
408 408
         }
409 409
 
Please login to merge, or discard this patch.
src/think/console/command/optimize/Schema.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,21 +49,21 @@  discard block
 block discarded – undo
49 49
             $tables = $this->app->db->getConnection()->getTables($dbName);
50 50
         } else {
51 51
             if ($app) {
52
-                $appPath   = $this->app->getBasePath() . $app . DIRECTORY_SEPARATOR;
53
-                $namespace = 'app\\' . $app;
52
+                $appPath   = $this->app->getBasePath().$app.DIRECTORY_SEPARATOR;
53
+                $namespace = 'app\\'.$app;
54 54
             } else {
55 55
                 $appPath   = $this->app->getBasePath();
56 56
                 $namespace = 'app';
57 57
             }
58 58
 
59
-            $path = $appPath . 'model';
59
+            $path = $appPath.'model';
60 60
             $list = is_dir($path) ? scandir($path) : [];
61 61
 
62 62
             foreach ($list as $file) {
63 63
                 if (0 === strpos($file, '.')) {
64 64
                     continue;
65 65
                 }
66
-                $class = '\\' . $namespace . '\\model\\' . pathinfo($file, PATHINFO_FILENAME);
66
+                $class = '\\'.$namespace.'\\model\\'.pathinfo($file, PATHINFO_FILENAME);
67 67
                 $this->buildModelSchema($class);
68 68
             }
69 69
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             return;
72 72
         }
73 73
 
74
-        $db = isset($dbName) ? $dbName . '.' : '';
74
+        $db = isset($dbName) ? $dbName.'.' : '';
75 75
         $this->buildDataBaseSchema($schemaPath, $tables, $db);
76 76
 
77 77
         $output->writeln('<info>Succeed!</info>');
@@ -90,27 +90,27 @@  discard block
 block discarded – undo
90 90
             if (!is_dir($path)) {
91 91
                 mkdir($path, 0755, true);
92 92
             }
93
-            $content = '<?php ' . PHP_EOL . 'return ';
93
+            $content = '<?php '.PHP_EOL.'return ';
94 94
             $info    = $model->db()->getConnection()->getTableFieldsInfo($table);
95
-            $content .= var_export($info, true) . ';';
95
+            $content .= var_export($info, true).';';
96 96
 
97
-            file_put_contents($path . $dbName . '.' . $table . '.php', $content);
97
+            file_put_contents($path.$dbName.'.'.$table.'.php', $content);
98 98
         }
99 99
     }
100 100
 
101 101
     protected function buildDataBaseSchema(string $path, array $tables, string $db): void
102 102
     {
103 103
         if ('' == $db) {
104
-            $dbName = $this->app->db->getConnection()->getConfig('database') . '.';
104
+            $dbName = $this->app->db->getConnection()->getConfig('database').'.';
105 105
         } else {
106 106
             $dbName = $db;
107 107
         }
108 108
 
109 109
         foreach ($tables as $table) {
110
-            $content = '<?php ' . PHP_EOL . 'return ';
111
-            $info    = $this->app->db->getConnection()->getTableFieldsInfo($db . $table);
112
-            $content .= var_export($info, true) . ';';
113
-            file_put_contents($path . $dbName . $table . '.php', $content);
110
+            $content = '<?php '.PHP_EOL.'return ';
111
+            $info    = $this->app->db->getConnection()->getTableFieldsInfo($db.$table);
112
+            $content .= var_export($info, true).';';
113
+            file_put_contents($path.$dbName.$table.'.php', $content);
114 114
         }
115 115
     }
116 116
 }
Please login to merge, or discard this patch.
src/think/route/RuleItem.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;
14 14
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $rule = '/' != $rule ? ltrim($rule, '/') : '';
135 135
 
136 136
         if ($this->parent && $prefix = $this->parent->getFullName()) {
137
-            $rule = $prefix . ($rule ? '/' . ltrim($rule, '/') : '');
137
+            $rule = $prefix.($rule ? '/'.ltrim($rule, '/') : '');
138 138
         }
139 139
 
140 140
         if (false !== strpos($rule, ':')) {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
         if (isset($option['ext'])) {
239 239
             // 路由ext参数 优先于系统配置的URL伪静态后缀参数
240
-            $url = preg_replace('/\.(' . $request->ext() . ')$/i', '', $url);
240
+            $url = preg_replace('/\.('.$request->ext().')$/i', '', $url);
241 241
         }
242 242
 
243 243
         return $url;
@@ -261,38 +261,38 @@  discard block
 block discarded – undo
261 261
         $pattern = array_merge($this->parent->getPattern(), $this->pattern);
262 262
 
263 263
         // 检查完整规则定义
264
-        if (isset($pattern['__url__']) && !preg_match(0 === strpos($pattern['__url__'], '/') ? $pattern['__url__'] : '/^' . $pattern['__url__'] . ($completeMatch ? '$' : '') . '/', str_replace('|', $depr, $url))) {
264
+        if (isset($pattern['__url__']) && !preg_match(0 === strpos($pattern['__url__'], '/') ? $pattern['__url__'] : '/^'.$pattern['__url__'].($completeMatch ? '$' : '').'/', str_replace('|', $depr, $url))) {
265 265
             return false;
266 266
         }
267 267
 
268 268
         $var  = [];
269
-        $url  = $depr . str_replace('|', $depr, $url);
270
-        $rule = $depr . str_replace('/', $depr, $this->rule);
269
+        $url  = $depr.str_replace('|', $depr, $url);
270
+        $rule = $depr.str_replace('/', $depr, $this->rule);
271 271
 
272 272
         if ($depr == $rule && $depr != $url) {
273 273
             return false;
274 274
         }
275 275
 
276 276
         if (false === strpos($rule, '<')) {
277
-            if (0 === strcasecmp($rule, $url) || (!$completeMatch && 0 === strncasecmp($rule . $depr, $url . $depr, strlen($rule . $depr)))) {
277
+            if (0 === strcasecmp($rule, $url) || (!$completeMatch && 0 === strncasecmp($rule.$depr, $url.$depr, strlen($rule.$depr)))) {
278 278
                 return $var;
279 279
             }
280 280
             return false;
281 281
         }
282 282
 
283
-        $slash = preg_quote('/-' . $depr, '/');
283
+        $slash = preg_quote('/-'.$depr, '/');
284 284
 
285
-        if ($matchRule = preg_split('/[' . $slash . ']?<\w+\??>/', $rule, 2)) {
285
+        if ($matchRule = preg_split('/['.$slash.']?<\w+\??>/', $rule, 2)) {
286 286
             if ($matchRule[0] && 0 !== strncasecmp($rule, $url, strlen($matchRule[0]))) {
287 287
                 return false;
288 288
             }
289 289
         }
290 290
 
291
-        if (preg_match_all('/[' . $slash . ']?<?\w+\??>?/', $rule, $matches)) {
291
+        if (preg_match_all('/['.$slash.']?<?\w+\??>?/', $rule, $matches)) {
292 292
             $regex = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $completeMatch);
293 293
 
294 294
             try {
295
-                if (!preg_match('/^' . $regex . '/u', $url, $match)) {
295
+                if (!preg_match('/^'.$regex.'/u', $url, $match)) {
296 296
                     return false;
297 297
                 }
298 298
             } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/think/Filesystem.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;
14 14
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function getConfig(string $name = null, $default = null)
57 57
     {
58 58
         if (!is_null($name)) {
59
-            return $this->app->config->get('filesystem.' . $name, $default);
59
+            return $this->app->config->get('filesystem.'.$name, $default);
60 60
         }
61 61
 
62 62
         return $this->app->config->get('filesystem');
Please login to merge, or discard this patch.
tests/ViewTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     {
56 56
         $this->config->shouldReceive("get")->with("view.type", 'php')->andReturn(TestTemplate::class);
57 57
 
58
-        $this->view->filter(function ($content) {
58
+        $this->view->filter(function($content) {
59 59
             return $content;
60 60
         });
61 61
 
Please login to merge, or discard this patch.
src/think/View.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: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think;
14 14
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function fetch(string $template = '', array $vars = []): string
88 88
     {
89
-        return $this->getContent(function () use ($vars, $template) {
89
+        return $this->getContent(function() use ($vars, $template) {
90 90
             $this->engine()->fetch($template, array_merge($this->data, $vars));
91 91
         });
92 92
     }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function display(string $content, array $vars = []): string
102 102
     {
103
-        return $this->getContent(function () use ($vars, $content) {
103
+        return $this->getContent(function() use ($vars, $content) {
104 104
             $this->engine()->display($content, array_merge($this->data, $vars));
105 105
         });
106 106
     }
Please login to merge, or discard this patch.
src/think/view/driver/Php.php 1 patch
Spacing   +10 added lines, -10 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\view\driver;
14 14
 
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 
79 79
         // 模板不存在 抛出异常
80 80
         if (!is_file($template)) {
81
-            throw new RuntimeException('template not exists:' . $template);
81
+            throw new RuntimeException('template not exists:'.$template);
82 82
         }
83 83
 
84 84
         $this->template = $template;
85 85
 
86 86
         // 记录视图信息
87 87
         $this->app->log
88
-            ->record('[ VIEW ] ' . $template . ' [ ' . var_export(array_keys($data), true) . ' ]');
88
+            ->record('[ VIEW ] '.$template.' [ '.var_export(array_keys($data), true).' ]');
89 89
 
90 90
         extract($data, EXTR_OVERWRITE);
91 91
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $this->content = $content;
105 105
 
106 106
         extract($data, EXTR_OVERWRITE);
107
-        eval('?>' . $this->content);
107
+        eval('?>'.$this->content);
108 108
     }
109 109
 
110 110
     /**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     private function parseTemplate(string $template): string
117 117
     {
118 118
         if (empty($this->config['view_base'])) {
119
-            $this->config['view_base'] = $this->app->getRootPath() . 'view' . DIRECTORY_SEPARATOR;
119
+            $this->config['view_base'] = $this->app->getRootPath().'view'.DIRECTORY_SEPARATOR;
120 120
         }
121 121
 
122 122
         $request = $this->app->request;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         } else {
133 133
             $app = isset($app) ? $app : $request->app();
134 134
             // 基础视图目录
135
-            $path = $this->config['view_base'] . ($app ? $app . DIRECTORY_SEPARATOR : '');
135
+            $path = $this->config['view_base'].($app ? $app.DIRECTORY_SEPARATOR : '');
136 136
         }
137 137
 
138 138
         $depr = $this->config['view_depr'];
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $controller = $request->controller();
143 143
             if (strpos($controller, '.')) {
144 144
                 $pos        = strrpos($controller, '.');
145
-                $controller = substr($controller, 0, $pos) . '.' . Str::snake(substr($controller, $pos + 1));
145
+                $controller = substr($controller, 0, $pos).'.'.Str::snake(substr($controller, $pos + 1));
146 146
             } else {
147 147
                 $controller = Str::snake($controller);
148 148
             }
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
                         $template = Str::snake($request->action());
159 159
                     }
160 160
 
161
-                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template;
161
+                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template;
162 162
                 } elseif (false === strpos($template, $depr)) {
163
-                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template;
163
+                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template;
164 164
                 }
165 165
             }
166 166
         } else {
167 167
             $template = str_replace(['/', ':'], $depr, substr($template, 1));
168 168
         }
169 169
 
170
-        return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
170
+        return $path.ltrim($template, '/').'.'.ltrim($this->config['view_suffix'], '.');
171 171
     }
172 172
 
173 173
     /**
Please login to merge, or discard this patch.