Skip to content
PHP Ecosystem
Explore

ResponseBody

API reference › RoadRunner › ResponseBody

final classyii2\extensions\roadrunner\ResponseBody
ImplementsPsr\Http\Message\StreamInterface
Sourcesrc/ResponseBody.php

Retains failures from streaming read() and eof() calls that an emitter may consume.

MethodDescriptionDefined by
__construct()ResponseBody
__toString()ResponseBody
close()ResponseBody
detach()ResponseBody
eof()ResponseBody
getContents()ResponseBody
getFailure()Returns the failure even when the emitter returned normally after consuming it.ResponseBody
getMetadata()ResponseBody
getSize()ResponseBody
isReadable()ResponseBody
isSeekable()ResponseBody
isWritable()ResponseBody
read()ResponseBody
rewind()ResponseBody
seek()ResponseBody
tell()ResponseBody
write()ResponseBody
public function __construct(Psr\Http\Message\StreamInterface $stream)

Parameters

ParameterTypeDescription
$streamPsr\Http\Message\StreamInterface
public function __toString(): string

Returns

string

public function close(): void
public function detach(): resource|null

Returns

resource|null

public function eof(): bool

Returns

bool

public function getContents(): string

Returns

string

public function getFailure(): Throwable|null

Returns the failure even when the emitter returned normally after consuming it.

Returns

Throwable|null

public function getMetadata(string|null $key = null): mixed

Parameters

ParameterTypeDescription
$keystring|null

Returns

mixed

public function getSize(): int|null

Returns

int|null

public function isReadable(): bool

Returns

bool

public function isSeekable(): bool

Returns

bool

public function isWritable(): bool

Returns

bool

public function read(int $length): string

Parameters

ParameterTypeDescription
$lengthint

Returns

string

public function rewind(): void
public function seek(int $offset, int $whence = \yii2\extensions\roadrunner\SEEK_SET): void

Parameters

ParameterTypeDescription
$offsetint
$whenceint
public function tell(): int

Returns

int

public function write(string $string): int

Parameters

ParameterTypeDescription
$stringstring

Returns

int