From cceedd912bcb6530c6d029eef7fdf99b877268f4 Mon Sep 17 00:00:00 2001 From: Dave Long <dave@longwaveconsulting.com> Date: Tue, 27 Aug 2024 17:59:35 +0100 Subject: [PATCH] Issue #3468502 by Spokje, mondrake: sebastianbergmann/comparator:5.0.2 Introduces (for Drupal) breaking changes --- composer.lock | 60 +++++++++---------- .../PinnedDevDependencies/composer.json | 6 +- core/lib/Drupal/Core/Cache/Cache.php | 34 +++++------ 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/composer.lock b/composer.lock index 3475ec69e528..fd59dd8130ea 100644 --- a/composer.lock +++ b/composer.lock @@ -7178,32 +7178,32 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.15", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", - "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { "phpunit/phpunit": "^10.1" @@ -7215,7 +7215,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.1-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -7244,7 +7244,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -7252,7 +7252,7 @@ "type": "github" } ], - "time": "2024-06-29T08:25:15+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", @@ -7499,16 +7499,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.29", + "version": "10.5.30", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8e9e80872b4e8064401788ee8a32d40b4455318f" + "reference": "b15524febac0153876b4ba9aab3326c2ee94c897" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e9e80872b4e8064401788ee8a32d40b4455318f", - "reference": "8e9e80872b4e8064401788ee8a32d40b4455318f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b15524febac0153876b4ba9aab3326c2ee94c897", + "reference": "b15524febac0153876b4ba9aab3326c2ee94c897", "shasum": "" }, "require": { @@ -7529,7 +7529,7 @@ "phpunit/php-timer": "^6.0.0", "sebastian/cli-parser": "^2.0.1", "sebastian/code-unit": "^2.0.0", - "sebastian/comparator": "^5.0.1", + "sebastian/comparator": "^5.0.2", "sebastian/diff": "^5.1.1", "sebastian/environment": "^6.1.0", "sebastian/exporter": "^5.1.2", @@ -7580,7 +7580,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.29" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.30" }, "funding": [ { @@ -7596,7 +7596,7 @@ "type": "tidelift" } ], - "time": "2024-07-30T11:08:00+00:00" + "time": "2024-08-13T06:09:37+00:00" }, { "name": "react/promise", @@ -7841,16 +7841,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", "shasum": "" }, "require": { @@ -7861,7 +7861,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "phpunit/phpunit": "^10.4" }, "type": "library", "extra": { @@ -7906,7 +7906,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.2" }, "funding": [ { @@ -7914,7 +7914,7 @@ "type": "github" } ], - "time": "2023-08-14T13:18:12+00:00" + "time": "2024-08-12T06:03:08+00:00" }, { "name": "sebastian/complexity", diff --git a/composer/Metapackage/PinnedDevDependencies/composer.json b/composer/Metapackage/PinnedDevDependencies/composer.json index 077cad0dcf37..400c0a93aef9 100644 --- a/composer/Metapackage/PinnedDevDependencies/composer.json +++ b/composer/Metapackage/PinnedDevDependencies/composer.json @@ -52,17 +52,17 @@ "phpstan/phpstan": "1.11.10", "phpstan/phpstan-deprecation-rules": "1.2.0", "phpstan/phpstan-phpunit": "1.4.0", - "phpunit/php-code-coverage": "10.1.15", + "phpunit/php-code-coverage": "10.1.16", "phpunit/php-file-iterator": "4.1.0", "phpunit/php-invoker": "4.0.0", "phpunit/php-text-template": "3.0.1", "phpunit/php-timer": "6.0.0", - "phpunit/phpunit": "10.5.29", + "phpunit/phpunit": "10.5.30", "react/promise": "v3.2.0", "sebastian/cli-parser": "2.0.1", "sebastian/code-unit": "2.0.0", "sebastian/code-unit-reverse-lookup": "3.0.0", - "sebastian/comparator": "5.0.1", + "sebastian/comparator": "5.0.2", "sebastian/complexity": "3.2.0", "sebastian/environment": "6.1.0", "sebastian/exporter": "5.1.2", diff --git a/core/lib/Drupal/Core/Cache/Cache.php b/core/lib/Drupal/Core/Cache/Cache.php index 3f363264bd17..693e2cd91898 100644 --- a/core/lib/Drupal/Core/Cache/Cache.php +++ b/core/lib/Drupal/Core/Cache/Cache.php @@ -17,39 +17,39 @@ class Cache { const PERMANENT = CacheBackendInterface::CACHE_PERMANENT; /** - * Merges arrays of cache contexts and removes duplicates. + * Merges lists of cache contexts and removes duplicates. * - * @param string[] ... - * Cache contexts arrays to merge. + * @param list<string> ... + * Cache contexts to merge. * - * @return string[] - * The merged array of cache contexts. + * @return list<string> + * The merged list of cache contexts. */ public static function mergeContexts(array ...$cache_contexts) { - $cache_contexts = array_unique(array_merge(...$cache_contexts)); + $cache_contexts = array_values(array_unique(array_merge(...$cache_contexts))); assert(\Drupal::service('cache_contexts_manager')->assertValidTokens($cache_contexts), sprintf('Failed to assert that "%s" are valid cache contexts.', implode(', ', $cache_contexts))); return $cache_contexts; } /** - * Merges arrays of cache tags and removes duplicates. + * Merges lists of cache tags and removes duplicates. * - * The cache tags array is returned in a format that is valid for + * The cache tags list is returned in a format that is valid for * \Drupal\Core\Cache\CacheBackendInterface::set(). * * When caching elements, it is necessary to collect all cache tags into a - * single array, from both the element itself and all child elements. This + * single list, from both the element itself and all child elements. This * allows items to be invalidated based on all tags attached to the content * they're constituted from. * - * @param string[] ... - * Cache tags arrays to merge. + * @param list<string> ... + * Cache tags to merge. * - * @return string[] - * The merged array of cache tags. + * @return list<string> + * The merged list of cache tags. */ public static function mergeTags(array ...$cache_tags) { - $cache_tags = array_unique(array_merge(...$cache_tags)); + $cache_tags = array_values(array_unique(array_merge(...$cache_tags))); assert(Inspector::assertAllStrings($cache_tags), 'Cache tags must be valid strings'); return $cache_tags; } @@ -77,7 +77,7 @@ public static function mergeMaxAges(...$max_ages) { } /** - * Build an array of cache tags from a given prefix and an array of suffixes. + * Build a list of cache tags from a given prefix and an array of suffixes. * * Each suffix will be converted to a cache tag by appending it to the prefix, * with a colon between them. @@ -89,8 +89,8 @@ public static function mergeMaxAges(...$max_ages) { * @param string $glue * A string to be used as glue for concatenation. Defaults to a colon. * - * @return string[] - * An array of cache tags. + * @return list<string> + * A list of cache tags. */ public static function buildTags($prefix, array $suffixes, $glue = ':') { $tags = []; -- GitLab