protected function parseResponse(Response $response)
    {
        if ($response->getStatusCode() > 199 && $response->getStatusCode() < 299) {
            if ($body = json_decode($response->getBody()->getContents(), 1)) {
                return new Collection($body);
            }
        }

        return new Collection;
    }
protected function parseResponse(Response $response)
    {
        if ($response->getStatusCode() > 199 && $response->getStatusCode() < 299) {
            if ($body = json_decode($response->getBody()->getContents(), 1)) {
                return new Collection($body);
            }
        }

        return new Collection;
    }
protected function parseResponse ( Response $ response ) { if ( $ response -> getStatusCode ( ) > 199 && $ response -> getStatusCode ( ) < 299 ) { if ( $ body = json_decode ( $ response -> getBody ( ) -> getContents ( ) , 1 ) ) { return new Collection ( $ body ) ; } } return new Collection ; }
Prases a response and returns a collection or item

@param Response $response
@return Collection
Prases a response and returns a collection or item