protected function executeImpl() { $result = new SlackResult(); $result->setText('Unknown Command'); $this->log->debug("CmdUnknown: Executing CmdUnknown"); return $result; }
protected function executeImpl() { $log = $this->log; $result = new SlackResult(); $result->setText("redmine-command help"); $att = new SlackResultAttachment(); $att->setTitle("Available Commands:"); $att->setFallback("Available Commands:"); $fields = array(); $help_data = CommandFactory::getHelpData(); if ($help_data == null) { $log->error("CmdHelp: Error loading help data, check commands_definition.json format or file permissions"); } else { $help_keys = array_keys($help_data); foreach ($help_keys as $key) { $fields[] = SlackResultAttachmentField::withAttributes($key, $help_data[$key], false); } } usort($fields, array("RedmineCommand\\SlackResultAttachmentField", "compare")); $att->setFieldsArray($fields); $result->setAttachmentsArray(array($att)); return $result; }