[null, 'Translation key or message for invalid value', 'string'], ]; /** * Checks if the given value is a valid DateTime object. If this is not * the case, the function adds an error. */ public function isValid(mixed $value): void { $this->result->clear(); if ($value instanceof \DateTimeInterface) { return; } $this->addError( $this->translateErrorMessage( $this->message, '', [ gettype($value), ] ), 1238087674, [gettype($value)] ); } }