@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub() |
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($appNamespace, $module) |
33 | 33 | { |
34 | - return parent::getNamespace($appNamespace, 'http') . '\middleware'; |
|
34 | + return parent::getNamespace($appNamespace, 'http').'\middleware'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -26,14 +26,14 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub() |
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($appNamespace, $module) |
35 | 35 | { |
36 | - return parent::getNamespace($appNamespace, $module) . '\validate'; |
|
36 | + return parent::getNamespace($appNamespace, $module).'\validate'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | } |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | protected function getStub() |
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($appNamespace, $module) |
33 | 33 | { |
34 | - return parent::getNamespace($appNamespace, $module) . '\model'; |
|
34 | + return parent::getNamespace($appNamespace, $module).'\model'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -30,27 +30,27 @@ |
||
30 | 30 | |
31 | 31 | protected function getStub() |
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($name) |
47 | 47 | { |
48 | - return parent::getClassName($name) . (Config::get('controller_suffix') ? ucfirst(Config::get('url_controller_layer')) : ''); |
|
48 | + return parent::getClassName($name).(Config::get('controller_suffix') ? ucfirst(Config::get('url_controller_layer')) : ''); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function getNamespace($appNamespace, $module) |
52 | 52 | { |
53 | - return parent::getNamespace($appNamespace, $module) . '\controller'; |
|
53 | + return parent::getNamespace($appNamespace, $module).'\controller'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $commandName = $this->input->getArgument('commandName') ?: strtolower(basename($name)); |
33 | 33 | $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); |
34 | 34 | |
35 | - $class = str_replace($namespace . '\\', '', $name); |
|
35 | + $class = str_replace($namespace.'\\', '', $name); |
|
36 | 36 | $stub = file_get_contents($this->getStub()); |
37 | 37 | |
38 | 38 | return str_replace(['{%commandName%}', '{%className%}', '{%namespace%}', '{%app_namespace%}'], [ |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | |
46 | 46 | protected function getStub() |
47 | 47 | { |
48 | - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'command.stub'; |
|
48 | + return __DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'command.stub'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function getNamespace($appNamespace, $module) |
52 | 52 | { |
53 | - return $appNamespace . '\\command'; |
|
53 | + return $appNamespace.'\\command'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | if ($input->hasOption('config')) { |
45 | 45 | $build = include $input->getOption('config'); |
46 | 46 | } else { |
47 | - $build = include App::getAppPath() . 'build.php'; |
|
47 | + $build = include App::getAppPath().'build.php'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if (empty($build)) { |
@@ -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()) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $array[] = str_repeat($style[1], $width + 2); |
195 | 195 | } |
196 | 196 | |
197 | - return $style[0] . implode($style[2], $array) . $style[3] . PHP_EOL; |
|
197 | + return $style[0].implode($style[2], $array).$style[3].PHP_EOL; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | $content = $this->renderSeparator('top'); |
209 | 209 | |
210 | 210 | foreach ($this->header as $key => $header) { |
211 | - $array[] = ' ' . str_pad($header, $this->colWidth[$key], $style[1], $this->headerAlign); |
|
211 | + $array[] = ' '.str_pad($header, $this->colWidth[$key], $style[1], $this->headerAlign); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | if (!empty($array)) { |
215 | - $content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL; |
|
215 | + $content .= $style[0].implode(' '.$style[2], $array).' '.$style[3].PHP_EOL; |
|
216 | 216 | |
217 | 217 | if ($this->rows) { |
218 | 218 | $content .= $this->renderSeparator('middle'); |
@@ -255,20 +255,20 @@ discard block |
||
255 | 255 | $content .= $this->renderSeparator('middle'); |
256 | 256 | } elseif (is_scalar($row)) { |
257 | 257 | $content .= $this->renderSeparator('cross-top'); |
258 | - $array = str_pad($row, 3 * (count($this->colWidth) - 1) + array_reduce($this->colWidth, function ($a, $b) { |
|
258 | + $array = str_pad($row, 3 * (count($this->colWidth) - 1) + array_reduce($this->colWidth, function($a, $b) { |
|
259 | 259 | return $a + $b; |
260 | 260 | })); |
261 | 261 | |
262 | - $content .= $style[0] . ' ' . $array . ' ' . $style[3] . PHP_EOL; |
|
262 | + $content .= $style[0].' '.$array.' '.$style[3].PHP_EOL; |
|
263 | 263 | $content .= $this->renderSeparator('cross-bottom'); |
264 | 264 | } else { |
265 | 265 | $array = []; |
266 | 266 | |
267 | 267 | foreach ($row as $key => $val) { |
268 | - $array[] = ' ' . str_pad($val, $this->colWidth[$key], ' ', $this->cellAlign); |
|
268 | + $array[] = ' '.str_pad($val, $this->colWidth[$key], ' ', $this->cellAlign); |
|
269 | 269 | } |
270 | 270 | |
271 | - $content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL; |
|
271 | + $content .= $style[0].implode(' '.$style[2], $array).' '.$style[3].PHP_EOL; |
|
272 | 272 | |
273 | 273 | } |
274 | 274 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | public function __construct($driver = 'console') |
68 | 68 | { |
69 | - $class = '\\think\\console\\output\\driver\\' . ucwords($driver); |
|
69 | + $class = '\\think\\console\\output\\driver\\'.ucwords($driver); |
|
70 | 70 | |
71 | 71 | $this->handle = new $class($this); |
72 | 72 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | if ($this->handle && method_exists($this->handle, $method)) { |
216 | 216 | return call_user_func_array([$this->handle, $method], $args); |
217 | 217 | } else { |
218 | - throw new Exception('method not exists:' . __CLASS__ . '->' . $method); |
|
218 | + throw new Exception('method not exists:'.__CLASS__.'->'.$method); |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 |