We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 12 | class CentrifugoBroadcaster extends Broadcaster |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * The Centrifugo SDK instance. |
||
| 16 | * |
||
| 17 | * @var Contracts\CentrifugoInterface |
||
| 18 | */ |
||
| 19 | protected $centrifugo; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Create a new broadcaster instance. |
||
| 23 | * |
||
| 24 | * @param Centrifugo $centrifugo |
||
| 25 | */ |
||
| 26 | public function __construct(Centrifugo $centrifugo) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Authenticate the incoming request for a given channel. |
||
| 33 | * |
||
| 34 | * @param \Illuminate\Http\Request $request |
||
| 35 | * @return mixed |
||
| 36 | */ |
||
| 37 | public function auth($request) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Return the valid authentication response. |
||
| 64 | * |
||
| 65 | * @param \Illuminate\Http\Request $request |
||
| 66 | * @param mixed $result |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | public function validAuthenticationResponse($request, $result) |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Broadcast the given event. |
||
| 76 | * |
||
| 77 | * @param array $channels |
||
| 78 | * @param string $event |
||
| 79 | * @param array $payload |
||
| 80 | * @return void |
||
| 81 | */ |
||
| 82 | public function broadcast(array $channels, $event, array $payload = []) |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Get client from request. |
||
| 99 | * |
||
| 100 | * @param \Illuminate\Http\Request $request |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | private function getClientFromRequest($request) |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Get channels from request. |
||
| 110 | * |
||
| 111 | * @param \Illuminate\Http\Request $request |
||
| 112 | * @return array |
||
| 113 | */ |
||
| 114 | private function getChannelsFromRequest($request) |
||
| 120 | |||
| 121 | /** |
||
| 122 | * Get channel name without $ symbol (if present). |
||
| 123 | * |
||
| 124 | * @param string $channel |
||
| 125 | * @return string |
||
| 126 | */ |
||
| 127 | private function getChannelName(string $channel) |
||
| 131 | |||
| 132 | /** |
||
| 133 | * Make response for client, based on access rights. |
||
| 134 | * |
||
| 135 | * @param bool $access_granted |
||
| 136 | * @param string $client |
||
| 137 | * @return array |
||
| 138 | */ |
||
| 139 | private function makeResponseForClient(bool $access_granted, string $client) |
||
| 150 | } |
||
| 151 |
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: