1 | <?php |
||
5 | class Advantasms |
||
6 | { |
||
7 | private $apikey, $partnerId, $shortcode; |
||
8 | private $message, $to; |
||
9 | private $baseUrl = "https://quicksms.advantasms.com/api/services"; |
||
10 | private $sendsms = "/sendsms"; |
||
11 | /** |
||
12 | * Advantasms constructor. |
||
13 | * @param string $apiKey |The advanta sms API Key. See documentation for more details |
||
14 | * @param string $partnerId | The Partner ID. See advantaSMS documentation for more details |
||
15 | * @param string $shortCode | The Shortcode of used to send sms. See documentation for more details |
||
16 | * @return Advantasms |
||
|
|||
17 | */ |
||
18 | public function __construct($apiKey, $partnerId, $shortCode) |
||
25 | |||
26 | /** |
||
27 | * Instantiate the Advantasms class. |
||
28 | * @param string $apiKey |The advanta sms API Key. See documentation for more details |
||
29 | * @param string $partnerId | The Partner ID. See advantaSMS documentation for more details |
||
30 | * @param string $shortCode | The Shortcode of used to send sms. See documentation for more details |
||
31 | * @return Advantasms |
||
32 | */ |
||
33 | public static function init($apiKey,$partnerId, $shortCode) { |
||
37 | |||
38 | /** |
||
39 | * @param $mobileNumber |
||
40 | * @return Advantasms |
||
41 | */ |
||
42 | public function to($mobileNumber) { |
||
46 | |||
47 | /** |
||
48 | * @param string $message |
||
49 | * @return Advantasms |
||
50 | */ |
||
51 | public function message(string $message="") { |
||
55 | |||
56 | /** |
||
57 | * Execute sms sending action |
||
58 | * @return array|mixed |
||
59 | */ |
||
60 | public function send() { |
||
118 | |||
119 | /** |
||
120 | * Execute sms sending action |
||
121 | * @param string $time | Time when the sms will be sent in the format Y-m-d H:i |
||
122 | * @return array|mixed |
||
123 | */ |
||
124 | public function schedule(string $time) { |
||
136 | |||
137 | /** |
||
138 | * @param string $endpoint |
||
139 | * @param array $data |
||
140 | * @param array $headers |
||
141 | * @return array|mixed |
||
142 | */ |
||
143 | private function curlPost(string $endpoint, array $data, array $headers=[]) { |
||
157 | |||
158 | } |
||
159 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.