@@ -356,11 +356,11 @@ |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | foreach ($this->getArguments() as $argument) { |
359 | - $element = '<' . $argument->getName() . '>'; |
|
359 | + $element = '<'.$argument->getName().'>'; |
|
360 | 360 | if (!$argument->isRequired()) { |
361 | - $element = '[' . $element . ']'; |
|
361 | + $element = '['.$element.']'; |
|
362 | 362 | } elseif ($argument->isArray()) { |
363 | - $element .= ' (' . $element . ')'; |
|
363 | + $element .= ' ('.$element.')'; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | if ($argument->isArray()) { |
@@ -8,7 +8,7 @@ discard block |
||
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 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | public function __construct($driver = 'console') |
70 | 70 | { |
71 | - $class = '\\think\\console\\output\\driver\\' . ucwords($driver); |
|
71 | + $class = '\\think\\console\\output\\driver\\'.ucwords($driver); |
|
72 | 72 | |
73 | 73 | $this->handle = new $class($this); |
74 | 74 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | if ($this->handle && method_exists($this->handle, $method)) { |
218 | 218 | return call_user_func_array([$this->handle, $method], $args); |
219 | 219 | } else { |
220 | - throw new Exception('method not exists:' . __CLASS__ . '->' . $method); |
|
220 | + throw new Exception('method not exists:'.__CLASS__.'->'.$method); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 |
@@ -8,7 +8,7 @@ discard block |
||
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 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | foreach ($this->tokens as $token) { |
269 | 269 | foreach ($values as $value) { |
270 | - if ($token === $value || 0 === strpos($token, $value . '=')) { |
|
270 | + if ($token === $value || 0 === strpos($token, $value.'=')) { |
|
271 | 271 | return true; |
272 | 272 | } |
273 | 273 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $token = array_shift($tokens); |
292 | 292 | |
293 | 293 | foreach ($values as $value) { |
294 | - if ($token === $value || 0 === strpos($token, $value . '=')) { |
|
294 | + if ($token === $value || 0 === strpos($token, $value.'=')) { |
|
295 | 295 | if (false !== $pos = strpos($token, '=')) { |
296 | 296 | return substr($token, $pos + 1); |
297 | 297 | } |
@@ -448,9 +448,9 @@ discard block |
||
448 | 448 | */ |
449 | 449 | public function __toString() |
450 | 450 | { |
451 | - $tokens = array_map(function ($token) { |
|
451 | + $tokens = array_map(function($token) { |
|
452 | 452 | if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { |
453 | - return $match[1] . $this->escapeToken($match[2]); |
|
453 | + return $match[1].$this->escapeToken($match[2]); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | if ($token && '-' !== $token[0]) { |
@@ -8,7 +8,7 @@ discard block |
||
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\console\command; |
14 | 14 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | protected function execute(Input $input, Output $output) |
29 | 29 | { |
30 | - $output->writeln('v' . $this->app->version()); |
|
30 | + $output->writeln('v'.$this->app->version()); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $pathname = $this->getPathName($classname); |
37 | 37 | |
38 | 38 | if (is_file($pathname)) { |
39 | - $output->writeln('<error>' . $this->type . ':' . $classname . ' already exists!</error>'); |
|
39 | + $output->writeln('<error>'.$this->type.':'.$classname.' already exists!</error>'); |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | file_put_contents($pathname, $this->buildClass($classname)); |
48 | 48 | |
49 | - $output->writeln('<info>' . $this->type . ':' . $classname . ' created successfully.</info>'); |
|
49 | + $output->writeln('<info>'.$this->type.':'.$classname.' created successfully.</info>'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | protected function buildClass(string $name) |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); |
57 | 57 | |
58 | - $class = str_replace($namespace . '\\', '', $name); |
|
58 | + $class = str_replace($namespace.'\\', '', $name); |
|
59 | 59 | |
60 | 60 | return str_replace(['{%className%}', '{%actionSuffix%}', '{%namespace%}', '{%app_namespace%}'], [ |
61 | 61 | $class, |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $name = str_replace('app\\', '', $name); |
71 | 71 | |
72 | - return $this->app->getBasePath() . ltrim(str_replace('\\', '/', $name), '/') . '.php'; |
|
72 | + return $this->app->getBasePath().ltrim(str_replace('\\', '/', $name), '/').'.php'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | protected function getClassName(string $name): string |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | $name = str_replace('/', '\\', $name); |
89 | 89 | } |
90 | 90 | |
91 | - return $this->getNamespace($app) . '\\' . $name; |
|
91 | + return $this->getNamespace($app).'\\'.$name; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function getNamespace(string $app): string |
95 | 95 | { |
96 | - return 'app' . ($app ? '\\' . $app : ''); |
|
96 | + return 'app'.($app ? '\\'.$app : ''); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | } |
@@ -26,14 +26,14 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub(): string |
28 | 28 | { |
29 | - $stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR; |
|
29 | + $stubPath = __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR; |
|
30 | 30 | |
31 | - return $stubPath . 'validate.stub'; |
|
31 | + return $stubPath.'validate.stub'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | protected function getNamespace(string $app): string |
35 | 35 | { |
36 | - return parent::getNamespace($app) . '\\validate'; |
|
36 | + return parent::getNamespace($app).'\\validate'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | } |
@@ -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 | } |