Passed
Pull Request — 6.0 (#2133)
by
unknown
11:54
created
src/think/console/command/optimize/Route.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $dir = $input->getArgument('dir') ?: '';
31 31
 
32
-        $path = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : '');
32
+        $path = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.($dir ? $dir.DIRECTORY_SEPARATOR : '');
33 33
 
34
-        $filename = $path . 'route.php';
34
+        $filename = $path.'route.php';
35 35
         if (is_file($filename)) {
36 36
             unlink($filename);
37 37
         }
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
         $this->app->route->lazy(false);
47 47
 
48 48
         // 路由检测
49
-        $path = $this->app->getRootPath() . ($dir ? 'app' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR : '') . 'route' . DIRECTORY_SEPARATOR ;
49
+        $path = $this->app->getRootPath().($dir ? 'app'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR : '').'route'.DIRECTORY_SEPARATOR;
50 50
 
51 51
         $files = is_dir($path) ? scandir($path) : [];
52 52
 
53 53
         foreach ($files as $file) {
54 54
             if (strpos($file, '.php')) {
55
-                include $path . $file;
55
+                include $path.$file;
56 56
             }
57 57
         }
58 58
 
59 59
         //触发路由载入完成事件
60 60
         $this->app->event->trigger(RouteLoaded::class);
61 61
 
62
-        $content = '<?php ' . PHP_EOL . 'return ';
63
-        $content .= '\Opis\Closure\unserialize(\'' . \Opis\Closure\serialize($this->app->route->getName()) . '\');';
62
+        $content = '<?php '.PHP_EOL.'return ';
63
+        $content .= '\Opis\Closure\unserialize(\''.\Opis\Closure\serialize($this->app->route->getName()).'\');';
64 64
         return $content;
65 65
     }
66 66
 
Please login to merge, or discard this patch.