@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | protected function execute(Input $input, Output $output) |
| 41 | 41 | { |
| 42 | - $filename = Container::get('app')->getRuntimePath() . 'route_list.php'; |
|
| 42 | + $filename = Container::get('app')->getRuntimePath().'route_list.php'; |
|
| 43 | 43 | |
| 44 | 44 | if (is_file($filename)) { |
| 45 | 45 | unlink($filename); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $content = $this->getRouteList(); |
| 49 | - file_put_contents($filename, 'Route List' . PHP_EOL . $content); |
|
| 49 | + file_put_contents($filename, 'Route List'.PHP_EOL.$content); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | protected function getRouteList() |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | foreach ($files as $file) { |
| 61 | 61 | if (strpos($file, '.php')) { |
| 62 | - $filename = $path . DIRECTORY_SEPARATOR . $file; |
|
| 62 | + $filename = $path.DIRECTORY_SEPARATOR.$file; |
|
| 63 | 63 | // 导入路由配置 |
| 64 | 64 | $rules = include $filename; |
| 65 | 65 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $sort = $this->sortBy[$sort]; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - uasort($rows, function ($a, $b) use ($sort) { |
|
| 112 | + uasort($rows, function($a, $b) use ($sort) { |
|
| 113 | 113 | $itemA = isset($a[$sort]) ? $a[$sort] : null; |
| 114 | 114 | $itemB = isset($b[$sort]) ? $b[$sort] : null; |
| 115 | 115 | |
@@ -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 | } |