\Zend\Diactoros\ResponseSapiEmitterTrait

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
assertNoPreviousOutput()
emitStatusLine()
emitHeaders()
filterHeader()
No private properties found
N/A

Methods

assertNoPreviousOutput()

assertNoPreviousOutput() 

Checks to see if content has previously been sent.

If either headers have been sent or the output buffer contains content, raises an exception.

Throws

\RuntimeException

if headers have already been sent.

\RuntimeException

if output is present in the output buffer.

emitStatusLine()

emitStatusLine(\Psr\Http\Message\ResponseInterface  $response) 

Emit the status line.

Emits the status line using the protocol version and status code from the response; if a reason phrase is available, it, too, is emitted.

It is important to mention that this method should be called after emitHeaders() in order to prevent PHP from changing the status code of the emitted response.

Parameters

\Psr\Http\Message\ResponseInterface $response

emitHeaders()

emitHeaders(\Psr\Http\Message\ResponseInterface  $response) 

Emit response headers.

Loops through each header, emitting each; if the header value is an array with multiple values, ensures that each is sent in such a way as to create aggregate headers (instead of replace the previous).

Parameters

\Psr\Http\Message\ResponseInterface $response

filterHeader()

filterHeader(string  $header) : string

Filter a header name to wordcase

Parameters

string $header

Returns

string