Passed
Push — master ( 9d6aee...74eb15 )
by Timm
02:09
created
examples/cli-app-subcommands.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
examples/cli-app-options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Stefaminator/Cli/App.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Stefaminator/Cli/AppParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
                     return;
23 23
                 }
24 24
 
25
-                if(self::callCallable($cmd)) {
25
+                if (self::callCallable($cmd)) {
26 26
                     return;
27 27
                 }
28 28
 
29
-                if(self::callMethod($app, $cmd)) {
29
+                if (self::callMethod($app, $cmd)) {
30 30
                     return;
31 31
                 }
32 32
 
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
             if ($cmd->hasSubCmd($currentArgument)) {
106 106
                 $_cmd = $cmd->getSubCmd($currentArgument);
107 107
 
108
-                if($_cmd !== null) {
108
+                if ($_cmd !== null) {
109 109
                     $subcommand = $_cmd;
110 110
                 }
111 111
             }
112 112
 
113
-            if($subcommand !== null) {
113
+            if ($subcommand !== null) {
114 114
 
115 115
                 $cmd = $subcommand;
116 116
                 $parser->advance();
Please login to merge, or discard this patch.
src/Stefaminator/Cli/HelpRunner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Stefaminator/Cli/Cmd.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
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
             );
Please login to merge, or discard this patch.