class StreamBodyRepository implements BodyRepository

Traits

Properties

protected null|resource|StreamInterface $stream

The stream body.

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

__construct(mixed $value = null)

Create a stream body repository.

set(mixed $value)

Set the repository value.

mixed
all()

Get the stream from the repository.

mixed
get()

Get the stream from the repository.

bool
isEmpty()

Determine if the repository is empty.

bool
isNotEmpty()

Determine if the repository is not empty.

StreamInterface
toStream()

Convert the body repository into a stream.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

at line 29
__construct(mixed $value = null)

Create a stream body repository.

Parameters

mixed $value

at line 40
BodyRepository set(mixed $value)

Set the repository value.

Parameters

mixed $value

Return Value

BodyRepository

at line 56
mixed all()

Get the stream from the repository.

Return Value

mixed

at line 66
mixed get()

Get the stream from the repository.

Alias of "all" method.

Return Value

mixed

at line 74
bool isEmpty()

Determine if the repository is empty.

Return Value

bool

at line 82
bool isNotEmpty()

Determine if the repository is not empty.

Return Value

bool

at line 90
StreamInterface toStream()

Convert the body repository into a stream.

Return Value

StreamInterface