From d6d267bde52d522e3889574798ca4315da9009b4 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 20 Dec 2019 13:15:07 +0000 Subject: Update vendor dependencies --- vendor/composer/installed.json | 52 +++++++++++----------- .../Validation/MultipleValidationWithAnd.php | 4 +- vendor/egulias/email-validator/composer.json | 1 - vendor/symfony/cache/Adapter/ChainAdapter.php | 15 ++++--- vendor/symfony/cache/Adapter/PhpArrayAdapter.php | 13 ++---- vendor/symfony/cache/Simple/ApcuCache.php | 2 + vendor/symfony/cache/Simple/PhpArrayCache.php | 10 ++--- vendor/symfony/cache/Traits/PhpArrayTrait.php | 11 ++++- vendor/symfony/cache/Traits/PhpFilesTrait.php | 33 ++++++++++---- .../expression-language/Node/BinaryNode.php | 8 ++++ vendor/symfony/translation/Dumper/FileDumper.php | 43 +++++++++--------- .../symfony/translation/Loader/PhpFileLoader.php | 16 ++++++- 12 files changed, 125 insertions(+), 83 deletions(-) (limited to 'vendor') diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 945443d165..a77f1203d5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -429,17 +429,17 @@ }, { "name": "egulias/email-validator", - "version": "2.1.11", - "version_normalized": "2.1.11.0", + "version": "2.1.12", + "version_normalized": "2.1.12.0", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23" + "reference": "a6255605af39f2db7f5cb62e672bd8a7bad8d208" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/92dd169c32f6f55ba570c309d83f5209cefb5e23", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/a6255605af39f2db7f5cb62e672bd8a7bad8d208", + "reference": "a6255605af39f2db7f5cb62e672bd8a7bad8d208", "shasum": "" }, "require": { @@ -455,7 +455,7 @@ "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" }, - "time": "2019-08-13T17:33:27+00:00", + "time": "2019-12-20T12:49:39+00:00", "type": "library", "extra": { "branch-alias": { @@ -2685,17 +2685,17 @@ }, { "name": "symfony/cache", - "version": "v4.4.1", - "version_normalized": "4.4.1.0", + "version": "v4.4.2", + "version_normalized": "4.4.2.0", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "de737c81ea95018d11a3ef908ad2ebf203741b96" + "reference": "6af64bab165e588300378a87bcd2df3c7c31c144" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/de737c81ea95018d11a3ef908ad2ebf203741b96", - "reference": "de737c81ea95018d11a3ef908ad2ebf203741b96", + "url": "https://api.github.com/repos/symfony/cache/zipball/6af64bab165e588300378a87bcd2df3c7c31c144", + "reference": "6af64bab165e588300378a87bcd2df3c7c31c144", "shasum": "" }, "require": { @@ -2727,7 +2727,7 @@ "symfony/dependency-injection": "^3.4|^4.1|^5.0", "symfony/var-dumper": "^4.4|^5.0" }, - "time": "2019-12-01T10:50:45+00:00", + "time": "2019-12-16T10:45:21+00:00", "type": "library", "extra": { "branch-alias": { @@ -2826,17 +2826,17 @@ }, { "name": "symfony/expression-language", - "version": "v4.4.1", - "version_normalized": "4.4.1.0", + "version": "v4.4.2", + "version_normalized": "4.4.2.0", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "8a1028a65623a8f7bba582b60e4fd308e6f43001" + "reference": "539e7ff0b635c8b90d8127bc929da781a96eab2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/8a1028a65623a8f7bba582b60e4fd308e6f43001", - "reference": "8a1028a65623a8f7bba582b60e4fd308e6f43001", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/539e7ff0b635c8b90d8127bc929da781a96eab2d", + "reference": "539e7ff0b635c8b90d8127bc929da781a96eab2d", "shasum": "" }, "require": { @@ -2844,7 +2844,7 @@ "symfony/cache": "^3.4|^4.0|^5.0", "symfony/service-contracts": "^1.1|^2" }, - "time": "2019-11-12T14:53:53+00:00", + "time": "2019-12-10T10:33:21+00:00", "type": "library", "extra": { "branch-alias": { @@ -3242,17 +3242,17 @@ }, { "name": "symfony/translation", - "version": "v4.4.1", - "version_normalized": "4.4.1.0", + "version": "v4.4.2", + "version_normalized": "4.4.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "897fb68ee7933372517b551d6f08c6d4bb0b8c40" + "reference": "f7669f48a9633bf8139bc026c755e894b7206677" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/897fb68ee7933372517b551d6f08c6d4bb0b8c40", - "reference": "897fb68ee7933372517b551d6f08c6d4bb0b8c40", + "url": "https://api.github.com/repos/symfony/translation/zipball/f7669f48a9633bf8139bc026c755e894b7206677", + "reference": "f7669f48a9633bf8139bc026c755e894b7206677", "shasum": "" }, "require": { @@ -3285,7 +3285,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2019-11-12T17:18:47+00:00", + "time": "2019-12-12T12:53:52+00:00", "type": "library", "extra": { "branch-alias": { @@ -3379,8 +3379,8 @@ }, { "name": "symfony/var-exporter", - "version": "v4.4.1", - "version_normalized": "4.4.1.0", + "version": "v4.4.2", + "version_normalized": "4.4.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", diff --git a/vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php b/vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php index ce161ac848..b823f7e9c8 100644 --- a/vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php +++ b/vendor/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php @@ -94,7 +94,9 @@ class MultipleValidationWithAnd implements EmailValidation } /** - * {@inheritdoc} + * Returns the validation errors. + * + * @return MultipleErrors|null */ public function getError() { diff --git a/vendor/egulias/email-validator/composer.json b/vendor/egulias/email-validator/composer.json index 4956da9e00..1d36f01ecc 100644 --- a/vendor/egulias/email-validator/composer.json +++ b/vendor/egulias/email-validator/composer.json @@ -2,7 +2,6 @@ "name": "egulias/email-validator", "description": "A library for validating emails against several RFCs", "homepage": "https://github.com/egulias/EmailValidator", - "type": "Library", "keywords": ["email", "validation", "validator", "emailvalidation", "emailvalidator"], "license": "MIT", "authors": [ diff --git a/vendor/symfony/cache/Adapter/ChainAdapter.php b/vendor/symfony/cache/Adapter/ChainAdapter.php index eb1f4404bf..63e97a8d02 100644 --- a/vendor/symfony/cache/Adapter/ChainAdapter.php +++ b/vendor/symfony/cache/Adapter/ChainAdapter.php @@ -61,14 +61,15 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa $this->adapterCount = \count($this->adapters); $this->syncItem = \Closure::bind( - static function ($sourceItem, $item) use ($defaultLifetime) { + static function ($sourceItem, $item, $sourceMetadata = null) use ($defaultLifetime) { + $sourceItem->isTaggable = false; + $sourceMetadata = $sourceMetadata ?? $sourceItem->metadata; + unset($sourceMetadata[CacheItem::METADATA_TAGS]); + $item->value = $sourceItem->value; - $item->expiry = $sourceItem->expiry; + $item->expiry = $sourceMetadata[CacheItem::METADATA_EXPIRY] ?? $sourceItem->expiry; $item->isHit = $sourceItem->isHit; - $item->metadata = $sourceItem->metadata; - - $sourceItem->isTaggable = false; - unset($sourceItem->metadata[CacheItem::METADATA_TAGS]); + $item->metadata = $item->newMetadata = $sourceItem->metadata = $sourceMetadata; if (0 < $sourceItem->defaultLifetime && $sourceItem->defaultLifetime < $defaultLifetime) { $defaultLifetime = $sourceItem->defaultLifetime; @@ -103,7 +104,7 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa $value = $this->doGet($adapter, $key, $callback, $beta, $metadata); } if (null !== $item) { - ($this->syncItem)($lastItem = $lastItem ?? $item, $item); + ($this->syncItem)($lastItem = $lastItem ?? $item, $item, $metadata); } return $value; diff --git a/vendor/symfony/cache/Adapter/PhpArrayAdapter.php b/vendor/symfony/cache/Adapter/PhpArrayAdapter.php index 5f6e99169c..b4f13d1346 100644 --- a/vendor/symfony/cache/Adapter/PhpArrayAdapter.php +++ b/vendor/symfony/cache/Adapter/PhpArrayAdapter.php @@ -61,22 +61,17 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte * This adapter takes advantage of how PHP stores arrays in its latest versions. * * @param string $file The PHP file were values are cached - * @param CacheItemPoolInterface $fallbackPool Fallback when opcache is disabled + * @param CacheItemPoolInterface $fallbackPool A pool to fallback on when an item is not hit * * @return CacheItemPoolInterface */ public static function create($file, CacheItemPoolInterface $fallbackPool) { - // Shared memory is available in PHP 7.0+ with OPCache enabled - if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { - if (!$fallbackPool instanceof AdapterInterface) { - $fallbackPool = new ProxyAdapter($fallbackPool); - } - - return new static($file, $fallbackPool); + if (!$fallbackPool instanceof AdapterInterface) { + $fallbackPool = new ProxyAdapter($fallbackPool); } - return $fallbackPool; + return new static($file, $fallbackPool); } /** diff --git a/vendor/symfony/cache/Simple/ApcuCache.php b/vendor/symfony/cache/Simple/ApcuCache.php index c22771e822..f1eb946ff5 100644 --- a/vendor/symfony/cache/Simple/ApcuCache.php +++ b/vendor/symfony/cache/Simple/ApcuCache.php @@ -11,7 +11,9 @@ namespace Symfony\Component\Cache\Simple; +use Symfony\Component\Cache\Adapter\ApcuAdapter; use Symfony\Component\Cache\Traits\ApcuTrait; +use Symfony\Contracts\Cache\CacheInterface; @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" and type-hint for "%s" instead.', ApcuCache::class, ApcuAdapter::class, CacheInterface::class), E_USER_DEPRECATED); diff --git a/vendor/symfony/cache/Simple/PhpArrayCache.php b/vendor/symfony/cache/Simple/PhpArrayCache.php index 524df3c8a9..3711f46290 100644 --- a/vendor/symfony/cache/Simple/PhpArrayCache.php +++ b/vendor/symfony/cache/Simple/PhpArrayCache.php @@ -41,18 +41,14 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab /** * This adapter takes advantage of how PHP stores arrays in its latest versions. * - * @param string $file The PHP file were values are cached + * @param string $file The PHP file were values are cached + * @param CacheInterface $fallbackPool A pool to fallback on when an item is not hit * * @return Psr16CacheInterface */ public static function create($file, Psr16CacheInterface $fallbackPool) { - // Shared memory is available in PHP 7.0+ with OPCache enabled - if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { - return new static($file, $fallbackPool); - } - - return $fallbackPool; + return new static($file, $fallbackPool); } /** diff --git a/vendor/symfony/cache/Traits/PhpArrayTrait.php b/vendor/symfony/cache/Traits/PhpArrayTrait.php index 89dd8100ba..6e7c72ca7d 100644 --- a/vendor/symfony/cache/Traits/PhpArrayTrait.php +++ b/vendor/symfony/cache/Traits/PhpArrayTrait.php @@ -30,6 +30,8 @@ trait PhpArrayTrait private $keys; private $values; + private static $valuesCache = []; + /** * Store an array of cached values. * @@ -116,6 +118,7 @@ EOF; unset($serialized, $value, $dump); @rename($tmpFile, $this->file); + unset(self::$valuesCache[$this->file]); $this->initialize(); } @@ -133,6 +136,7 @@ EOF; $this->keys = $this->values = []; $cleared = @unlink($this->file) || !file_exists($this->file); + unset(self::$valuesCache[$this->file]); if ($this->pool instanceof AdapterInterface) { return $this->pool->clear($prefix) && $cleared; @@ -146,12 +150,15 @@ EOF; */ private function initialize() { - if (!file_exists($this->file)) { + if (isset(self::$valuesCache[$this->file])) { + $values = self::$valuesCache[$this->file]; + } elseif (!file_exists($this->file)) { $this->keys = $this->values = []; return; + } else { + $values = self::$valuesCache[$this->file] = (include $this->file) ?: [[], []]; } - $values = (include $this->file) ?: [[], []]; if (2 !== \count($values) || !isset($values[0], $values[1])) { $this->keys = $this->values = []; diff --git a/vendor/symfony/cache/Traits/PhpFilesTrait.php b/vendor/symfony/cache/Traits/PhpFilesTrait.php index 41ff8bdd07..05b9d88433 100644 --- a/vendor/symfony/cache/Traits/PhpFilesTrait.php +++ b/vendor/symfony/cache/Traits/PhpFilesTrait.php @@ -35,12 +35,13 @@ trait PhpFilesTrait private $files = []; private static $startTime; + private static $valuesCache = []; public static function isSupported() { self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time(); - return \function_exists('opcache_invalidate') && ('cli' !== \PHP_SAPI || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN)) && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN); + return \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN)); } /** @@ -100,7 +101,6 @@ trait PhpFilesTrait } elseif (!\is_object($value)) { $values[$id] = $value; } elseif (!$value instanceof LazyValue) { - // calling a Closure is for @deprecated BC and should be removed in Symfony 5.0 $values[$id] = $value(); } elseif (false === $values[$id] = include $value->file) { unset($values[$id], $this->values[$id]); @@ -123,14 +123,20 @@ trait PhpFilesTrait try { $file = $this->files[$id] ?? $this->files[$id] = $this->getFile($id); - if (\is_array($expiresAt = include $file)) { + if (isset(self::$valuesCache[$file])) { + [$expiresAt, $this->values[$id]] = self::$valuesCache[$file]; + } elseif (\is_array($expiresAt = include $file)) { + if ($this->appendOnly) { + self::$valuesCache[$file] = $expiresAt; + } + [$expiresAt, $this->values[$id]] = $expiresAt; } elseif ($now < $expiresAt) { $this->values[$id] = new LazyValue($file); } if ($now >= $expiresAt) { - unset($this->values[$id], $missingIds[$k]); + unset($this->values[$id], $missingIds[$k], self::$valuesCache[$file]); } } catch (\ErrorException $e) { unset($missingIds[$k]); @@ -159,7 +165,13 @@ trait PhpFilesTrait $file = $this->files[$id] ?? $this->files[$id] = $this->getFile($id); $getExpiry = true; - if (\is_array($expiresAt = include $file)) { + if (isset(self::$valuesCache[$file])) { + [$expiresAt, $value] = self::$valuesCache[$file]; + } elseif (\is_array($expiresAt = include $file)) { + if ($this->appendOnly) { + self::$valuesCache[$file] = $expiresAt; + } + [$expiresAt, $value] = $expiresAt; } elseif ($this->appendOnly) { $value = new LazyValue($file); @@ -213,12 +225,14 @@ trait PhpFilesTrait $encodedKey = rawurlencode($key); - if (!$isStaticValue) { + if ($isStaticValue) { + $value = "return [{$expiry}, {$value}];"; + } elseif ($this->appendOnly) { + $value = "return [{$expiry}, static function () { return {$value}; }];"; + } else { // We cannot use a closure here because of https://bugs.php.net/76982 $value = str_replace('\Symfony\Component\VarExporter\Internal\\', '', $value); $value = "namespace Symfony\Component\VarExporter\Internal;\n\nreturn \$getExpiry ? {$expiry} : {$value};"; - } else { - $value = "return [{$expiry}, {$value}];"; } $file = $this->files[$key] = $this->getFile($key, true); @@ -229,6 +243,7 @@ trait PhpFilesTrait @opcache_invalidate($file, true); @opcache_compile_file($file); } + unset(self::$valuesCache[$file]); } if (!$ok && !is_writable($this->directory)) { @@ -262,6 +277,8 @@ trait PhpFilesTrait protected function doUnlink($file) { + unset(self::$valuesCache[$file]); + if (self::isSupported()) { @opcache_invalidate($file, true); } diff --git a/vendor/symfony/expression-language/Node/BinaryNode.php b/vendor/symfony/expression-language/Node/BinaryNode.php index 0af4f16623..11245f9a86 100644 --- a/vendor/symfony/expression-language/Node/BinaryNode.php +++ b/vendor/symfony/expression-language/Node/BinaryNode.php @@ -147,8 +147,16 @@ class BinaryNode extends Node case '*': return $left * $right; case '/': + if (0 == $right) { + throw new \DivisionByZeroError('Division by zero'); + } + return $left / $right; case '%': + if (0 == $right) { + throw new \DivisionByZeroError('Modulo by zero'); + } + return $left % $right; case 'matches': return preg_match($right, $left); diff --git a/vendor/symfony/translation/Dumper/FileDumper.php b/vendor/symfony/translation/Dumper/FileDumper.php index 2009c53403..477fcfa19e 100644 --- a/vendor/symfony/translation/Dumper/FileDumper.php +++ b/vendor/symfony/translation/Dumper/FileDumper.php @@ -67,36 +67,37 @@ abstract class FileDumper implements DumperInterface throw new InvalidArgumentException('The file dumper needs a path option.'); } + $hasMessageFormatter = class_exists(\MessageFormatter::class); + // save a file for each domain foreach ($messages->getDomains() as $domain) { - $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); - if (!file_exists($fullpath)) { - $directory = \dirname($fullpath); + if ($hasMessageFormatter) { + $defaultDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; + $altDomain = $domain; + } else { + $defaultDomain = $domain; + $altDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; + } + $defaultPath = $options['path'].'/'.$this->getRelativePath($defaultDomain, $messages->getLocale()); + $altPath = $options['path'].'/'.$this->getRelativePath($altDomain, $messages->getLocale()); + + if (!file_exists($defaultPath) && file_exists($altPath)) { + [$defaultPath, $altPath] = [$altPath, $defaultPath]; + } + + if (!file_exists($defaultPath)) { + $directory = \dirname($defaultPath); if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory)); } } - $intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; - $intlMessages = $messages->all($intlDomain); - - if ($intlMessages) { - $intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale()); - file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options)); - - $messages->replace([], $intlDomain); - - try { - if ($messages->all($domain)) { - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); - } - continue; - } finally { - $messages->replace($intlMessages, $intlDomain); - } + if (file_exists($altPath)) { + // clear alternative translation file + file_put_contents($altPath, $this->formatCatalogue(new MessageCatalogue($messages->getLocale()), $altDomain, $options)); } - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); + file_put_contents($defaultPath, $this->formatCatalogue($messages, $domain, $options)); } } diff --git a/vendor/symfony/translation/Loader/PhpFileLoader.php b/vendor/symfony/translation/Loader/PhpFileLoader.php index a0050e8db1..0991c3d3a2 100644 --- a/vendor/symfony/translation/Loader/PhpFileLoader.php +++ b/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -18,11 +18,25 @@ namespace Symfony\Component\Translation\Loader; */ class PhpFileLoader extends FileLoader { + private static $cache = []; + /** * {@inheritdoc} */ protected function loadResource($resource) { - return require $resource; + if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN))) { + self::$cache = null; + } + + if (null === self::$cache) { + return require $resource; + } + + if (isset(self::$cache[$resource])) { + return self::$cache[$resource]; + } + + return self::$cache[$resource] = require $resource; } } -- cgit v1.3