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 | public static function getInstance(): Client |
||
36 | |||
37 | /** Define SMS recipient(s). |
||
38 | * @param $numbers string|array |
||
39 | * @return $this |
||
40 | */ |
||
41 | public function to($numbers): self |
||
51 | |||
52 | private function setRecipients($numbers): self |
||
60 | |||
61 | public function getRecipients(): array |
||
65 | |||
66 | public function text($text = null): self |
||
74 | |||
75 | private function numberFormat($number): string |
||
83 | |||
84 | public function setText($text): self |
||
90 | |||
91 | public function getText(): string |
||
95 | |||
96 | public function from($from): self |
||
102 | |||
103 | public function getSender(): string |
||
107 | |||
108 | public function getResponse(): string |
||
112 | |||
113 | public function getException(): string |
||
117 | |||
118 | /** |
||
119 | * Determines if it has any recipients. |
||
120 | * |
||
121 | * @return bool [description] |
||
122 | */ |
||
123 | public function hasRecipients(): bool |
||
127 | } |
||
128 |