Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 5 | public function send($notifiable, Notification $notification) |
|
30 | { |
||
31 | 5 | if (! $userIds = $notifiable->routeNotificationFor('OneSignal')) { |
|
32 | 1 | return; |
|
33 | } |
||
34 | |||
35 | /** @var ResponseInterface $response */ |
||
36 | 4 | $response = $this->oneSignal->sendNotificationCustom( |
|
37 | 4 | $this->payload($notifiable, $notification, $userIds) |
|
38 | ); |
||
39 | |||
40 | 4 | if ($response->getStatusCode() !== 200) { |
|
41 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
42 | } |
||
43 | |||
44 | 3 | return $response; |
|
45 | } |
||
46 | |||
52 |