MessageInterface.php 992 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * This file is part of the overtrue/easy-sms.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Overtrue\EasySms\Contracts;
  11. /**
  12. * Interface MessageInterface.
  13. */
  14. interface MessageInterface
  15. {
  16. public const TEXT_MESSAGE = 'text';
  17. public const VOICE_MESSAGE = 'voice';
  18. /**
  19. * Return the message type.
  20. */
  21. public function getMessageType(): string;
  22. /**
  23. * Return message content.
  24. */
  25. public function getContent(?GatewayInterface $gateway = null): ?string;
  26. /**
  27. * Return the template id of message.
  28. */
  29. public function getTemplate(?GatewayInterface $gateway = null): ?string;
  30. /**
  31. * Return the template data of message.
  32. */
  33. public function getData(?GatewayInterface $gateway = null): array;
  34. /**
  35. * Return message supported gateways.
  36. */
  37. public function getGateways(): array;
  38. }