Skip to content

Commit 006cdab

Browse files
authored
feat(trait): Validate for TrimmedNonEmptyString on regex argument (#60)
1 parent 94970c3 commit 006cdab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Util/ValueObjectTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ final protected static function nullOrString(array $values, string $key, ?int $m
378378
}
379379

380380
if (null !== $regex) {
381-
Assert::stringNotEmpty($regex);
381+
TrimmedNonEmptyString::fromString($regex);
382382
Assert::regex($values[$key], $regex);
383383
}
384384

@@ -405,7 +405,7 @@ final protected static function string(array $values, string $key, ?int $maxLeng
405405
}
406406

407407
if (null !== $regex) {
408-
Assert::stringNotEmpty($regex);
408+
TrimmedNonEmptyString::fromString($regex);
409409
Assert::regex($values[$key], $regex);
410410
}
411411

0 commit comments

Comments
 (0)