| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function send($notifiable, Notification $notification) |
||
| 27 | { |
||
| 28 | /* Confirm the toVodafone method exists before continuing */ |
||
| 29 | if (!method_exists($notification, 'toVodafone')) { |
||
| 30 | throw CouldNotSendNotification::methodDoesNotExist(); |
||
| 31 | } |
||
| 32 | |||
| 33 | $message = $notification->toVodafone($notifiable, $notification); |
||
| 34 | |||
| 35 | /* Check notification uses correct class for this API */ |
||
| 36 | if (!$message instanceof VodafoneMessage) { |
||
| 37 | throw CouldNotSendNotification::incorrectMessageClass(); |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->client->send( |
||
| 41 | $message->from, |
||
| 42 | $notifiable->routeNotificationFor('vodafone'), |
||
| 43 | $message->content |
||
| 44 | ); |
||
| 47 |