From 6853bf95ae3c743cffbcd8acad44182b20746f74 Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 14 May 2025 10:46:22 +0200 Subject: [PATCH] Condition si var vide non obligatoire mais regex --- .../Import/Specification/RegexColumnSpecification.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Service/Import/Specification/RegexColumnSpecification.php b/src/Service/Import/Specification/RegexColumnSpecification.php index 04b359d..2803ae0 100644 --- a/src/Service/Import/Specification/RegexColumnSpecification.php +++ b/src/Service/Import/Specification/RegexColumnSpecification.php @@ -15,7 +15,11 @@ class RegexColumnSpecification implements ColumnSpecificationInterface public function isSatisfiedBy(string $value): bool { - return preg_match($this->pattern, $value) === 1; + if(!empty($value) || !trim($value) === '') { + return preg_match($this->pattern, $value) === 1; + }else{ + return true; + } } public function getErrorMessage(): string