class IsDateTimeFormat extends StringComparator (View source)

Checks if a string is a valid datetime in the given format.

Traits

Methods

__construct(string $format)

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.

make(string $format)

No description

string
resolveStringInput(mixed $value)

No description

Details

__construct(string $format)

No description

Parameters

string $format

Format to check against (eg. Y-m-d H:i:s)

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 IsDateTimeFormat make(string $format)

No description

Parameters

string $format

Format to check against (eg. Y-m-d H:i:s)

Return Value

IsDateTimeFormat

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string