findAvailableHandlers(); return $this->displayListOfAllCommands($handlers); } protected function displayListOfAllCommands(Collection $handlers): Response { $attachmentFields = $handlers ->sort(function (SignatureHandler $handlerA, SignatureHandler $handlerB) { return strcmp($handlerA->getFullCommand(), $handlerB->getFullCommand()); }) ->map(function (SignatureHandler $handler) { return AttachmentField::create("/{$handler->getSignature()}", $handler->getDescription()); }) ->all(); return $this->respondToSlack('Dostępne komendy') ->withAttachment( Attachment::create() ->setColor('good') ->setFields($attachmentFields) ); } }