/** * Sends the headers of the response to the client. * * @return void */ protected function sendHeaders() { if (!headers_sent()) { $status = $this->response->getMessage() ?: $this->response->getStatus(); header(sprintf("%s %s", $this->response->getProtocol(), $status)); foreach ($this->response->getHeaders() as $name => $value) { header("{$name}: {$value}", true); } foreach ($this->response->getCookies() as $cookie) { header("Set-Cookie: {$cookie}", false); } } }