class IsHexadecimal extends StringComparator (View source)

Checks if a string is hexadecimal. Optionally allows spaces between each byte.

Traits

Methods

__construct(bool $bytes = false)

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 IsHexadecimal
make(bool $bytes = false)

No description

string
resolveStringInput(mixed $value)

No description

Details

__construct(bool $bytes = false)

No description

Parameters

bool $bytes

If true, spaces between every byte (2 characters) is required (eg. 00 11 22 33) instead of 00112233. (default: false)

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 IsHexadecimal make(bool $bytes = false)

No description

Parameters

bool $bytes

If true, spaces between every byte (2 characters) is required (eg. 00 11 22 33) instead of 00112233. (default: false)

Return Value

IsHexadecimal

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string