class Mask extends StringMutator (View source)

Masks a string with a single character based on a regular expression

Traits

Methods

__construct(string $pattern, string $replacement = '*')

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Mask
make(string $pattern, string $replacement = '*')

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 $pattern, string $replacement = '*')

No description

Parameters

string $pattern

The regular expression to match.

string $replacement

The replacement character (default: '*').

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Mask make(string $pattern, string $replacement = '*')

No description

Parameters

string $pattern

The regular expression to match.

string $replacement

The replacement character (default: '*').

Return Value

Mask

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