Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | protected function broadcastEventForAppToChannel($appId, $channelName, $event, $data, $socketId = null): void |
||
8 | { |
||
9 | $channel = $this->channelManager->find($appId, $channelName); |
||
|
|||
10 | |||
11 | optional($channel)->broadcastToEveryoneExcept([ |
||
12 | 'channel' => $channelName, |
||
13 | 'event' => $event, |
||
14 | 'data' => $data, |
||
15 | ], $socketId); |
||
16 | |||
17 | DashboardLogger::apiMessage( |
||
18 | $appId, |
||
19 | $channelName, |
||
20 | $event, |
||
21 | $data |
||
22 | ); |
||
23 | |||
24 | StatisticsLogger::apiMessage($appId); |
||
25 | } |
||
26 | } |
||
27 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: