1 | <?php |
||
22 | class Broadcast |
||
23 | { |
||
24 | protected static $channels = []; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | public static $yiiAlias = '@app/..'; |
||
30 | |||
31 | /** |
||
32 | * Subscribe to event from client |
||
33 | * |
||
34 | * @param string $event |
||
35 | * @param array $data |
||
36 | * |
||
37 | * @throws Exception |
||
38 | */ |
||
39 | public static function on(string $event, array $data) |
||
59 | |||
60 | /** |
||
61 | * Handle process from client |
||
62 | * |
||
63 | * @param string $handler |
||
64 | * @param array $data |
||
65 | */ |
||
66 | public static function process(string $handler, array $data) |
||
88 | |||
89 | /** |
||
90 | * Emit event to client |
||
91 | * |
||
92 | * @param string $event |
||
93 | * @param array $data |
||
94 | * |
||
95 | * @throws Exception |
||
96 | */ |
||
97 | public static function emit(string $event, array $data) |
||
133 | |||
134 | /** |
||
135 | * Prepare channel name |
||
136 | * |
||
137 | * @param $name |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public static function channelName($name) |
||
145 | |||
146 | /** |
||
147 | * Publish data to redis channel |
||
148 | * |
||
149 | * @param string $channel |
||
150 | * @param array $data |
||
151 | */ |
||
152 | public static function publish(string $channel, array $data) |
||
156 | |||
157 | /** |
||
158 | * Redis channels names |
||
159 | * |
||
160 | * @return array |
||
161 | */ |
||
162 | public static function channels(): array |
||
178 | |||
179 | /** |
||
180 | * @return RedisDriver |
||
181 | */ |
||
182 | public static function getDriver() |
||
186 | |||
187 | /** |
||
188 | * @return EventManager |
||
189 | */ |
||
190 | public static function getManager() |
||
194 | } |
||
195 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.