| Conditions | 4 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 2 | public function index(): string |
|
| 20 | { |
||
| 21 | 2 | $allCommands = $this->getSlackbot()->getCommands(); |
|
| 22 | |||
| 23 | 2 | $response = ''; |
|
| 24 | 2 | if (!empty($allCommands)) { |
|
| 25 | 2 | $formattingUtility = (new FormattingUtility()); |
|
| 26 | |||
| 27 | 2 | foreach ($allCommands as $commandName => $commandObject) { |
|
| 28 | 2 | if (!$commandObject instanceof Command) { |
|
| 29 | 1 | continue; |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | $response .= "/{$commandName} - ".$commandObject->getDescription().$formattingUtility->newLine(); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 2 | return $response; |
|
| 37 | } |
||
| 38 | } |
||
| 39 |