[null, 'Translation key or message for invalid value', 'string'], ]; /** * The given $value is valid if it is an alphanumeric string, which is defined as [\pL\d]*. */ public function isValid(mixed $value): void { if (!is_string($value) || preg_match('/^[\pL\d]*$/u', $value) !== 1) { $this->addError($this->translateErrorMessage($this->message), 1221551320); } } }