@@ -38,6 +38,5 @@ |
||
38 | 38 | * Class RuntimeException |
39 | 39 | * @package Platine\Console\Exception |
40 | 40 | */ |
41 | -class RuntimeException extends ConsoleException |
|
42 | -{ |
|
41 | +class RuntimeException extends ConsoleException { |
|
43 | 42 | } |
@@ -40,6 +40,5 @@ |
||
40 | 40 | * Class ConsoleException |
41 | 41 | * @package Platine\Console\Exception |
42 | 42 | */ |
43 | -class ConsoleException extends Exception |
|
44 | -{ |
|
43 | +class ConsoleException extends Exception { |
|
45 | 44 | } |
@@ -38,6 +38,5 @@ |
||
38 | 38 | * Class InvalidParameterException |
39 | 39 | * @package Platine\Console\Exception |
40 | 40 | */ |
41 | -class InvalidParameterException extends ConsoleException |
|
42 | -{ |
|
41 | +class InvalidParameterException extends ConsoleException { |
|
43 | 42 | } |
@@ -38,6 +38,5 @@ |
||
38 | 38 | * Class InvalidArgumentException |
39 | 39 | * @package Platine\Console\Exception |
40 | 40 | */ |
41 | -class InvalidArgumentException extends ConsoleException |
|
42 | -{ |
|
41 | +class InvalidArgumentException extends ConsoleException { |
|
43 | 42 | } |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * Class Application |
60 | 60 | * @package Platine\Console |
61 | 61 | */ |
62 | -class Application |
|
63 | -{ |
|
62 | +class Application { |
|
64 | 63 | |
65 | 64 | /** |
66 | 65 | * List of commands |
@@ -338,8 +337,7 @@ discard block |
||
338 | 337 | * @param array<int, string> $argv |
339 | 338 | * @return mixed |
340 | 339 | */ |
341 | - public function handle(array $argv) |
|
342 | - { |
|
340 | + public function handle(array $argv) { |
|
343 | 341 | if (count($argv) < 2) { |
344 | 342 | return $this->showHelp(); |
345 | 343 | } |
@@ -366,8 +364,7 @@ discard block |
||
366 | 364 | * Show help of all commands. |
367 | 365 | * @return mixed |
368 | 366 | */ |
369 | - public function showHelp() |
|
370 | - { |
|
367 | + public function showHelp() { |
|
371 | 368 | $writer = $this->io()->writer(); |
372 | 369 | |
373 | 370 | $header = sprintf( |
@@ -417,8 +414,7 @@ discard block |
||
417 | 414 | * @param Command $command |
418 | 415 | * @return mixed |
419 | 416 | */ |
420 | - protected function executeCommand(Command $command) |
|
421 | - { |
|
417 | + protected function executeCommand(Command $command) { |
|
422 | 418 | if ($command->getName() === '__default__') { |
423 | 419 | return $this->showCommandNotFound(); |
424 | 420 | } |
@@ -445,8 +441,7 @@ discard block |
||
445 | 441 | * Command not found handler. |
446 | 442 | * @return mixed |
447 | 443 | */ |
448 | - protected function showCommandNotFound() |
|
449 | - { |
|
444 | + protected function showCommandNotFound() { |
|
450 | 445 | $available = array_keys($this->getCommands() + $this->aliases); |
451 | 446 | |
452 | 447 | $this->outputHelper() |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | * Class OutputHelper |
61 | 61 | * @package Platine\Console\Util |
62 | 62 | */ |
63 | -class OutputHelper |
|
64 | -{ |
|
63 | +class OutputHelper { |
|
65 | 64 | |
66 | 65 | /** |
67 | 66 | * The writer stream instance |
@@ -79,8 +78,7 @@ discard block |
||
79 | 78 | * Create new instance |
80 | 79 | * @param Writer|null $writer |
81 | 80 | */ |
82 | - public function __construct(?Writer $writer = null) |
|
83 | - { |
|
81 | + public function __construct(?Writer $writer = null) { |
|
84 | 82 | $this->writer = $writer ? $writer : new Writer(); |
85 | 83 | } |
86 | 84 |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Class Helper |
56 | 56 | * @package Platine\Console\Util |
57 | 57 | */ |
58 | -class Helper |
|
59 | -{ |
|
58 | +class Helper { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * Convert the given string to camel case |
@@ -123,8 +122,7 @@ discard block |
||
123 | 122 | * @param string|null $value |
124 | 123 | * @return mixed |
125 | 124 | */ |
126 | - public static function normalizeValue(Parameter $parameter, ?string $value = null) |
|
127 | - { |
|
125 | + public static function normalizeValue(Parameter $parameter, ?string $value = null) { |
|
128 | 126 | if ($parameter instanceof Option && $parameter->isBool()) { |
129 | 127 | return !$parameter->getDefault(); |
130 | 128 | } |
@@ -52,8 +52,7 @@ |
||
52 | 52 | * Class Option |
53 | 53 | * @package Platine\Console\Input |
54 | 54 | */ |
55 | -class Option extends Parameter |
|
56 | -{ |
|
55 | +class Option extends Parameter { |
|
57 | 56 | |
58 | 57 | /** |
59 | 58 | * The short option name |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * Class Parameter |
55 | 55 | * @package Platine\Console\Input |
56 | 56 | */ |
57 | -abstract class Parameter |
|
58 | -{ |
|
57 | +abstract class Parameter { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * The name of the parameter |
@@ -183,8 +182,7 @@ discard block |
||
183 | 182 | * Return the parameter default value |
184 | 183 | * @return mixed |
185 | 184 | */ |
186 | - public function getDefault() |
|
187 | - { |
|
185 | + public function getDefault() { |
|
188 | 186 | if ($this->isVariadic()) { |
189 | 187 | return (array) $this->default; |
190 | 188 | } |
@@ -234,8 +232,7 @@ discard block |
||
234 | 232 | * @param mixed $raw |
235 | 233 | * @return mixed |
236 | 234 | */ |
237 | - public function filter($raw) |
|
238 | - { |
|
235 | + public function filter($raw) { |
|
239 | 236 | if ($this->filter !== null) { |
240 | 237 | $callback = $this->filter; |
241 | 238 |