| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.5069 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 1 | public function send($notifiable, Notification $notification) |
|
| 30 | { |
||
| 31 | 1 | if (!$userIds = $notifiable->routeNotificationFor('OneSignal')) { |
|
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | 1 | $payload = $notification->toOneSignal($notifiable)->toArray(); |
|
|
|
|||
| 36 | 1 | if (is_array($userIds) && array_key_exists('email', $userIds)) { |
|
| 37 | $payload['filters'] = collect([["field" => "email", "value" => $userIds['email']]]); |
||
| 38 | } else { |
||
| 39 | 1 | $payload['include_player_ids'] = collect($userIds); |
|
| 40 | } |
||
| 41 | |||
| 42 | /** @var ResponseInterface $response */ |
||
| 43 | 1 | $response = $this->oneSignal->sendNotificationCustom($payload); |
|
| 44 | 1 | if ($response->getStatusCode() !== 200) { |
|
| 45 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
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.