comparison vendor/symfony/validator/Constraints/IssnValidator.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
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
36 36
37 if (null === $value || '' === $value) { 37 if (null === $value || '' === $value) {
38 return; 38 return;
39 } 39 }
40 40
41 if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) { 41 if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
42 throw new UnexpectedTypeException($value, 'string'); 42 throw new UnexpectedTypeException($value, 'string');
43 } 43 }
44 44
45 $value = (string) $value; 45 $value = (string) $value;
46 $canonical = $value; 46 $canonical = $value;
57 ->addViolation(); 57 ->addViolation();
58 58
59 return; 59 return;
60 } 60 }
61 61
62 $length = strlen($canonical); 62 $length = \strlen($canonical);
63 63
64 if ($length < 8) { 64 if ($length < 8) {
65 $this->context->buildViolation($constraint->message) 65 $this->context->buildViolation($constraint->message)
66 ->setParameter('{{ value }}', $this->formatValue($value)) 66 ->setParameter('{{ value }}', $this->formatValue($value))
67 ->setCode(Issn::TOO_SHORT_ERROR) 67 ->setCode(Issn::TOO_SHORT_ERROR)