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