public function decode($frame)
    {
        $payload = Packet::getPayload($frame->data);

        return [
            'event' => $payload['event'] ?? null,
            'data' => $payload['data'] ?? null,
        ];
    }
public function decode($frame)
    {
        $payload = Packet::getPayload($frame->data);

        return [
            'event' => $payload['event'] ?? null,
            'data' => $payload['data'] ?? null,
        ];
    }
public function decode ( $ frame ) { $ payload = Packet :: getPayload ( $ frame -> data ) ; return [ 'event' => $ payload [ 'event' ] ?? null , 'data' => $ payload [ 'data' ] ?? null , ] ; }
Decode message from websocket client.
Define and return payload here.

@param \Swoole\Websocket\Frame $frame

@return array
Decode message from websocket client . Define and return payload here .