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

Skip to content

Commit 3f6d2bb

Browse files
committed
Remove of boolean value for the checkDNS option
1 parent e726337 commit 3f6d2bb

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ CHANGELOG
88
is not supported anymore.
99
* removed the `DateTimeValidator::PATTERN` constant
1010
* removed the `AbstractConstraintValidatorTest` class
11+
* removed the support for setting the `checkDNS` option of the `Url` constraint to `true`
1112

1213
3.4.0
1314
-----
1415

1516
* not setting the `strict` option of the `Choice` constraint to `true` is
1617
deprecated and will throw an exception in Symfony 4.0
17-
* setting the `checkDNS` option of the `Url` constraint to `true` is deprecated in favor of constant values and will throw an exception in Symfony 4.0
18+
* setting the `checkDNS` option of the `Url` constraint to `true` is deprecated in favor of `Url::CHECK_DNS_TYPE_*` constants values and will throw an exception in Symfony 4.0
1819

1920
3.3.0
2021
-----

src/Symfony/Component/Validator/Constraints/UrlValidator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ public function validate($value, Constraint $constraint)
7373
}
7474

7575
if ($constraint->checkDNS) {
76-
// backwards compatibility
77-
if ($constraint->checkDNS === true) {
78-
$constraint->checkDNS = Url::CHECK_DNS_TYPE_ANY;
79-
@trigger_error(sprintf('Use of the boolean TRUE for the "checkDNS" option in %s is deprecated. Use Url::CHECK_DNS_TYPE_ANY instead.', Url::class), E_USER_DEPRECATED);
80-
}
81-
8276
if (!in_array($constraint->checkDNS, array(
8377
Url::CHECK_DNS_TYPE_ANY,
8478
Url::CHECK_DNS_TYPE_A,

src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,6 @@ public function getCheckDnsTypes()
260260
);
261261
}
262262

263-
/**
264-
* @group legacy
265-
*/
266-
public function testCheckDnsWithBoolean()
267-
{
268-
DnsMock::withMockedHosts(array('example.com' => array(array('type' => 'A'))));
269-
270-
$constraint = new Url(array(
271-
'checkDNS' => true,
272-
'dnsMessage' => 'myMessage',
273-
));
274-
275-
$this->validator->validate('http://example.com', $constraint);
276-
277-
$this->assertNoViolation();
278-
}
279-
280263
/**
281264
* @expectedException \Symfony\Component\Validator\Exception\InvalidOptionsException
282265
* @requires function Symfony\Bridge\PhpUnit\DnsMock::withMockedHosts

0 commit comments

Comments
 (0)