public function __construct($request, $response) { $this->request = $request; if ($response) { $this->rawResponse = $response; $this->status = $response->getStatusCode(); $this->body = $this->decodeBody($response->getBody()); $this->success = floor($this->status / 100) == 2 ? true : false; } }