private static function _fromJson(&$json)
    {
        $fields = json_decode($json);

        if (is_null($fields)) {
            throw new UnexpectedResponseException(
                json_last_error_msg(),
                $json
            );
        }

        return $fields;
    }
private static function _fromJson(&$json)
    {
        $fields = json_decode($json);

        if (is_null($fields)) {
            throw new UnexpectedResponseException(
                json_last_error_msg(),
                $json
            );
        }

        return $fields;
    }
private static function _fromJson ( & $ json ) { $ fields = json_decode ( $ json ) ; if ( is_null ( $ fields ) ) { throw new UnexpectedResponseException ( json_last_error_msg ( ) , $ json ) ; } return $ fields ; }
Attempts to parse the given JSON blob into an object.

Uses `json_decode`. If parse fails then an exception is thrown.

@param string $json the JSON text

@return object an object as returned by `json_decode`
Attempts to parse the given JSON blob into an object .