@@ -104,17 +104,17 @@ discard block |
||
| 104 | 104 | $this->commandName = implode('/', array_map('strtolower', explode('/', $className))); |
| 105 | 105 | |
| 106 | 106 | foreach ($this->commandOptions as $optionName => $optionConfig) { |
| 107 | - $shortcut = empty($optionConfig[ 'shortcut' ]) |
|
| 107 | + $shortcut = empty($optionConfig['shortcut']) |
|
| 108 | 108 | ? '-' . substr($optionName, 0, 1) |
| 109 | - : '-' . rtrim($optionConfig[ 'shortcut' ]); |
|
| 109 | + : '-' . rtrim($optionConfig['shortcut']); |
|
| 110 | 110 | |
| 111 | 111 | if (array_key_exists($shortcut, $this->commandOptionsShortcuts)) { |
| 112 | 112 | $shortcut = '-' . substr($optionName, 0, 2); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $this->commandOptions[ $optionName ][ 'shortcut' ] = $shortcut; |
|
| 115 | + $this->commandOptions[$optionName]['shortcut'] = $shortcut; |
|
| 116 | 116 | |
| 117 | - $this->commandOptionsShortcuts[ $shortcut ] = $optionName; |
|
| 117 | + $this->commandOptionsShortcuts[$shortcut] = $optionName; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if (array_key_exists('VERBOSE', $_ENV)) { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | ? '-' . substr($optionName, 0, 1) |
| 162 | 162 | : '-' . rtrim($optionShortcut); |
| 163 | 163 | |
| 164 | - $this->commandOptions[ $optionName ] = [ |
|
| 164 | + $this->commandOptions[$optionName] = [ |
|
| 165 | 165 | 'shortcut' => $optionShortcut, |
| 166 | 166 | 'description' => $optionDescription, |
| 167 | 167 | ]; |
@@ -202,14 +202,14 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | protected function __callOptions() |
| 204 | 204 | { |
| 205 | - if(false !== ($options = input()->get())) { |
|
| 206 | - if(count($options)) { |
|
| 205 | + if (false !== ($options = input()->get())) { |
|
| 206 | + if (count($options)) { |
|
| 207 | 207 | $command = new \ReflectionClass($this); |
| 208 | 208 | |
| 209 | 209 | foreach ($options as $method => $arguments) { |
| 210 | 210 | |
| 211 | 211 | if (array_key_exists('-' . $method, $this->commandOptionsShortcuts)) { |
| 212 | - $method = $this->commandOptionsShortcuts[ '-' . $method ]; |
|
| 212 | + $method = $this->commandOptionsShortcuts['-' . $method]; |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | $optionMethod = camelcase('option-' . $method); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | if ($commandMethod->getNumberOfRequiredParameters() == 0) { |
| 222 | 222 | call_user_func_array([&$this, $optionMethod], [$arguments]); |
| 223 | 223 | } elseif ($commandMethod->getNumberOfRequiredParameters() > 0 and empty($arguments)) { |
| 224 | - if (isset($this->commandOptions[ $method ][ 'help' ])) { |
|
| 224 | + if (isset($this->commandOptions[$method]['help'])) { |
|
| 225 | 225 | output()->write( |
| 226 | 226 | (new Format()) |
| 227 | 227 | ->setContextualClass(Format::INFO) |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | output()->write( |
| 234 | 234 | (new Format()) |
| 235 | 235 | ->setContextualClass(Format::INFO) |
| 236 | - ->setString(language()->getLine($this->commandOptions[ $method ][ 'help' ])) |
|
| 236 | + ->setString(language()->getLine($this->commandOptions[$method]['help'])) |
|
| 237 | 237 | ->setNewLinesAfter(2) |
| 238 | 238 | ); |
| 239 | 239 | } |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | $table |
| 348 | 348 | ->addRow() |
| 349 | 349 | ->addColumn('--' . $optionCaller) |
| 350 | - ->addColumn($optionProps[ 'shortcut' ]) |
|
| 351 | - ->addColumn(language()->getLine($optionProps[ 'description' ])); |
|
| 350 | + ->addColumn($optionProps['shortcut']) |
|
| 351 | + ->addColumn(language()->getLine($optionProps['description'])); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | output()->write( |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | public function addCommander(AbstractCommander $commander) |
| 400 | 400 | { |
| 401 | - $this->actionsPool[ $commander->getCommandName() ] = $commander; |
|
| 401 | + $this->actionsPool[$commander->getCommandName()] = $commander; |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | // ------------------------------------------------------------------------ |