Completed
Push — 6.0 ( b3b0d4...ea7f4c )
by liu
06:08 queued 25s
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() . 'route' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : '');
49
+        $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.($dir ? $dir.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.
src/think/console/command/RouteList.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $dir = $input->getArgument('dir') ?: '';
44 44
 
45
-        $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : '') . 'route_list.php';
45
+        $filename = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.($dir ? $dir.DIRECTORY_SEPARATOR : '').'route_list.php';
46 46
 
47 47
         if (is_file($filename)) {
48 48
             unlink($filename);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         $content = $this->getRouteList($dir);
54
-        file_put_contents($filename, 'Route List' . PHP_EOL . $content);
54
+        file_put_contents($filename, 'Route List'.PHP_EOL.$content);
55 55
     }
56 56
 
57 57
     protected function getRouteList(string $dir = null): string
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
         $this->app->route->clear();
61 61
 
62 62
         if ($dir) {
63
-            $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR;
63
+            $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR;
64 64
         } else {
65
-            $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR;
65
+            $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR;
66 66
         }
67 67
 
68 68
         $files = is_dir($path) ? scandir($path) : [];
69 69
 
70 70
         foreach ($files as $file) {
71 71
             if (strpos($file, '.php')) {
72
-                include $path . $file;
72
+                include $path.$file;
73 73
             }
74 74
         }
75 75
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 $sort = $this->sortBy[$sort];
109 109
             }
110 110
 
111
-            uasort($rows, function ($a, $b) use ($sort) {
111
+            uasort($rows, function($a, $b) use ($sort) {
112 112
                 $itemA = $a[$sort] ?? null;
113 113
                 $itemB = $b[$sort] ?? null;
114 114
 
Please login to merge, or discard this patch.