| Conditions | 4 |
| Paths | 6 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function send($notifiable, Notification $notification): array |
||
| 41 | { |
||
| 42 | $message = $notification->toFacebook($notifiable); |
||
|
|
|||
| 43 | |||
| 44 | if (is_string($message)) { |
||
| 45 | $message = FacebookMessage::create($message); |
||
| 46 | } |
||
| 47 | |||
| 48 | if ($message->toNotGiven()) { |
||
| 49 | if (! $to = $notifiable->routeNotificationFor('facebook')) { |
||
| 50 | throw CouldNotCreateMessage::recipientNotProvided(); |
||
| 51 | } |
||
| 52 | |||
| 53 | $message->to($to); |
||
| 54 | } |
||
| 55 | |||
| 56 | $response = $this->fb->send($message->toArray()); |
||
| 57 | |||
| 58 | return json_decode($response->getBody()->getContents(), true); |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
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.