We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
13 | class CentrifugoBroadcaster extends Broadcaster |
||
14 | { |
||
15 | /** |
||
16 | * The Centrifugo SDK instance. |
||
17 | * |
||
18 | * @var Contracts\CentrifugoInterface |
||
19 | */ |
||
20 | protected $centrifugo; |
||
21 | |||
22 | /** |
||
23 | * Create a new broadcaster instance. |
||
24 | * |
||
25 | * @param Centrifugo $centrifugo |
||
26 | */ |
||
27 | public function __construct(Centrifugo $centrifugo) |
||
31 | |||
32 | /** |
||
33 | * Authenticate the incoming request for a given channel. |
||
34 | * |
||
35 | * @param \Illuminate\Http\Request $request |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function auth($request) |
||
64 | |||
65 | /** |
||
66 | * Return the valid authentication response. |
||
67 | * |
||
68 | * @param \Illuminate\Http\Request $request |
||
69 | * @param mixed $result |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function validAuthenticationResponse($request, $result) |
||
76 | |||
77 | /** |
||
78 | * Broadcast the given event. |
||
79 | * |
||
80 | * @param array $channels |
||
81 | * @param string $event |
||
82 | * @param array $payload |
||
83 | * @return void |
||
84 | */ |
||
85 | public function broadcast(array $channels, $event, array $payload = []) |
||
99 | |||
100 | /** |
||
101 | * Get client from request. |
||
102 | * |
||
103 | * @param \Illuminate\Http\Request $request |
||
104 | * @return string |
||
105 | */ |
||
106 | private function getClientFromRequest($request) |
||
110 | |||
111 | /** |
||
112 | * Get channels from request. |
||
113 | * |
||
114 | * @param \Illuminate\Http\Request $request |
||
115 | * @return array |
||
116 | */ |
||
117 | private function getChannelsFromRequest($request) |
||
123 | |||
124 | /** |
||
125 | * Get channel name without $ symbol (if present). |
||
126 | * |
||
127 | * @param string $channel |
||
128 | * @return string |
||
129 | */ |
||
130 | private function getChannelName(string $channel) |
||
134 | |||
135 | /** |
||
136 | * Make response for client, based on access rights. |
||
137 | * |
||
138 | * @param bool $access_granted |
||
139 | * @param string $client |
||
140 | * @return array |
||
141 | */ |
||
142 | private function makeResponseForClient(bool $access_granted, string $client) |
||
153 | |||
154 | private function makeResponseForPrivateChannel(bool $access_granted, string $client, string $channel): array |
||
163 | |||
164 | private function isPrivateChannel(string $channel): bool |
||
168 | } |
||
169 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: