Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/validator/Constraints/UrlValidator.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/symfony/validator/Constraints/UrlValidator.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/validator/Constraints/UrlValidator.php Thu Feb 28 13:11:55 2019 +0000 @@ -52,7 +52,7 @@ return; } - if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) { + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { throw new UnexpectedTypeException($value, 'string'); } @@ -79,7 +79,7 @@ @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); } - if (!in_array($constraint->checkDNS, array( + if (!\in_array($constraint->checkDNS, [ Url::CHECK_DNS_TYPE_ANY, Url::CHECK_DNS_TYPE_A, Url::CHECK_DNS_TYPE_A6, @@ -92,13 +92,13 @@ Url::CHECK_DNS_TYPE_SOA, Url::CHECK_DNS_TYPE_SRV, Url::CHECK_DNS_TYPE_TXT, - ), true)) { - throw new InvalidOptionsException(sprintf('Invalid value for option "checkDNS" in constraint %s', get_class($constraint)), array('checkDNS')); + ], true)) { + throw new InvalidOptionsException(sprintf('Invalid value for option "checkDNS" in constraint %s', \get_class($constraint)), ['checkDNS']); } $host = parse_url($value, PHP_URL_HOST); - if (!is_string($host) || !checkdnsrr($host, $constraint->checkDNS)) { + if (!\is_string($host) || !checkdnsrr($host, $constraint->checkDNS)) { $this->context->buildViolation($constraint->dnsMessage) ->setParameter('{{ value }}', $this->formatValue($host)) ->setCode(Url::INVALID_URL_ERROR)