| 1 | <?php |
||
| 4 | class SmsManager |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * Sms Configuration. |
||
| 8 | * |
||
| 9 | * @var null|object |
||
| 10 | */ |
||
| 11 | protected $config = null; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Sms Driver Settings. |
||
| 15 | * |
||
| 16 | * @var null|object |
||
| 17 | */ |
||
| 18 | protected $settings = null; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Sms Driver Name. |
||
| 22 | * |
||
| 23 | * @var null|string |
||
| 24 | */ |
||
| 25 | protected $driver = null; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * SmsManager constructor. |
||
| 29 | */ |
||
| 30 | public function __construct() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Change the driver on the fly. |
||
| 38 | * |
||
| 39 | * @param $driver |
||
| 40 | * @return $this |
||
| 41 | */ |
||
| 42 | public function withDriver($driver) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Send message. |
||
| 52 | * |
||
| 53 | * @param $message |
||
| 54 | * @param $callback |
||
| 55 | * @return mixed |
||
| 56 | * @throws \Exception |
||
| 57 | */ |
||
| 58 | public function send($message, $callback) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Validate Parameters before sending. |
||
| 72 | * |
||
| 73 | * @throws \Exception |
||
| 74 | */ |
||
| 75 | protected function validateParams() |
||
| 88 | } |
||
| 89 |