src/Widop/GoogleAnalytics/Service.php
public function query(Query $query)
    {
        $accessToken = $this->getClient()->getAccessToken();
        $uri = $query->build($accessToken);
        $content = $this->getClient()->getHttpAdapter()->getContent($uri);
        $json = json_decode($content, true);

        if (!is_array($json) || isset($json['error'])) {
            throw GoogleAnalyticsException::invalidQuery(isset($json['error']) ? $json['error']['message'] : 'Invalid json');
        }

        return new Response($json);
    }
public function query(Query $query)
    {
        $accessToken = $this->getClient()->getAccessToken();
        $uri = $query->build($accessToken);
        $content = $this->getClient()->getHttpAdapter()->getContent($uri);
        $json = json_decode($content, true);

        if (!is_array($json) || isset($json['error'])) {
            throw GoogleAnalyticsException::invalidQuery(isset($json['error']) ? $json['error']['message'] : 'Invalid json');
        }

        return new Response($json);
    }
public function query ( Query $ query ) { $ accessToken = $ this -> getClient ( ) -> getAccessToken ( ) ; $ uri = $ query -> build ( $ accessToken ) ; $ content = $ this -> getClient ( ) -> getHttpAdapter ( ) -> getContent ( $ uri ) ; $ json = json_decode ( $ content , true ) ; if ( ! is_array ( $ json ) || isset ( $ json [ 'error' ] ) ) { throw GoogleAnalyticsException :: invalidQuery ( isset ( $ json [ 'error' ] ) ? $ json [ 'error' ] [ 'message' ] : 'Invalid json' ) ; } return new Response ( $ json ) ; }
Queries the google analytics service.

@param \Widop\GoogleAnalytics\Query $query The google analytics query.

@throws \Widop\GoogleAnalytics\GoogleAnalyticsException If an error occured when querying the google analytics service.

@return \Widop\GoogleAnalytics\Response The google analytics response.
Queries the google analytics service .