1 | <?php |
||
13 | class RedisPusherBroadcaster extends Broadcaster |
||
14 | { |
||
15 | use UsePusherChannelConventions; |
||
16 | |||
17 | /** |
||
18 | * The Pusher SDK instance. |
||
19 | * |
||
20 | * @var \Pusher\Pusher |
||
21 | */ |
||
22 | protected $pusher; |
||
23 | |||
24 | /** |
||
25 | * The Pusher app ID, to be passed in the payload. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $appId; |
||
30 | |||
31 | /** |
||
32 | * The Redis instance. |
||
33 | * |
||
34 | * @var \Illuminate\Contracts\Redis\Factory |
||
35 | */ |
||
36 | protected $redis; |
||
37 | |||
38 | /** |
||
39 | * The Redis connection to use for broadcasting. |
||
40 | * |
||
41 | * @var string|null |
||
42 | */ |
||
43 | protected $connection; |
||
44 | |||
45 | /** |
||
46 | * Create a new broadcaster instance. |
||
47 | * |
||
48 | * @param Pusher $pusher |
||
49 | * @param string $appId |
||
50 | * @param \Illuminate\Contracts\Redis\Factory $redis |
||
51 | * @param string|null $connection |
||
52 | */ |
||
53 | public function __construct(Pusher $pusher, string $appId, Redis $redis, $connection = null) |
||
60 | |||
61 | /** |
||
62 | * Authenticate the incoming request for a given channel. |
||
63 | * |
||
64 | * @param \Illuminate\Http\Request $request |
||
65 | * @return mixed |
||
66 | * |
||
67 | * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException |
||
68 | */ |
||
69 | public function auth($request) |
||
82 | |||
83 | /** |
||
84 | * Return the valid authentication response. |
||
85 | * |
||
86 | * @param \Illuminate\Http\Request $request |
||
87 | * @param mixed $result |
||
88 | * @return mixed |
||
89 | * @throws \Pusher\PusherException |
||
90 | */ |
||
91 | public function validAuthenticationResponse($request, $result) |
||
109 | |||
110 | /** |
||
111 | * Decode the given Pusher response. |
||
112 | * |
||
113 | * @param \Illuminate\Http\Request $request |
||
114 | * @param mixed $response |
||
115 | * @return array |
||
116 | */ |
||
117 | protected function decodePusherResponse($request, $response) |
||
126 | |||
127 | /** |
||
128 | * Broadcast the given event. |
||
129 | * |
||
130 | * @param array $channels |
||
131 | * @param string $event |
||
132 | * @param array $payload |
||
133 | * @return void |
||
134 | */ |
||
135 | public function broadcast(array $channels, $event, array $payload = []) |
||
150 | } |
||
151 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.