Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.054 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 1 | public function send($notifiable, Notification $notification) |
|
32 | { |
||
33 | 1 | $interest = $notifiable->routeNotificationFor('PusherPushNotifications') |
|
34 | 1 | ?: $this->interestName($notifiable); |
|
35 | |||
36 | 1 | $response = $this->pusher->notify( |
|
37 | 1 | $interest, |
|
38 | 1 | $notification->toPushNotification($notifiable)->toArray(), |
|
39 | true |
||
40 | 1 | ); |
|
41 | |||
42 | 1 | if (! in_array($response['status'], [200, 202])) { |
|
43 | event(new NotificationFailed($notifiable, $notification, $response)); |
||
|
|||
44 | } |
||
45 | 1 | } |
|
46 | |||
61 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: