class Matches extends StringComparator (View source)

Check if a string matches a regular expression pattern.

Traits

Methods

__construct(string $pattern)

No description

bool
__invoke(mixed $value)

Compare the input value against the comparator.

bool
check(mixed $value)

Compare the input string against the comparator.

bool
checkString(string $value)

Compare the input string against the comparator.

static Matches
make(string $pattern)

No description

string
resolveStringInput(mixed $value)

No description

Details

__construct(string $pattern)

No description

Parameters

string $pattern

The regular expression pattern to match against

final bool __invoke(mixed $value)

Compare the input value against the comparator.

Parameters

mixed $value

Return Value

bool

final bool check(mixed $value)

Compare the input string against the comparator.

Parameters

mixed $value

Return Value

bool

protected bool checkString(string $value)

Compare the input string against the comparator.

Parameters

string $value

Return Value

bool

static Matches make(string $pattern)

No description

Parameters

string $pattern

The regular expression pattern to match against

Return Value

Matches

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string