protected function writeHeaders()
    {
        if (headers_sent() === false) {
            $status = static::RESPONSE_STATUSES[$this->status];

            header("{$this->request->protocol} {$status}");

            foreach ($this->headers->all() as $key => $value) {
                header("{$key}: {$value}", false);
            }
        }
    }