src/SapiServer.php
public function serve(ResponseInterface $response, $cookies = [])
    {
        if (headers_sent($file, $line)) {
            throw new HeadersSentException(
                'Headers already sent in ' . $file . ' on line ' . $line
            );
        }
        $this->triggerEvent('serve', new \Jivoo\Event($this, [
            'response' => $response,
            'cookies' => $cookies
        ]));
        $this->serveStatus($response);
        $this->serveCookies($cookies);
        $this->serveHeaders($response);
        $this->serveBody($response, $this->compression);
        $this->triggerEvent('served', new \Jivoo\Event($this, [
            'response' => $response,
            'cookies' => $cookies
        ]));
    }
public function serve(ResponseInterface $response, $cookies = [])
    {
        if (headers_sent($file, $line)) {
            throw new HeadersSentException(
                'Headers already sent in ' . $file . ' on line ' . $line
            );
        }
        $this->triggerEvent('serve', new \Jivoo\Event($this, [
            'response' => $response,
            'cookies' => $cookies
        ]));
        $this->serveStatus($response);
        $this->serveCookies($cookies);
        $this->serveHeaders($response);
        $this->serveBody($response, $this->compression);
        $this->triggerEvent('served', new \Jivoo\Event($this, [
            'response' => $response,
            'cookies' => $cookies
        ]));
    }
public function serve ( ResponseInterface $ response , $ cookies = [ ] ) { if ( headers_sent ( $ file , $ line ) ) { throw new HeadersSentException ( 'Headers already sent in ' . $ file . ' on line ' . $ line ) ; } $ this -> triggerEvent ( 'serve' , new \ Jivoo \ Event ( $ this , [ 'response' => $ response , 'cookies' => $ cookies ] ) ) ; $ this -> serveStatus ( $ response ) ; $ this -> serveCookies ( $ cookies ) ; $ this -> serveHeaders ( $ response ) ; $ this -> serveBody ( $ response , $ this -> compression ) ; $ this -> triggerEvent ( 'served' , new \ Jivoo \ Event ( $ this , [ 'response' => $ response , 'cookies' => $ cookies ] ) ) ; }
Serve a response.

@param ResponseInterface $response The response.
@param Cookie\ResponseCookie[]|\Traversable $cookies
@throws HeadersSentException If the headers have already been sent.
Serve a response .