public function parseJSON(Response $response) { $code = $response->getStatusCode(); if ($code >= 200 && $code < 300) { $body = (string) $response->getBody(); return \Airship\parseJSON($body, true); } throw new TransferException(); }