class ReplaceFirst extends StringMutator (View source)

Replace the first occurrence of the search string with the replacement string.

Ported from illuminate/support to prevent package collisions.

Traits

Methods

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

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static ReplaceFirst
make(string $search, 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(string $search, string $replace, bool $caseSensitive = true)

No description

Parameters

string $search

The value to search for.

string $replace

The replacement value.

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 ReplaceFirst make(string $search, string $replace, bool $caseSensitive = true)

No description

Parameters

string $search

The value to search for.

string $replace

The replacement value.

bool $caseSensitive

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

Return Value

ReplaceFirst

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