public function send()
    {
        // Check if headers are sent already.
        if (headers_sent() === false) {

            // Determine reason phrase
            if ($this->reasonPhrase === null) {
                $this->reasonPhrase = self::$messages[$this->statusCode];
            }

            // Send status code.
            header(sprintf('%s %s', $this->protocolVersion, $this->reasonPhrase), true, $this->statusCode);

            // Send headers.
            foreach ($this->headers as $header => $value) {
                header(sprintf('%s: %s', $header, $value), true, $this->statusCode);
            }

            // Send cookies.
            foreach ($this->cookies as $cookie) {
                setcookie($cookie['name'], $cookie['value'], $cookie['expire'],
                    $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly']);
            }

            // Send body.
            echo $this->body;
        }

        return $this;
    }