| Conditions | 6 |
| Paths | 16 |
| Total Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function send($notifiable, Notification $notification) |
||
| 32 | { |
||
| 33 | $message = $notification->toSms77($notifiable); |
||
|
|
|||
| 34 | |||
| 35 | // No SMS77Message object was returned |
||
| 36 | if (is_string($message)) { |
||
| 37 | $message = SMS77Message::create($message); |
||
| 38 | } |
||
| 39 | |||
| 40 | if (! $message->hasToNumber()) { |
||
| 41 | if (! $to = $notifiable->phone_number) { |
||
| 42 | $to = $notifiable->routeNotificationFor('sms'); |
||
| 43 | } |
||
| 44 | |||
| 45 | if (! $to) { |
||
| 46 | throw CouldNotSendNotification::phoneNumberNotProvided(); |
||
| 47 | } |
||
| 48 | |||
| 49 | $message->to($to); |
||
| 50 | } |
||
| 51 | |||
| 52 | $params = $message->toArray(); |
||
| 53 | |||
| 54 | if ($message instanceof SMS77Message) { |
||
| 55 | $response = $this->sms77->sendMessage($params); |
||
| 56 | } else { |
||
| 57 | return; |
||
| 58 | } |
||
| 59 | |||
| 60 | return json_decode($response->getBody()->getContents(), true); |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.