public function decode($frame)
    {
        $data = json_decode($frame->data, true);

        return [
            'event' => $data['event'] ?? null,
            'data' => $data['data'] ?? null,
        ];
    }
public function decode($frame)
    {
        $data = json_decode($frame->data, true);

        return [
            'event' => $data['event'] ?? null,
            'data' => $data['data'] ?? null,
        ];
    }
public function decode ( $ frame ) { $ data = json_decode ( $ frame -> data , true ) ; return [ 'event' => $ data [ 'event' ] ?? null , 'data' => $ data [ 'data' ] ?? null , ] ; }
Input message on websocket connected.
Define and return event name and payload data here.

@param \Swoole\Websocket\Frame $frame

@return array
Input message on websocket connected . Define and return event name and payload data here .