code = $code; $this->headers = $headers; $this->body = $body; } /** * To string. * * @return string */ public function __toString() { return \json_encode([ 'code' => $this->code, 'headers' => $this->headers, 'body' => $this->body, ]); } /** * Set code. * * @param int $code Response code. */ public function setCode($code) { $this->code = (int) $code; } /** * Set headers. * * @param array $headers Response headers. */ public function setHeaders($headers) { $this->headers = $headers; } /** * Set body. * * @param string $body Response body. */ public function setBody($body) { $this->body = $body; } /** * Get code. * * @return int */ public function getCode() { return $this->code; } /** * Get headers. * * @return array $headers Response headers. */ public function getHeaders() { return $this->headers; } /** * Get body. * * @return string $body Response body. */ public function getBody() { return $this->body; } }