Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 3 | public function send($notifiable, Notification $notification) |
|
29 | { |
||
30 | 3 | if (! $to = $notifiable->routeNotificationFor('Pushmix')) { |
|
31 | 1 | return; |
|
32 | } |
||
33 | |||
34 | 2 | $parameters = $notification->/* @scrutinizer ignore-call */toPushmix($to)->toArray(); |
|
35 | |||
36 | // initialize subscription key and api url |
||
37 | 2 | $this->pusmixClient->initKey()->initApiUrl(); |
|
38 | |||
39 | // Call with parameters |
||
40 | try { |
||
41 | 2 | return $this->pusmixClient->sendNotification($parameters); |
|
42 | 1 | } catch (RequestException $e) { |
|
43 | 1 | throw CouldNotSendNotification::error($e); |
|
44 | } |
||
49 |