| 1 | <?php |
||
| 5 | abstract class TwilioMessage |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The message content. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | public $content; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The phone number the message should be sent from. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $from; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var null|string |
||
| 23 | */ |
||
| 24 | public $statusCallback; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var null|string |
||
| 28 | */ |
||
| 29 | public $statusCallbackMethod; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Create a message object. |
||
| 33 | * @param string $content |
||
| 34 | * @return static |
||
| 35 | */ |
||
| 36 | 15 | public static function create(string $content = ''): self |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Create a new message instance. |
||
| 43 | * |
||
| 44 | * @param string $content |
||
| 45 | */ |
||
| 46 | 43 | public function __construct(string $content = '') |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Set the message content. |
||
| 53 | * |
||
| 54 | * @param string $content |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | 3 | public function content(string $content): self |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Set the phone number the message should be sent from. |
||
| 66 | * |
||
| 67 | * @param string $from |
||
| 68 | * @return $this |
||
| 69 | */ |
||
| 70 | 8 | public function from(string $from): self |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Get the from address. |
||
| 79 | * |
||
| 80 | * @return string|null |
||
| 81 | */ |
||
| 82 | 3 | public function getFrom(): ?string |
|
| 86 | |||
| 87 | /** |
||
| 88 | * Set the status callback. |
||
| 89 | * |
||
| 90 | * @param string $statusCallback |
||
| 91 | * @return $this |
||
| 92 | */ |
||
| 93 | 7 | public function statusCallback(string $statusCallback): self |
|
| 99 | |||
| 100 | /** |
||
| 101 | * Set the status callback request method. |
||
| 102 | * |
||
| 103 | * @param string $statusCallbackMethod |
||
| 104 | * @return $this |
||
| 105 | */ |
||
| 106 | 7 | public function statusCallbackMethod(string $statusCallbackMethod): self |
|
| 112 | } |
||
| 113 |