SapiEmitterTrait
Table of Contents
Methods
- assertNoPreviousOutput() : void
- Checks to see if content has previously been sent.
- emitHeaders() : void
- Emit response headers.
- emitStatusLine() : void
- Emit the status line.
- filterHeader() : string
- Filter a header name to wordcase
- header() : void
- headersSent() : bool
Methods
assertNoPreviousOutput()
Checks to see if content has previously been sent.
private
assertNoPreviousOutput() : void
If either headers have been sent or the output buffer contains content, raises an exception.
Tags
emitHeaders()
Emit response headers.
private
emitHeaders(ResponseInterface $response) : void
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
- $response : ResponseInterface
emitStatusLine()
Emit the status line.
private
emitStatusLine(ResponseInterface $response) : void
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
- $response : ResponseInterface
Tags
filterHeader()
Filter a header name to wordcase
private
filterHeader(string $header) : string
Parameters
- $header : string
Return values
stringheader()
private
header(string $headerName, bool $replace, int $statusCode) : void
Parameters
- $headerName : string
- $replace : bool
- $statusCode : int
headersSent()
private
headersSent([string|null &$filename = null ][, int|null &$line = null ]) : bool
Parameters
- $filename : string|null = null
- $line : int|null = null