@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $commandName = $this->input->getArgument('commandName') ?: strtolower(basename($name)); |
32 | 32 | $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); |
33 | 33 | |
34 | - $class = str_replace($namespace . '\\', '', $name); |
|
34 | + $class = str_replace($namespace.'\\', '', $name); |
|
35 | 35 | $stub = file_get_contents($this->getStub()); |
36 | 36 | |
37 | 37 | return str_replace(['{%commandName%}', '{%className%}', '{%namespace%}', '{%app_namespace%}'], [ |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | |
45 | 45 | protected function getStub(): string |
46 | 46 | { |
47 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'command.stub'; |
|
47 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'command.stub'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | protected function getNamespace(string $app): string |
51 | 51 | { |
52 | - return parent::getNamespace($app) . '\\command'; |
|
52 | + return parent::getNamespace($app).'\\command'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | } |
@@ -25,11 +25,11 @@ |
||
25 | 25 | |
26 | 26 | protected function getStub(): string |
27 | 27 | { |
28 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'listener.stub'; |
|
28 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'listener.stub'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | protected function getNamespace(string $app): string |
32 | 32 | { |
33 | - return parent::getNamespace($app) . '\\listener'; |
|
33 | + return parent::getNamespace($app).'\\listener'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub(): string |
28 | 28 | { |
29 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'model.stub'; |
|
29 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'model.stub'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function getNamespace(string $app): string |
33 | 33 | { |
34 | - return parent::getNamespace($app) . '\\model'; |
|
34 | + return parent::getNamespace($app).'\\model'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub(): string |
28 | 28 | { |
29 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'service.stub'; |
|
29 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'service.stub'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function getNamespace(string $app): string |
33 | 33 | { |
34 | - return parent::getNamespace($app) . '\\service'; |
|
34 | + return parent::getNamespace($app).'\\service'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub(): string |
28 | 28 | { |
29 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'middleware.stub'; |
|
29 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'middleware.stub'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function getNamespace(string $app): string |
@@ -25,11 +25,11 @@ |
||
25 | 25 | |
26 | 26 | protected function getStub(): string |
27 | 27 | { |
28 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'subscribe.stub'; |
|
28 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'subscribe.stub'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | protected function getNamespace(string $app): string |
32 | 32 | { |
33 | - return parent::getNamespace($app) . '\\subscribe'; |
|
33 | + return parent::getNamespace($app).'\\subscribe'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -25,11 +25,11 @@ |
||
25 | 25 | |
26 | 26 | protected function getStub(): string |
27 | 27 | { |
28 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'event.stub'; |
|
28 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'event.stub'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | protected function getNamespace(string $app): string |
32 | 32 | { |
33 | - return parent::getNamespace($app) . '\\event'; |
|
33 | + return parent::getNamespace($app).'\\event'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -30,27 +30,27 @@ |
||
30 | 30 | |
31 | 31 | protected function getStub(): string |
32 | 32 | { |
33 | - $stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR; |
|
33 | + $stubPath = __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR; |
|
34 | 34 | |
35 | 35 | if ($this->input->getOption('api')) { |
36 | - return $stubPath . 'controller.api.stub'; |
|
36 | + return $stubPath.'controller.api.stub'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if ($this->input->getOption('plain')) { |
40 | - return $stubPath . 'controller.plain.stub'; |
|
40 | + return $stubPath.'controller.plain.stub'; |
|
41 | 41 | } |
42 | 42 | |
43 | - return $stubPath . 'controller.stub'; |
|
43 | + return $stubPath.'controller.stub'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | protected function getClassName(string $name): string |
47 | 47 | { |
48 | - return parent::getClassName($name) . ($this->app->config->get('route.controller_suffix') ? 'Controller' : ''); |
|
48 | + return parent::getClassName($name).($this->app->config->get('route.controller_suffix') ? 'Controller' : ''); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function getNamespace(string $app): string |
52 | 52 | { |
53 | - return parent::getNamespace($app) . '\\controller'; |
|
53 | + return parent::getNamespace($app).'\\controller'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | } |
@@ -38,18 +38,18 @@ discard block |
||
38 | 38 | $this->app->cache->clear('route_cache'); |
39 | 39 | } else { |
40 | 40 | $app = $input->getArgument('app'); |
41 | - $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($app ? $app . DIRECTORY_SEPARATOR : ''); |
|
41 | + $runtimePath = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.($app ? $app.DIRECTORY_SEPARATOR : ''); |
|
42 | 42 | |
43 | 43 | if ($input->getOption('cache')) { |
44 | - $path = $runtimePath . 'cache'; |
|
44 | + $path = $runtimePath.'cache'; |
|
45 | 45 | } elseif ($input->getOption('log')) { |
46 | - $path = $runtimePath . 'log'; |
|
46 | + $path = $runtimePath.'log'; |
|
47 | 47 | } else { |
48 | 48 | $path = $input->getOption('path') ?: $runtimePath; |
49 | 49 | } |
50 | 50 | |
51 | 51 | $rmdir = $input->getOption('dir') ? true : false; |
52 | - $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir); |
|
52 | + $this->clear(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, $rmdir); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $output->writeln("<info>Clear Successed</info>"); |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | $files = is_dir($path) ? scandir($path) : []; |
61 | 61 | |
62 | 62 | foreach ($files as $file) { |
63 | - if ('.' != $file && '..' != $file && is_dir($path . $file)) { |
|
64 | - array_map('unlink', glob($path . $file . DIRECTORY_SEPARATOR . '*.*')); |
|
63 | + if ('.' != $file && '..' != $file && is_dir($path.$file)) { |
|
64 | + array_map('unlink', glob($path.$file.DIRECTORY_SEPARATOR.'*.*')); |
|
65 | 65 | if ($rmdir) { |
66 | - rmdir($path . $file); |
|
66 | + rmdir($path.$file); |
|
67 | 67 | } |
68 | - } elseif ('.gitignore' != $file && is_file($path . $file)) { |
|
69 | - unlink($path . $file); |
|
68 | + } elseif ('.gitignore' != $file && is_file($path.$file)) { |
|
69 | + unlink($path.$file); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |