comparison vendor/symfony/validator/Constraints/TimeValidator.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
45 { 45 {
46 if (!$constraint instanceof Time) { 46 if (!$constraint instanceof Time) {
47 throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Time'); 47 throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Time');
48 } 48 }
49 49
50 if (null === $value || '' === $value || $value instanceof \DateTime) { 50 if (null === $value || '' === $value || $value instanceof \DateTimeInterface) {
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');