Phly\Http\Response\SapiEmitter::emit PHP Method

emit() public method

Emits the status line and headers via the header() function, and the body content via the output buffer.
public emit ( Psr\Http\Message\ResponseInterface $response, null | integer $maxBufferLevel = null )
$response Psr\Http\Message\ResponseInterface
$maxBufferLevel null | integer Maximum output buffering level to unwrap.
    public function emit(ResponseInterface $response, $maxBufferLevel = null)
    {
        if (headers_sent()) {
            throw new RuntimeException('Unable to emit response; headers already sent');
        }
        $this->emitStatusLine($response);
        $this->emitHeaders($response);
        $this->emitBody($response, $maxBufferLevel);
    }