| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 2 | public function send($notifiable, Notification $notification) |
|
| 27 | { |
||
| 28 | /** @var PusherApiMessage $pusherApiMessage */ |
||
| 29 | 2 | $pusherApiMessage = $notification->toApiNotification($notifiable); |
|
|
|
|||
| 30 | |||
| 31 | 2 | $message = $pusherApiMessage->toArray(); |
|
| 32 | |||
| 33 | 2 | $response = $this->pusher::trigger( |
|
| 34 | 2 | $message['channels'], |
|
| 35 | 2 | $message['event'], |
|
| 36 | 2 | $message['data'], |
|
| 37 | 2 | $message['socketId'] ?? null, |
|
| 38 | 2 | $message['debug'] ?? false, |
|
| 39 | 2 | $message['alreadyEncoded'] ?? false |
|
| 40 | ); |
||
| 41 | |||
| 42 | 2 | if (! $response) { |
|
| 43 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
| 44 | } |
||
| 47 |