| Conditions | 5 |
| Paths | 16 |
| Total Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6.4704 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 2 | public function send($notifiable, Notification $notification) |
|
| 32 | { |
||
| 33 | 2 | $message = $notification->toMessagebird($notifiable); |
|
|
|
|||
| 34 | |||
| 35 | 2 | $response = []; |
|
| 36 | |||
| 37 | 2 | if (is_string($message)) { |
|
| 38 | 1 | $message = MessagebirdMessage::create($message); |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | if ($to = $notifiable->routeNotificationFor('messagebird')) { |
|
| 42 | 2 | $message->setRecipients($to); |
|
| 43 | } |
||
| 44 | |||
| 45 | try { |
||
| 46 | 2 | $response = $this->client->send($message); |
|
| 47 | |||
| 48 | 2 | if ($this->dispatcher !== null) { |
|
| 49 | 2 | $this->dispatcher->dispatch('messagebird-sms', [$notifiable, $notification, $response]); |
|
| 50 | } |
||
| 51 | } catch (CouldNotSendNotification $e) { |
||
| 52 | $this->dispatcher->dispatch( |
||
| 53 | new NotificationFailed( |
||
| 54 | $notifiable, |
||
| 55 | $notification, |
||
| 56 | 'messagebird-sms', |
||
| 57 | $e->getMessage() |
||
| 58 | ) |
||
| 59 | ); |
||
| 60 | } |
||
| 61 | |||
| 62 | 2 | return $response; |
|
| 63 | } |
||
| 64 | } |
||
| 65 |
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.