/** * @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; }
/** * @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; }