response = $response; $this->data = json_decode($this->response->getBody()->getContents(), false); } public function getData() { return $this->data; } public function success(): bool { return in_array(floor($this->response->getStatusCode() / 100), [2]); } }