public static function decode($json, $assoc = false, $options = 0)
    {
        if (!is_string($json)) {
            throw new \InvalidArgumentException('Argument json is not a string');
        }
        $result = json_decode($json, (bool) $assoc, 512, (int) $options);
        if ($result === null) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }

        return $result;
    }