Skip to content

Commit 2f717ce

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [Translation] Fix Crowdin documentation urls ignore missing keys when mapping DateTime objects to uninitialized arrays fix writes to static $kernel property [Notifier] Fix test logic [Validator] Hint that `egulias/email-validator` needs to be installed for strict mode as default config
2 parents 14a1473 + b1a7722 commit 2f717ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Constraints/EmailValidator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public function validate(mixed $value, Constraint $constraint)
7070
}
7171

7272
if (null === $constraint->mode) {
73+
if (Email::VALIDATION_MODE_STRICT === $this->defaultMode && !class_exists(EguliasEmailValidator::class)) {
74+
throw new LogicException(sprintf('The "egulias/email-validator" component is required to make the "%s" constraint default to strict mode.', EguliasEmailValidator::class));
75+
}
76+
7377
$constraint->mode = $this->defaultMode;
7478
}
7579

0 commit comments

Comments
 (0)