| Conditions | 4 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function send($notifiable, Notification $notification) |
||
| 25 | { |
||
| 26 | if (!$to = $notifiable->routeNotificationFor('raygansms')) { |
||
| 27 | return; |
||
| 28 | } |
||
| 29 | |||
| 30 | $message = $notification->{'toRayganSms'}($notifiable); |
||
| 31 | |||
| 32 | try { |
||
| 33 | if ($message->type == 'txt') { |
||
| 34 | RayganSms::sendMessage($to, $message->content); |
||
| 35 | } else { |
||
| 36 | RayganSms::sendAuthCode($to, $message->content, $message->autoGenerate); |
||
| 37 | } |
||
| 38 | } catch (DomainException $e) { |
||
| 39 | throw CouldNotSendNotification::serviceRespondedWithAnError($e); |
||
| 40 | } |
||
| 43 |