class Wrap extends StringMutator (View source)

Wraps a string in a prefix and suffix. Uses the same prefix and suffix if only one is provided.

Traits

Methods

__construct(string $before, string $after = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Wrap
make(string $before, string $after = null)

No description

mixed
mutate(mixed $value)

Mutate the input value.

string
mutateString(string $value)

No description

string
resolveStringInput(mixed $value)

No description

Details

__construct(string $before, string $after = null)

No description

Parameters

string $before

The prefix to prepend to the string.

string $after

The suffix to append to the string (optional, defaults to the prefix).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Wrap make(string $before, string $after = null)

No description

Parameters

string $before

The prefix to prepend to the string.

string $after

The suffix to append to the string (optional, defaults to the prefix).

Return Value

Wrap

final mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

protected string mutateString(string $value)

No description

Parameters

string $value

Return Value

string

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string