| Total Complexity | 5 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class SocketIOParser extends Parser |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Strategy classes need to implement handle method. |
||
| 15 | */ |
||
| 16 | protected $strategies = [ |
||
| 17 | HeartbeatStrategy::class, |
||
| 18 | ]; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Encode output payload for websocket push. |
||
| 22 | * |
||
| 23 | * @param string $event |
||
| 24 | * @param mixed $data |
||
| 25 | * |
||
| 26 | * @return mixed |
||
| 27 | */ |
||
| 28 | public function encode(string $event, $data) |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Decode message from websocket client. |
||
| 40 | * Define and return payload here. |
||
| 41 | * |
||
| 42 | * @param \Swoole\Websocket\Frame $frame |
||
| 43 | * |
||
| 44 | * @return array |
||
| 45 | */ |
||
| 46 | public function decode($frame) |
||
| 56 |