Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | 2 | public function send($notifiable, Notification $notification) |
|
40 | { |
||
41 | 2 | $interest = $notifiable->routeNotificationFor('PusherPushNotifications') |
|
42 | 2 | ?: $this->interestName($notifiable); |
|
43 | |||
44 | 2 | $response = $this->pusher->notify( |
|
45 | 2 | $interest, |
|
46 | 2 | $notification->toPushNotification($notifiable)->toArray(), |
|
47 | true |
||
48 | 2 | ); |
|
49 | |||
50 | 2 | if (! in_array($response['status'], [200, 202])) { |
|
51 | 1 | $this->events->fire( |
|
52 | 1 | new NotificationFailed($notifiable, $notification, $response) |
|
|
|||
53 | 1 | ); |
|
54 | 1 | } |
|
55 | 2 | } |
|
56 | |||
71 |
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: