1 | <?php |
||
10 | class PusherChannel |
||
11 | { |
||
12 | /** |
||
13 | * @var \Pusher\PushNotifications\PushNotifications $pusher |
||
14 | */ |
||
15 | protected $pusher; |
||
16 | |||
17 | /** |
||
18 | * @var \Illuminate\Events\Dispatcher |
||
19 | */ |
||
20 | private $events; |
||
21 | |||
22 | /** |
||
23 | * @param \Pusher\PushNotifications\PushNotifications $pusher |
||
24 | * @param \Illuminate\Events\Dispatcher |
||
25 | */ |
||
26 | 2 | public function __construct(PushNotifications $pusher, Dispatcher $events) |
|
31 | |||
32 | /** |
||
33 | * Send the given notification. |
||
34 | * |
||
35 | * @param mixed $notifiable |
||
36 | * @param \Illuminate\Notifications\Notification $notification |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | 2 | public function send($notifiable, Notification $notification) |
|
60 | |||
61 | /** |
||
62 | * Get the interest name for the notifiable. |
||
63 | * |
||
64 | * @param $notifiable |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function interestName($notifiable) |
||
74 | } |
||
75 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.