| 1 | <?php |
||
| 5 | class SmsManager |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Sms Configuration. |
||
| 9 | * |
||
| 10 | * @var null|object |
||
| 11 | */ |
||
| 12 | protected $config = null; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Sms Driver Settings. |
||
| 16 | * |
||
| 17 | * @var null|object |
||
| 18 | */ |
||
| 19 | protected $settings = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Sms Driver Name. |
||
| 23 | * |
||
| 24 | * @var null|string |
||
| 25 | */ |
||
| 26 | protected $driver = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * SmsManager constructor. |
||
| 30 | */ |
||
| 31 | public function __construct() |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Change the driver on the fly. |
||
| 40 | * |
||
| 41 | * @param $driver |
||
| 42 | * @return $this |
||
| 43 | */ |
||
| 44 | public function with($driver) { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Send message. |
||
| 53 | * |
||
| 54 | * @param $message |
||
| 55 | * @param $callback |
||
| 56 | * @return mixed |
||
| 57 | * @throws \Exception |
||
| 58 | */ |
||
| 59 | public function send($message, $callback) { |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Validate Parameters before sending. |
||
| 72 | */ |
||
| 73 | protected function validateParams() |
||
| 86 | |||
| 87 | } |
||
| 88 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: