12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace WeWork\Message;
- class Text implements ResponseMessageInterface, ReplyMessageInterface
- {
- /**
- * @var string
- */
- private $content;
- /**
- * @param string $content
- */
- public function __construct(string $content)
- {
- $this->content = $content;
- }
- /**
- * @return array
- */
- public function formatForReply(): array
- {
- return [
- 'MsgType' => 'text',
- 'Content' => $this->content
- ];
- }
- /**
- * @return array
- */
- public function formatForResponse(): array
- {
- return [
- 'msgtype' => 'text',
- 'text' => [
- 'content' => $this->content
- ]
- ];
- }
- }
|