| Total Complexity | 6 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class UnisenderMessage |
||
| 6 | { |
||
| 7 | public $to; |
||
| 8 | public $from; |
||
| 9 | public $content; |
||
| 10 | public $token; |
||
| 11 | public $silent = false; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Set API Token. |
||
| 15 | * |
||
| 16 | * @param string $token |
||
| 17 | * |
||
| 18 | * @return UnisenderMessage |
||
| 19 | */ |
||
| 20 | public function usingApiToken(string $token) |
||
| 21 | { |
||
| 22 | $this->token = $token; |
||
| 23 | |||
| 24 | return $this; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Send message silently (without raising any exceptions). |
||
| 29 | * |
||
| 30 | * @param bool $flag |
||
| 31 | * |
||
| 32 | * @return UnisenderMessage |
||
| 33 | */ |
||
| 34 | public function silent(bool $flag = true) |
||
| 35 | { |
||
| 36 | $this->silent = $flag; |
||
| 37 | |||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Set the message's receivers. |
||
| 43 | * |
||
| 44 | * @param array|string $to |
||
| 45 | * |
||
| 46 | * @return UnisenderMessage |
||
| 47 | */ |
||
| 48 | public function to($to) |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Set the message's sender. |
||
| 61 | * |
||
| 62 | * @param string $from |
||
| 63 | * |
||
| 64 | * @return UnisenderMessage |
||
| 65 | */ |
||
| 66 | public function from(string $from) |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Set the message's content. |
||
| 75 | * |
||
| 76 | * @param string $content |
||
| 77 | * |
||
| 78 | * @return UnisenderMessage |
||
| 79 | */ |
||
| 80 | public function content(string $content) |
||
| 85 | } |
||
| 86 | } |
||
| 87 |