src/Json.php
public static function encode($data, $options = 0, $depth = 512)
    {
        if (!is_array($data)) {
            throw new PacketException('The packet data is invalid. Must be a array.');
        }

        return json_encode($data, $options, $depth);
    }
public static function encode($data, $options = 0, $depth = 512)
    {
        if (!is_array($data)) {
            throw new PacketException('The packet data is invalid. Must be a array.');
        }

        return json_encode($data, $options, $depth);
    }
@param     $data

@param int $options
@param int $depth

@return string
@throws \Uniondrug\Packet\Exceptions\PacketException