| @@ 92-104 (lines=13) @@ | ||
| 89 | * @param Collection|SignatureHandler[] $handlers |
|
| 90 | * @return Response |
|
| 91 | */ |
|
| 92 | protected function displayHelpList(Collection $handlers): Response |
|
| 93 | { |
|
| 94 | $attachmentFields = $handlers |
|
| 95 | ->map(function (SignatureHandler $handler) { |
|
| 96 | return AttachmentField::create($handler->getFullCommand(), $handler->getDescription()); |
|
| 97 | }) |
|
| 98 | ->all(); |
|
| 99 | ||
| 100 | return $this->respondToSlack('Available commands:') |
|
| 101 | ->withAttachment( |
|
| 102 | Attachment::create()->setFields($attachmentFields) |
|
| 103 | ); |
|
| 104 | } |
|
| 105 | } |
|
| 106 | ||
| @@ 97-107 (lines=11) @@ | ||
| 94 | return $subHandlers; |
|
| 95 | } |
|
| 96 | ||
| 97 | protected function getCommandListAttachment(Collection $handlers): Attachment |
|
| 98 | { |
|
| 99 | $attachmentFields = $handlers |
|
| 100 | ->map(function (SignatureHandler $handler) { |
|
| 101 | return AttachmentField::create($handler->getFullCommand(), $handler->getDescription()); |
|
| 102 | }) |
|
| 103 | ->all(); |
|
| 104 | ||
| 105 | return Attachment::create() |
|
| 106 | ->setTitle('Did you mean:') |
|
| 107 | ->setFields($attachmentFields); |
|
| 108 | } |
|
| 109 | ||
| 110 | protected function containsHelpHandler($alternativeHandlers) |
|