original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Checks request response and dispatch result to appropriate handler.
  
  @param ResponseInterface $request
  
  @return \Exception|mixed
docstring_tokens: Checks request response and dispatch result to appropriate handler .