RegexValidator: suppress warning if value is null

master 3.13.2
Julien Rosset 1 month ago
parent c949d6dc3f
commit c862f6017d

@ -35,7 +35,7 @@ class RegexValidator implements IValidator {
* @inheritDoc * @inheritDoc
*/ */
public function validate (mixed $value): bool { public function validate (mixed $value): bool {
return preg_match($this->pattern, $value, $this->matches) === 1; return preg_match($this->pattern, $value ?? '', $this->matches) === 1;
} }
/** /**

Loading…
Cancel
Save