public function parse(Response $response) { if ($response->getStatusCode() !== 200) { return false; } $jsonResponse = $response->getBody()->getContents(); $jsonapi = new JsonManager(); try { $parsed = $jsonapi->parse($jsonResponse); } catch (ValidationException $e) { return false; } return $parsed; }