Documentation

ResponseEmitterAbstract
in package
implements ResponseEmitterInterface

AbstractYes
Tags
see
https://datatracker.ietf.org/doc/html/rfc2616
see
https://datatracker.ietf.org/doc/html/rfc9110

Table of Contents

Interfaces

ResponseEmitterInterface

Properties

$body  : StreamInterface
$bufferSize  : int
$hasContentRange  : bool
$hasCustomLength  : bool
$rangeLength  : int
$rangeStart  : int
$response  : ResponseInterface

Methods

__construct()  : mixed
ResponseEmitter constructor
emitBody()  : void
emits the body of the given response with respect to the parameters given in content-range and content-length headers
emitBodyRange()  : void
emits a part of the body
emitBuffer()  : void
emits the given buffer
getStatusLine()  : string
Returns a full status line for the given response, e.g. "HTTP/1.1 200 OK"
hasBody()  : bool
Checks whether the response has (or is supposed to have) a body
parseContentRange()  : array{0: int, 1: int, 2: int|null, 3: int}|null
setContentLengthHeader()  : void
Sets/adjusts the Content-Length header

Properties

Methods

__construct()

ResponseEmitter constructor

public __construct(ResponseInterface $response[, int $bufferSize = 65536 ]) : mixed
Parameters
$response : ResponseInterface
$bufferSize : int = 65536

emitBody()

emits the body of the given response with respect to the parameters given in content-range and content-length headers

protected emitBody() : void

emitBodyRange()

emits a part of the body

protected emitBodyRange(int $start, int $length) : void
Parameters
$start : int
$length : int

emitBuffer()

emits the given buffer

protected emitBuffer(string $buffer) : void
Parameters
$buffer : string
Tags
codeCoverageIgnore

(overridden in test)

getStatusLine()

Returns a full status line for the given response, e.g. "HTTP/1.1 200 OK"

protected getStatusLine() : string
Return values
string

        
On this page

Search results