class StreamBodyRepository implements BodyRepository

Traits

Properties

protected null|resource|StreamInterface $stream

The stream body.

protected StreamInterface|null $resourceStream

The stream that wraps a resource 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 34
__construct(mixed $value = null)

Create a stream body repository.

Parameters

mixed $value

at line 45
BodyRepository set(mixed $value)

Set the repository value.

Parameters

mixed $value

Return Value

BodyRepository

at line 68
mixed all()

Get the stream from the repository.

Return Value

mixed

at line 78
mixed get()

Get the stream from the repository.

Alias of "all" method.

Return Value

mixed

at line 86
bool isEmpty()

Determine if the repository is empty.

Return Value

bool

at line 94
bool isNotEmpty()

Determine if the repository is not empty.

Return Value

bool

at line 102
StreamInterface toStream()

Convert the body repository into a stream.

Return Value

StreamInterface