Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] use constraint options instead of properties #28871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UPGRADE-4.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ TwigBundle
Validator
---------

* The `checkMX` and `checkHost` properties of the Email constraint are deprecated
* The `checkMX` and `checkHost` options of the `Email` constraint are deprecated
* The component is now decoupled from `symfony/translation` and uses `Symfony\Contracts\Translation\TranslatorInterface` instead
* The `ValidatorBuilderInterface` has been deprecated and `ValidatorBuilder` made final
* Deprecated validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`. Use `Type` instead or remove the constraint if the underlying model is type hinted to `\DateTimeInterface` already.
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ TwigBundle
Validator
--------

* The `checkMX` and `checkHost` properties of the Email constraint were removed
* The `checkMX` and `checkHost` options of the `Email` constraint were removed
* The `Email::__construct()` 'strict' property has been removed. Use 'mode'=>"strict" instead.
* Calling `EmailValidator::__construct()` method with a boolean parameter has been removed, use `EmailValidator("strict")` instead.
* Removed the `checkDNS` and `dnsMessage` options from the `Url` constraint.
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Validator/Constraints/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public function __construct($options = null)
}

if (\is_array($options) && array_key_exists('checkMX', $options)) {
@trigger_error('The "checkMX" property is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
@trigger_error('The "checkMX" option is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
}

if (\is_array($options) && array_key_exists('checkHost', $options)) {
@trigger_error('The "checkHost" property is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
@trigger_error('The "checkHost" option is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
}

if (\is_array($options) && array_key_exists('mode', $options) && !\in_array($options['mode'], self::$validationModes, true)) {
Expand Down