Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.243 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 1 | public function send($notifiable, Notification $notification) |
|
29 | { |
||
30 | 1 | $message = $notification->toAfricasTalking($notifiable); |
|
|
|||
31 | |||
32 | 1 | if (! $phoneNumber = $notifiable->routeNotificationFor('africasTalking')) { |
|
33 | $phoneNumber = $notifiable->phone_number; |
||
34 | } |
||
35 | |||
36 | try { |
||
37 | 1 | $this->africasTalking->send([ |
|
38 | 1 | 'to' => $phoneNumber, |
|
39 | 1 | 'message' => $message->getContent(), |
|
40 | 1 | 'from' => $message->getSender(), |
|
41 | ]); |
||
42 | } catch (Exception $e) { |
||
43 | throw CouldNotSendNotification::serviceRespondedWithAnError($e->getMessage()); |
||
44 | } |
||
47 |