class StringBodyRepository implements BodyRepository, Stringable

Traits

Properties

protected string|null $data

The repository data.

Methods

StreamInterface
toStream()

Convert the body repository into a stream.

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(string|null $value = null)

Create a string body repository.

set(mixed $value)

Set the repository value.

mixed
all()

Get the repository value.

bool
isEmpty()

Determine if the repository is empty.

bool
isNotEmpty()

Determine if the repository is not empty.

string
__toString()

Convert the repository into a string.

Details

StreamInterface toStream()

Convert the body repository into a stream.

Return Value

StreamInterface

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 25
__construct(string|null $value = null)

Create a string body repository.

Parameters

string|null $value

at line 36
BodyRepository set(mixed $value)

Set the repository value.

Parameters

mixed $value

Return Value

BodyRepository

at line 46
mixed all()

Get the repository value.

Return Value

mixed

at line 54
bool isEmpty()

Determine if the repository is empty.

Return Value

bool

at line 62
bool isNotEmpty()

Determine if the repository is not empty.

Return Value

bool

at line 70
string __toString()

Convert the repository into a string.

Return Value

string