1 | <?php |
||
8 | class Twilio |
||
9 | { |
||
10 | /** |
||
11 | * @var TwilioService |
||
12 | */ |
||
13 | protected $twilioService; |
||
14 | |||
15 | /** |
||
16 | * Default 'from' from config. |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $from; |
||
20 | |||
21 | /** |
||
22 | * Twilio constructor. |
||
23 | * |
||
24 | * @param TwilioService $twilioService |
||
25 | * @param string $from |
||
26 | */ |
||
27 | 7 | public function __construct(TwilioService $twilioService, $from) |
|
32 | |||
33 | /** |
||
34 | * Send a TwilioMessage to the a phone number. |
||
35 | * |
||
36 | * @param TwilioMessage $message |
||
37 | * @param $to |
||
38 | * @return mixed |
||
39 | * @throws CouldNotSendNotification |
||
40 | */ |
||
41 | 6 | public function sendMessage(TwilioMessage $message, $to) { |
|
52 | |||
53 | 3 | protected function sendSmsMessage($message, $to) |
|
61 | |||
62 | 2 | protected function makeCall($message, $to) |
|
70 | |||
71 | 5 | protected function getFrom($message) |
|
79 | } |
||
80 |