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)

Set the content type.

setCharset(string $charset)

Sets the status code.

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 62
__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 77
Stream setType(string $contentType)

Set the content type.

Parameters

string $contentType [description]

Return Value

Stream

at line 90
Stream setCharset(string $charset)

Sets the status code.

Parameters

string $charset Character set

Return Value

Stream

at line 103
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 128
protected flow()

Sends the stream.

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

Sends the response.

Parameters

Request $request Request instance
Response $response Response instance