1 | <?php |
||
7 | abstract class Sms |
||
8 | { |
||
9 | protected $text; |
||
10 | protected $username; |
||
11 | protected $password; |
||
12 | protected $recipients = []; |
||
13 | private static $httpClient; |
||
14 | protected $sender; |
||
15 | protected $response; |
||
16 | protected $client; |
||
17 | protected $request; |
||
18 | |||
19 | /** |
||
20 | * @var \Exception |
||
21 | */ |
||
22 | public $httpError; |
||
23 | |||
24 | /**We want HTTP CLient instantiated |
||
25 | * only once in entire app lifecycle |
||
26 | * @return Client |
||
27 | */ |
||
28 | 9 | public static function getInstance() |
|
36 | |||
37 | /** Define SMS recipient(s). |
||
38 | * @param $numbers string|array |
||
39 | * @return $this |
||
40 | */ |
||
41 | 7 | public function to($numbers) |
|
51 | |||
52 | 7 | private function setRecipients($numbers) |
|
60 | |||
61 | 3 | public function getRecipients(): array |
|
65 | |||
66 | 4 | public function text($text = null) |
|
74 | |||
75 | 7 | private function numberFormat($number) |
|
83 | |||
84 | 4 | public function setText($text) |
|
90 | |||
91 | 1 | public function getText() |
|
95 | |||
96 | 4 | public function from($from) |
|
102 | |||
103 | 1 | public function getSender() |
|
107 | |||
108 | public function getResponse() |
||
112 | |||
113 | public function getException() |
||
117 | |||
118 | /** |
||
119 | * Determines if it has any recipients. |
||
120 | * |
||
121 | * @return bool [description] |
||
122 | */ |
||
123 | 1 | public function hasRecipients() |
|
127 | } |
||
128 |