Markdown.php 617 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace WeWork\Message;
  3. class Markdown implements \WeWork\Message\ResponseMessageInterface
  4. {
  5. /**
  6. * @var string
  7. */
  8. private $content;
  9. /**
  10. * Markdown constructor.
  11. * @param string $content
  12. */
  13. public function __construct(string $content)
  14. {
  15. $this->content = $content;
  16. }
  17. /**
  18. * @inheritDoc
  19. */
  20. public function formatForResponse(): array
  21. {
  22. return [
  23. 'msgtype' => 'markdown',
  24. 'markdown' => [
  25. 'content' => $this->content,
  26. ]
  27. ];
  28. }
  29. }