@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @param string $name |
186 | 186 | * @param string $description |
187 | 187 | * @param mixed $default |
188 | - * @return Tarsana\Command\Syntax\SyntaxBuilder |
|
188 | + * @return Command |
|
189 | 189 | */ |
190 | 190 | public function describe($name, $description, $default = null) |
191 | 191 | { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * adds/overrides or gets a sub command. |
213 | 213 | * |
214 | 214 | * @param string $name |
215 | - * @param Tarsana\Command\Command|null $cmd |
|
215 | + * @param null|Command $cmd |
|
216 | 216 | * @return Tarsana\Command\Command |
217 | 217 | */ |
218 | 218 | public function command ($name, Command $cmd = null) |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * Runs the command. |
300 | 300 | * |
301 | 301 | * @param string|null $args |
302 | - * @param League\CLImate\CLImate|null $console |
|
302 | + * @param null|CLImate $console |
|
303 | 303 | * @return void |
304 | 304 | */ |
305 | 305 | public function run ($args = null, CLImate $console = null) |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | else |
329 | 329 | $this->args($this->syntax()->parse($args)) |
330 | - ->execute(); |
|
330 | + ->execute(); |
|
331 | 331 | } |
332 | 332 | } catch (\Exception $e) { |
333 | 333 | $this->error( |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if (! ($this instanceof HelpCommand) && ! ($this instanceof VersionCommand)) { |
379 | 379 | $helpCommand = new HelpCommand($this); |
380 | 380 | $this->command('--help', $helpCommand) |
381 | - ->command('help', $helpCommand); |
|
381 | + ->command('help', $helpCommand); |
|
382 | 382 | |
383 | 383 | $versionCommand = new VersionCommand($this); |
384 | 384 | $this->command('--version', $versionCommand); |
@@ -74,6 +74,9 @@ discard block |
||
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | + /** |
|
78 | + * @param integer $level |
|
79 | + */ |
|
77 | 80 | protected function showSyntax($name, $syntax, $level) |
78 | 81 | { |
79 | 82 | $type = $this->typeOf($syntax); |
@@ -102,6 +105,9 @@ discard block |
||
102 | 105 | } |
103 | 106 | } |
104 | 107 | |
108 | + /** |
|
109 | + * @return integer |
|
110 | + */ |
|
105 | 111 | protected function typeOf(Syntax $syntax) |
106 | 112 | { |
107 | 113 | if ($syntax instanceof ObjectSyntax) { |
@@ -35,15 +35,15 @@ discard block |
||
35 | 35 | $c = $this->console(); |
36 | 36 | |
37 | 37 | $c->br() |
38 | - ->green() |
|
39 | - ->inline($command->name() . ' ') |
|
40 | - ->yellow() |
|
41 | - ->out($command->version()) |
|
42 | - ->br() |
|
43 | - ->out($command->description()) |
|
44 | - ->br() |
|
45 | - ->yellow() |
|
46 | - ->inline('Arguments: '); |
|
38 | + ->green() |
|
39 | + ->inline($command->name() . ' ') |
|
40 | + ->yellow() |
|
41 | + ->out($command->version()) |
|
42 | + ->br() |
|
43 | + ->out($command->description()) |
|
44 | + ->br() |
|
45 | + ->yellow() |
|
46 | + ->inline('Arguments: '); |
|
47 | 47 | |
48 | 48 | $args = F\s(array_keys($command->syntax()->fields())) |
49 | 49 | ->then(F\join(' ')) |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | ->get() * 2; |
68 | 68 | foreach ($command->subCommands() as $name => $cmd) { |
69 | 69 | $c->tab() |
70 | - ->padding($padding)->char(' ') |
|
71 | - ->label("<green>{$name}</green>") |
|
72 | - ->result($cmd->description()); |
|
70 | + ->padding($padding)->char(' ') |
|
71 | + ->label("<green>{$name}</green>") |
|
72 | + ->result($cmd->description()); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $c->out("(Required)"); |
87 | 87 | } else { |
88 | 88 | $c->inline("(default: ") |
89 | - ->white()->inline(json_encode($syntax->getDefault())) |
|
90 | - ->yellow()->out(" )"); |
|
89 | + ->white()->inline(json_encode($syntax->getDefault())) |
|
90 | + ->yellow()->out(" )"); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($syntax instanceof ArraySyntax) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * A constructor alias; If you don't like the 'new' keyword. |
25 | 25 | * @param string|Tarsana\Syntax\ObjectSyntax $syntax |
26 | - * @return Tarsana\Command\Syntax\SyntaxBuilder |
|
26 | + * @return SyntaxBuilder |
|
27 | 27 | * @throws Tarsana\Command\Exceptions\SyntaxBuilderException |
28 | 28 | */ |
29 | 29 | public static function of($syntax) |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param string $name |
89 | 89 | * @param string $description |
90 | 90 | * @param mixed $default |
91 | - * @return Tarsana\Command\Syntax\SyntaxBuilder |
|
91 | + * @return SyntaxBuilder |
|
92 | 92 | */ |
93 | 93 | public function describe($name, $description, $default = null) |
94 | 94 | { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * Gets a field or subfield from an Syntax. |
106 | 106 | * |
107 | - * @param Tarsana\Syntax\Syntax $syntax |
|
107 | + * @param Syntax $syntax |
|
108 | 108 | * @param array $names |
109 | 109 | * @return Tarsana\Syntax\Syntax |
110 | 110 | * @throws Tarsana\Command\Exceptions\SyntaxBuilderException |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | * Ensures that `$syntax` is an ObjectSyntax or an ArraySyntax of ObjectSyntaxes, |
123 | 123 | * and returns the ObjectSyntax or throws a SyntaxBuilderException. |
124 | 124 | * |
125 | - * @param Tarsana\Syntax\Syntax $syntax |
|
126 | - * @return Tarsana\Syntax\Syntax |
|
125 | + * @param Syntax $syntax |
|
126 | + * @return ObjectSyntax |
|
127 | 127 | * @throws Tarsana\Command\Exceptions\SyntaxBuilderException |
128 | 128 | */ |
129 | 129 | protected function ensureObject(Syntax $syntax) |
@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * Filesystem getter and setter. |
60 | 60 | * |
61 | - * @param Tarsana\IO\Filesystem|void $value |
|
61 | + * @param null|Filesystem $value |
|
62 | 62 | * @return Tarsana\IO\Filesystem|self |
63 | 63 | */ |
64 | 64 | public function fs (Filesystem $value = null) |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * Loads a template. |
39 | 39 | * |
40 | 40 | * @param string $name |
41 | - * @return Tarsana\Command\Templates\TwigTemplate |
|
41 | + * @return TwigTemplate |
|
42 | 42 | */ |
43 | 43 | public function load($name) |
44 | 44 | { |
@@ -19,8 +19,8 @@ |
||
19 | 19 | { |
20 | 20 | $c = $this->parent(); |
21 | 21 | $this->console |
22 | - ->green()->inline($c->name()) |
|
23 | - ->white()->inline(' version ') |
|
24 | - ->yellow()->out($c->version()); |
|
22 | + ->green()->inline($c->name()) |
|
23 | + ->white()->inline(' version ') |
|
24 | + ->yellow()->out($c->version()); |
|
25 | 25 | } |
26 | 26 | } |