X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FUrlValidator.php;h=3ccf4ba79b2b547cf8c35e5f00ca8cda12de3414;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=222597ed10f41f568d2696cea6b7bd463797dbc8;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/vendor/symfony/validator/Constraints/UrlValidator.php b/vendor/symfony/validator/Constraints/UrlValidator.php index 222597ed1..3ccf4ba79 100644 --- a/vendor/symfony/validator/Constraints/UrlValidator.php +++ b/vendor/symfony/validator/Constraints/UrlValidator.php @@ -52,7 +52,7 @@ class UrlValidator extends ConstraintValidator 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 @@ class UrlValidator extends ConstraintValidator @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, array( Url::CHECK_DNS_TYPE_ANY, Url::CHECK_DNS_TYPE_A, Url::CHECK_DNS_TYPE_A6, @@ -92,13 +92,13 @@ class UrlValidator extends ConstraintValidator Url::CHECK_DNS_TYPE_SOA, Url::CHECK_DNS_TYPE_SRV, Url::CHECK_DNS_TYPE_TXT, - ))) { - 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)), array('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)