status_code = $code; } public function redirect(string $url): void { $this->addHeader("Location: $url"); } public function addHeader(string $header): void { $this->headers[] = $header; } public function setBody(string $body) : void { $this->body=$body; } public function getBody() : string { return $this->body; } public function send() : void { if($this->status_code) { http_response_code( $this->status_code ); } foreach ($this->headers as $header) { header($header); } echo $this->body; } }