Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/validator/Constraints/UrlValidator.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
45 { | 45 { |
46 if (!$constraint instanceof Url) { | 46 if (!$constraint instanceof Url) { |
47 throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url'); | 47 throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url'); |
48 } | 48 } |
49 | 49 |
50 if (null === $value) { | 50 if (null === $value || '' === $value) { |
51 return; | 51 return; |
52 } | 52 } |
53 | 53 |
54 if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) { | 54 if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) { |
55 throw new UnexpectedTypeException($value, 'string'); | 55 throw new UnexpectedTypeException($value, 'string'); |