From c862f6017d09e58a7e52449b76fea6ecc86c4343 Mon Sep 17 00:00:00 2001 From: Julien Rosset Date: Thu, 19 Mar 2026 18:26:26 +0100 Subject: [PATCH] RegexValidator: suppress warning if value is null --- src/CliProgram/Validation/Validators/RegexValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CliProgram/Validation/Validators/RegexValidator.php b/src/CliProgram/Validation/Validators/RegexValidator.php index 24ac8b7..a940c89 100644 --- a/src/CliProgram/Validation/Validators/RegexValidator.php +++ b/src/CliProgram/Validation/Validators/RegexValidator.php @@ -35,7 +35,7 @@ class RegexValidator implements IValidator { * @inheritDoc */ public function validate (mixed $value): bool { - return preg_match($this->pattern, $value, $this->matches) === 1; + return preg_match($this->pattern, $value ?? '', $this->matches) === 1; } /**