| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 3 | public function send($notifiable, Notification $notification) |
|
| 23 | { |
||
| 24 | 3 | $message = $notification->toJetSms($notifiable); |
|
| 25 | |||
| 26 | 3 | if ($message instanceof ShortMessage) { |
|
| 27 | 1 | JetSms::sendShortMessage($message); |
|
| 28 | |||
| 29 | 1 | return; |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | $to = $notifiable->routeNotificationFor('JetSms'); |
|
| 33 | |||
| 34 | 2 | if (empty($to)) { |
|
| 35 | 1 | throw CouldNotSendNotification::missingRecipient(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | JetSms::sendShortMessage($to, $message); |
|
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |