コード例 #1
0
 /**
  * @param mixed $response
  *
  * @return string|array|\Neoxygen\NeoClient\Formatter\Response
  *
  * @throws Neo4jException
  */
 public function handleHttpResponse(Response $response)
 {
     $this->checkResponseErrors($response->getBody());
     if ($this->autoFormatResponse) {
         $formatted = $this->formatResponse($response->getBody());
         $response->setResult($formatted->getResult());
         $response->setRows($formatted->geRows());
     }
     return $response;
 }
コード例 #2
0
 /**
  * @param Response $response
  *
  * @return string|array|\Neoxygen\NeoClient\Formatter\Response
  *
  * @throws Neo4jException
  */
 public function handleHttpResponse(Response $response)
 {
     if ($this->newFormatModeEnabled) {
         $newResponse = $this->newFormattingService->formatResponse($response->getRaw());
         if ($newResponse->hasError()) {
             $error = $newResponse->getError();
             throw new Neo4jException(sprintf($error->getCode(), $error->getMessage(), Neo4jException::fromCode($error->getCode())));
         }
         return $newResponse;
     }
     $this->checkResponseErrors($response->getBody());
     if ($this->autoFormatResponse) {
         $formatted = $this->formatResponse($response->getBody());
         $response->setResult($formatted->getResult());
         $response->setRows($formatted->geRows());
     }
     return $response;
 }