class Stream implements ResponseSenderInterface

Stream response.

Properties

protected bool $isCGI Is PHP running as a CGI program?
protected Closure $stream Stream.
protected string|null $contentType Content type.
protected string|null $charset Character set.

Methods

__construct(Closure $stream, string|null $contentType = null, string|null $charset = null)

Constructor.

setType(string $contentType)

Sets the response content type.

string|null
getType()

Returns the response content type.

setCharset(string $charset)

Sets the response character set.

string|null
getCharset()

Returns the response character set.

flush(string|null $chunk, bool $flushEmpty = false)

Flushes a chunck of data.

flow()

Sends the stream.

send(Request $request, Response $response)

Sends the response.

Details

at line 60
__construct(Closure $stream, string|null $contentType = null, string|null $charset = null)

Constructor.

Parameters

Closure $stream Stream
string|null $contentType Content type
string|null $charset Character set

at line 75
Stream setType(string $contentType)

Sets the response content type.

Parameters

string $contentType Content type

Return Value

Stream

at line 87
string|null getType()

Returns the response content type.

Return Value

string|null

at line 98
Stream setCharset(string $charset)

Sets the response character set.

Parameters

string $charset Character set

Return Value

Stream

at line 110
string|null getCharset()

Returns the response character set.

Return Value

string|null

at line 121
flush(string|null $chunk, bool $flushEmpty = false)

Flushes a chunck of data.

Parameters

string|null $chunk Chunck of data to flush
bool $flushEmpty Flush empty chunk?

at line 146
protected flow()

Sends the stream.

at line 166
send(Request $request, Response $response)

Sends the response.

Parameters

Request $request Request instance
Response $response Response instance