@@ -103,17 +103,17 @@ discard block |
||
| 103 | 103 | $this->commandName = implode('/', array_map('strtolower', explode('/', $className))); |
| 104 | 104 | |
| 105 | 105 | foreach ($this->commandOptions as $optionName => $optionConfig) { |
| 106 | - $shortcut = empty($optionConfig[ 'shortcut' ]) |
|
| 106 | + $shortcut = empty($optionConfig['shortcut']) |
|
| 107 | 107 | ? '-' . substr($optionName, 0, 1) |
| 108 | - : '-' . rtrim($optionConfig[ 'shortcut' ]); |
|
| 108 | + : '-' . rtrim($optionConfig['shortcut']); |
|
| 109 | 109 | |
| 110 | 110 | if (array_key_exists($shortcut, $this->commandOptionsShortcuts)) { |
| 111 | 111 | $shortcut = '-' . substr($optionName, 0, 2); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - $this->commandOptions[ $optionName ][ 'shortcut' ] = $shortcut; |
|
| 114 | + $this->commandOptions[$optionName]['shortcut'] = $shortcut; |
|
| 115 | 115 | |
| 116 | - $this->commandOptionsShortcuts[ $shortcut ] = $optionName; |
|
| 116 | + $this->commandOptionsShortcuts[$shortcut] = $optionName; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (array_key_exists('VERBOSE', $_ENV)) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | ? '-' . substr($optionName, 0, 1) |
| 161 | 161 | : '-' . rtrim($optionShortcut); |
| 162 | 162 | |
| 163 | - $this->commandOptions[ $optionName ] = [ |
|
| 163 | + $this->commandOptions[$optionName] = [ |
|
| 164 | 164 | 'shortcut' => $optionShortcut, |
| 165 | 165 | 'description' => $optionDescription, |
| 166 | 166 | ]; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | foreach ($options as $method => $arguments) { |
| 221 | 221 | |
| 222 | 222 | if (array_key_exists('-' . $method, $this->commandOptionsShortcuts)) { |
| 223 | - $method = $this->commandOptionsShortcuts[ '-' . $method ]; |
|
| 223 | + $method = $this->commandOptionsShortcuts['-' . $method]; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if ($command->hasMethod($commandMethodName = camelcase('option-' . $method))) { |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | if ($commandMethod->getNumberOfRequiredParameters() == 0) { |
| 234 | 234 | call_user_func([&$this, $commandMethodName]); |
| 235 | 235 | } elseif ($commandMethod->getNumberOfRequiredParameters() > 0 and empty($arguments)) { |
| 236 | - if (isset($this->commandOptions[ $method ][ 'help' ])) { |
|
| 236 | + if (isset($this->commandOptions[$method]['help'])) { |
|
| 237 | 237 | output()->write( |
| 238 | 238 | (new Format()) |
| 239 | 239 | ->setContextualClass(Format::INFO) |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | output()->write( |
| 246 | 246 | (new Format()) |
| 247 | 247 | ->setContextualClass(Format::INFO) |
| 248 | - ->setString(language()->getLine($this->commandOptions[ $method ][ 'help' ])) |
|
| 248 | + ->setString(language()->getLine($this->commandOptions[$method]['help'])) |
|
| 249 | 249 | ->setNewLinesAfter(2) |
| 250 | 250 | ); |
| 251 | 251 | } |
@@ -359,8 +359,8 @@ discard block |
||
| 359 | 359 | $table |
| 360 | 360 | ->addRow() |
| 361 | 361 | ->addColumn('--' . $optionCaller) |
| 362 | - ->addColumn($optionProps[ 'shortcut' ]) |
|
| 363 | - ->addColumn(language()->getLine($optionProps[ 'description' ])); |
|
| 362 | + ->addColumn($optionProps['shortcut']) |
|
| 363 | + ->addColumn(language()->getLine($optionProps['description'])); |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | output()->write( |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | public function addCommander(AbstractCommander $commander) |
| 412 | 412 | { |
| 413 | - $this->actionsPool[ $commander->getCommandName() ] = $commander; |
|
| 413 | + $this->actionsPool[$commander->getCommandName()] = $commander; |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | // ------------------------------------------------------------------------ |