class Replace extends StringMutator (View source)

Replace all occurrences of the search string with the replacement string.

Traits

Methods

__construct(array|string $search, array|string $replace, bool $caseSensitive = true)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Replace
make(array|string $search, array|string $replace, bool $caseSensitive = true)

No description

mixed
mutate(mixed $value)

Mutate the input value.

string
mutateString(string $value)

No description

string
resolveStringInput(mixed $value)

No description

Details

__construct(array|string $search, array|string $replace, bool $caseSensitive = true)

No description

Parameters

array|string $search

The value(s) to search for.

array|string $replace

The replacement value(s).

bool $caseSensitive

Whether to perform a case-sensitive search (default: true).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Replace make(array|string $search, array|string $replace, bool $caseSensitive = true)

No description

Parameters

array|string $search

The value(s) to search for.

array|string $replace

The replacement value(s).

bool $caseSensitive

Whether to perform a case-sensitive search (default: true).

Return Value

Replace

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