class ComparesUsing extends Comparator (View source)

Compare a value using a callback.

The callback can accept a single argument and return a value (any non-boolean values will be cast to a boolean value).

Methods

__construct(callable $callback)

No description

bool
__invoke(mixed $value)

Compare the input value against the comparator.

bool
check(mixed $value)

Compare the input value against the comparator.

static ComparesUsing
make(callable $callback)

No description

Details

__construct(callable $callback)

No description

Parameters

callable $callback

The callback to use for comparison

final bool __invoke(mixed $value)

Compare the input value against the comparator.

Parameters

mixed $value

Return Value

bool

bool check(mixed $value)

Compare the input value against the comparator.

Parameters

mixed $value

Return Value

bool

static ComparesUsing make(callable $callback)

No description

Parameters

callable $callback

The callback to use for comparison

Return Value

ComparesUsing