src/Json.php
public static function decode($data, $assoc = false)
    {
        $json = json_decode($data, $assoc);
        if (json_last_error()) {
            throw new PacketException(json_last_error_msg());
        }

        return $json;
    }
public static function decode($data, $assoc = false)
    {
        $json = json_decode($data, $assoc);
        if (json_last_error()) {
            throw new PacketException(json_last_error_msg());
        }

        return $json;
    }
@param      $data
@param bool $assoc

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