class Before extends StringMutator (View source)

Retrieves the part of a string before a given substring.

Traits

Methods

__construct(string $search, bool $last = false)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Before
first(string $search)

Retrieves the part of a string before the first occurrence of a given substring.

static Before
last(string $search)

Retrieves the part of a string before the last occurrence of a given substring.

static Before
make(string $search, bool $last = false)

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, bool $last = false)

No description

Parameters

string $search

The substring to search for.

bool $last

Whether to search for the last occurrence of the substring (default: false).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Before first(string $search)

Retrieves the part of a string before the first occurrence of a given substring.

Parameters

string $search

The substring to search for.

Return Value

Before

static Before last(string $search)

Retrieves the part of a string before the last occurrence of a given substring.

Parameters

string $search

The substring to search for.

Return Value

Before

static Before make(string $search, bool $last = false)

No description

Parameters

string $search

The substring to search for.

bool $last

Whether to search for the last occurrence of the substring (default: false).

Return Value

Before

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