Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/validator/Constraints/File.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 |
line wrap: on
line diff
--- a/vendor/symfony/validator/Constraints/File.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/validator/Constraints/File.php Thu Feb 28 13:11:55 2019 +0000 @@ -32,16 +32,16 @@ const TOO_LARGE_ERROR = 'df8637af-d466-48c6-a59d-e7126250a654'; const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; - protected static $errorNames = array( + protected static $errorNames = [ self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', self::EMPTY_ERROR => 'EMPTY_ERROR', self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', - ); + ]; public $binaryFormat; - public $mimeTypes = array(); + public $mimeTypes = []; public $notFoundMessage = 'The file could not be found.'; public $notReadableMessage = 'The file is not readable.'; public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; @@ -99,18 +99,18 @@ private function normalizeBinaryFormat($maxSize) { - $factors = array( + $factors = [ 'k' => 1000, 'ki' => 1 << 10, 'm' => 1000000, 'mi' => 1 << 20, - ); + ]; if (ctype_digit((string) $maxSize)) { $this->maxSize = (int) $maxSize; $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; } elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) { $this->maxSize = $matches[1] * $factors[$unit = strtolower($matches[2])]; - $this->binaryFormat = null === $this->binaryFormat ? 2 === strlen($unit) : $this->binaryFormat; + $this->binaryFormat = null === $this->binaryFormat ? 2 === \strlen($unit) : $this->binaryFormat; } else { throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize)); }