| Total Complexity | 6 |
| Total Lines | 99 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class TurboSmsMessage |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The phone number the message should be sent from. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | public $from = ''; |
||
| 15 | /** |
||
| 16 | * The message content. |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | public $content = ''; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Time of sending a message. |
||
| 24 | * |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | public $time; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var bool |
||
| 31 | */ |
||
| 32 | public $test; |
||
| 33 | |||
| 34 | |||
| 35 | /** |
||
| 36 | * Create a new message instance. |
||
| 37 | * |
||
| 38 | * @param string $content |
||
| 39 | * |
||
| 40 | * @return static |
||
| 41 | */ |
||
| 42 | public static function create($content = '') |
||
| 43 | { |
||
| 44 | return new static($content); |
||
| 45 | } |
||
| 46 | /** |
||
| 47 | * @param string $content |
||
| 48 | */ |
||
| 49 | public function __construct($content = '') |
||
| 52 | } |
||
| 53 | /** |
||
| 54 | * Set the message content. |
||
| 55 | * |
||
| 56 | * @param string $content |
||
| 57 | * |
||
| 58 | * @return $this |
||
| 59 | */ |
||
| 60 | public function content($content) |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Set the test SMS - imitation sending. |
||
| 69 | * |
||
| 70 | * @param string $from |
||
| 71 | * |
||
| 72 | * @return $this |
||
| 73 | */ |
||
| 74 | public function test(bool $test = false) |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Set the phone number or sender name the message should be sent from. |
||
| 83 | * |
||
| 84 | * @param string $from |
||
| 85 | * |
||
| 86 | * @return $this |
||
| 87 | */ |
||
| 88 | public function from($from) |
||
| 89 | { |
||
| 90 | $this->from = $from; |
||
| 91 | |||
| 92 | return $this; |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * Postpone shipping for -n- sec. |
||
| 97 | * |
||
| 98 | * @param null $time |
||
|
|
|||
| 99 | * @return $this |
||
| 100 | */ |
||
| 101 | public function time(int $time = null) |
||
| 106 | } |
||
| 107 | } |
||
| 108 |