BaseMessage.php 497 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Module\Sms\Messages;
  3. use Overtrue\EasySms\Contracts\MessageInterface;
  4. use Overtrue\EasySms\Message;
  5. /**
  6. * 基础消息类
  7. */
  8. class BaseMessage extends Message
  9. {
  10. /**
  11. * 构造函数
  12. *
  13. * @param array $attributes 消息属性
  14. * @param string $type 消息类型
  15. */
  16. public function __construct(array $attributes = [], string $type = MessageInterface::TEXT_MESSAGE)
  17. {
  18. $this->type = $type;
  19. $this->setData($attributes);
  20. }
  21. }