Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function send($notifiable, Notification $notification) |
||
32 | { |
||
33 | $interest = $notifiable->routeNotificationFor('PusherPushNotifications') |
||
34 | ?: $this->interestName($notifiable); |
||
35 | |||
36 | $response = $this->pusher->notify( |
||
37 | $interest, |
||
38 | $notification->toPushNotification($notifiable)->toArray(), |
||
39 | true |
||
40 | ); |
||
41 | |||
42 | if (! in_array($response['status'], [200, 202])) { |
||
43 | throw CouldNotSendNotification::pusherRespondedWithAnError($response); |
||
|
|||
44 | } |
||
45 | } |
||
46 | |||
61 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.