public function processResourceRequestResponse(ResponseInterface $request)
    {
        $response = json_decode($request->getBody()->getContents());

        if (Response::HTTP_OK !== $request->getStatusCode() && Response::HTTP_CREATED !== $request->getStatusCode()) {
            return ExceptionHandler::handle(get_class($this), $response, $request->getStatusCode());
        }

        return (isset($response->data)) ? json_decode(json_encode($response->data), true) : json_decode(json_encode($response), true);
    }
public function processResourceRequestResponse(ResponseInterface $request)
    {
        $response = json_decode($request->getBody()->getContents());

        if (Response::HTTP_OK !== $request->getStatusCode() && Response::HTTP_CREATED !== $request->getStatusCode()) {
            return ExceptionHandler::handle(get_class($this), $response, $request->getStatusCode());
        }

        return (isset($response->data)) ? json_decode(json_encode($response->data), true) : json_decode(json_encode($response), true);
    }
public function processResourceRequestResponse ( ResponseInterface $ request ) { $ response = json_decode ( $ request -> getBody ( ) -> getContents ( ) ) ; if ( Response :: HTTP_OK !== $ request -> getStatusCode ( ) && Response :: HTTP_CREATED !== $ request -> getStatusCode ( ) ) { return ExceptionHandler :: handle ( get_class ( $ this ) , $ response , $ request -> getStatusCode ( ) ) ; } return ( isset ( $ response -> data ) ) ? json_decode ( json_encode ( $ response -> data ) , true ) : json_decode ( json_encode ( $ response ) , true ) ; }
Checks request response and dispatch result to appropriate handler.

@param ResponseInterface $request

@return \Exception|mixed
Checks request response and dispatch result to appropriate handler .