| @@ 120-134 (lines=15) @@ | ||
| 117 | * @param BlockLayout $layout The layout. |
|
| 118 | * @param CommandCollection $commands The commands to describe. |
|
| 119 | */ |
|
| 120 | protected function renderCommands(BlockLayout $layout, CommandCollection $commands) |
|
| 121 | { |
|
| 122 | $layout->add(new Paragraph('<b>AVAILABLE COMMANDS</b>')); |
|
| 123 | $layout->beginBlock(); |
|
| 124 | ||
| 125 | $commands = $commands->toArray(); |
|
| 126 | ksort($commands); |
|
| 127 | ||
| 128 | foreach ($commands as $command) { |
|
| 129 | $this->renderCommand($layout, $command); |
|
| 130 | } |
|
| 131 | ||
| 132 | $layout->endBlock(); |
|
| 133 | $layout->add(new EmptyLine()); |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * Renders a command in the "Commands" section. |
|
| @@ 150-163 (lines=14) @@ | ||
| 147 | * @param BlockLayout $layout The layout. |
|
| 148 | * @param CommandCollection $subCommands The sub-commands to render. |
|
| 149 | */ |
|
| 150 | protected function renderSubCommands(BlockLayout $layout, CommandCollection $subCommands) |
|
| 151 | { |
|
| 152 | $layout->add(new Paragraph('<b>COMMANDS</b>')); |
|
| 153 | $layout->beginBlock(); |
|
| 154 | ||
| 155 | $subCommands = $subCommands->toArray(); |
|
| 156 | ksort($subCommands); |
|
| 157 | ||
| 158 | foreach ($subCommands as $subCommand) { |
|
| 159 | $this->renderSubCommand($layout, $subCommand); |
|
| 160 | } |
|
| 161 | ||
| 162 | $layout->endBlock(); |
|
| 163 | } |
|
| 164 | ||
| 165 | /** |
|
| 166 | * Renders a sub-command in the "Commands" section. |
|