Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/validator/Constraints/Length.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 | 12f9dff5fda9 |
line wrap: on
line diff
--- a/vendor/symfony/validator/Constraints/Length.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/validator/Constraints/Length.php Thu Feb 28 13:11:55 2019 +0000 @@ -26,11 +26,11 @@ const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9'; const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767'; - protected static $errorNames = array( + protected static $errorNames = [ self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', - ); + ]; public $maxMessage = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; public $minMessage = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; @@ -42,17 +42,17 @@ public function __construct($options = null) { - if (null !== $options && !is_array($options)) { - $options = array( + if (null !== $options && !\is_array($options)) { + $options = [ 'min' => $options, 'max' => $options, - ); + ]; } parent::__construct($options); if (null === $this->min && null === $this->max) { - throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), array('min', 'max')); + throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), ['min', 'max']); } } }