Skip to content

Commit

Permalink
improve deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Feb 17, 2023
1 parent 0612356 commit 323a243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Constraints/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Email extends Constraint
public const VALIDATION_MODE_HTML5 = 'html5';
public const VALIDATION_MODE_STRICT = 'strict';
/**
* @deprecated since Symfony 6.2
* @deprecated since Symfony 6.2, use VALIDATION_MODE_HTML5 instead
*/
public const VALIDATION_MODE_LOOSE = 'loose';

Expand Down Expand Up @@ -74,7 +74,7 @@ public function __construct(
$this->normalizer = $normalizer ?? $this->normalizer;

if (self::VALIDATION_MODE_LOOSE === $this->mode) {
trigger_deprecation('symfony/validator', '6.2', 'The "%s" mode is deprecated. The default mode will be changed to "%s" in 7.0.', self::VALIDATION_MODE_LOOSE, self::VALIDATION_MODE_HTML5);
trigger_deprecation('symfony/validator', '6.2', 'The "%s" mode is deprecated. It will be removed in 7.0 and the default mode will be changed to "%s".', self::VALIDATION_MODE_LOOSE, self::VALIDATION_MODE_HTML5);
}

if (self::VALIDATION_MODE_STRICT === $this->mode && !class_exists(StrictEmailValidator::class)) {
Expand Down

0 comments on commit 323a243

Please sign in to comment.