@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function setup(): Cmd { |
| 14 | 14 | return Cmd::root() |
| 15 | - ->setCallable(static function (Cmd $cmd) { |
|
| 15 | + ->setCallable(static function(Cmd $cmd) { |
|
| 16 | 16 | echo 'Hello World' . self::EOL; |
| 17 | 17 | }); |
| 18 | 18 | } |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | public function setup(): Cmd { |
| 15 | 15 | return Cmd::root() |
| 16 | - ->setCallable(static function (Cmd $cmd) { |
|
| 16 | + ->setCallable(static function(Cmd $cmd) { |
|
| 17 | 17 | $cmd->help(); |
| 18 | 18 | }) |
| 19 | 19 | ->addSubCmd( |
| 20 | 20 | Cmd::extend('show') |
| 21 | 21 | ->setDescription('This command is used to show something. Take a look at the subcommands.') |
| 22 | - ->setCallable(static function (Cmd $cmd) { |
|
| 22 | + ->setCallable(static function(Cmd $cmd) { |
|
| 23 | 23 | error_reporting(E_ALL); |
| 24 | 24 | $cmd->help(); |
| 25 | 25 | }) |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | 'isa' => 'string', |
| 32 | 32 | 'default' => 'World' |
| 33 | 33 | ]) |
| 34 | - ->setCallable(static function (Cmd $cmd) { |
|
| 34 | + ->setCallable(static function(Cmd $cmd) { |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | $name = $cmd->getProvidedOption('name'); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ->addSubCmd( |
| 46 | 46 | Cmd::extend('phpversion') |
| 47 | 47 | ->setDescription('Displays the current php version of your cli.') |
| 48 | - ->setCallable(static function (Cmd $cmd) { |
|
| 48 | + ->setCallable(static function(Cmd $cmd) { |
|
| 49 | 49 | self::eol(); |
| 50 | 50 | self::echo(' Your PHP version is:', Color::FOREGROUND_COLOR_YELLOW); |
| 51 | 51 | self::eol(); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | 'isa' => 'string', |
| 22 | 22 | 'default' => 'World' |
| 23 | 23 | ]) |
| 24 | - ->setCallable(static function (Cmd $cmd) { |
|
| 24 | + ->setCallable(static function(Cmd $cmd) { |
|
| 25 | 25 | |
| 26 | 26 | $name = $cmd->getProvidedOption('name'); |
| 27 | 27 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | echo self::EOL; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public static function echo(string $str, ?string $foreground_color = null): void { |
|
| 20 | + public static function echo(string $str, ?string $foreground_color = null) : void { |
|
| 21 | 21 | |
| 22 | 22 | $lines = preg_split("/\r\n|\n|\r/", $str); |
| 23 | 23 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | foreach ($oc->options as $option) { |
| 72 | 72 | |
| 73 | 73 | $s = ' '; |
| 74 | - if(!empty($option->short)) { |
|
| 74 | + if (!empty($option->short)) { |
|
| 75 | 75 | $s = '-' . $option->short . ', '; |
| 76 | 76 | } |
| 77 | 77 | $s .= '--' . $option->long; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $has_subcommands = !empty($cmd->subcommands); |
| 103 | 103 | |
| 104 | - if($has_subcommands) { |
|
| 104 | + if ($has_subcommands) { |
|
| 105 | 105 | |
| 106 | 106 | App::eol(); |
| 107 | 107 | App::echo('Available commands: ', Color::FOREGROUND_COLOR_YELLOW); |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $this->addSubCmd( |
| 69 | 69 | self::extend('help') |
| 70 | 70 | ->setDescription('Displays help for this command.') |
| 71 | - ->setCallable(static function (Cmd $cmd) { |
|
| 71 | + ->setCallable(static function(Cmd $cmd) { |
|
| 72 | 72 | $cmd->parent->help(); |
| 73 | 73 | }) |
| 74 | 74 | ); |