Conditions | 5 |
Paths | 9 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.1502 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | 2 | public function send($notifiable, Notification $notification) |
|
51 | { |
||
52 | 2 | if (! $to = $notifiable->routeNotificationFor('AllMySms', $notification)) { |
|
53 | return; |
||
54 | } |
||
55 | |||
56 | 2 | if (! empty($this->to)) { |
|
57 | $to = $this->to; |
||
58 | } |
||
59 | |||
60 | 2 | $message = $notification->toAllMySms($notifiable); |
|
|
|||
61 | |||
62 | 2 | if (is_string($message)) { |
|
63 | 2 | $message = new AllMySmsMessage($message); |
|
64 | } |
||
65 | |||
66 | 2 | $response = $this->client->sendSms($to, $message->toArray(), $this->sender); |
|
67 | |||
68 | 2 | if ($response->getStatusCode() !== 200) { |
|
69 | 2 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
70 | } |
||
73 |