diff --git a/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php b/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php index 3ac54c0a7e760a8f9603da139c780fdfd5f833a1..dc20e05187431ceb84d164737e5e882c3adcbd9f 100644 --- a/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php +++ b/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php @@ -72,7 +72,7 @@ public function getSortedProviders() { krsort($this->providerOrders); // Merge nested providers from $this->providers into $this->sortedProviders. - $this->sortedProviders = array_merge([], ...$this->providerOrders); + $this->sortedProviders = array_merge(...$this->providerOrders); } return $this->sortedProviders; diff --git a/core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php b/core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php index c71137b6a34dd1ad15fc12d734f4551aa77d9847..ff89c437fdbb060006cac4b04140ebdfe08170e3 100644 --- a/core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php +++ b/core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php @@ -107,7 +107,7 @@ protected function getSortedBuilders() { // Sort the builders according to priority. krsort($this->builders); // Merge nested builders from $this->builders into $this->sortedBuilders. - $this->sortedBuilders = array_merge([], ...$this->builders); + $this->sortedBuilders = array_merge(...$this->builders); } return $this->sortedBuilders; } diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php index 2bdba2f215fe02165d08f34f47f65fa87d70bb4b..5db500f2fed49627dacbc867b753c7e1a4dd42d7 100644 --- a/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -264,7 +264,7 @@ public function findConfigEntityDependencies($type, array $names, ConfigDependen foreach ($names as $name) { $dependencies[] = $dependency_manager->getDependentEntities($type, $name); } - return array_merge([], ...$dependencies); + return array_merge(...$dependencies); } /** @@ -292,9 +292,9 @@ public function findConfigEntityDependenciesAsEntities($type, array $names, Conf $storage = $this->entityTypeManager->getStorage($entity_type_id); // Remove the keys since there are potential ID clashes from different // configuration entity types. - $entities_to_return = array_merge($entities_to_return, array_values($storage->loadMultiple($entities_to_load))); + $entities_to_return[] = array_values($storage->loadMultiple($entities_to_load)); } - return $entities_to_return; + return array_merge(...$entities_to_return); } /** @@ -487,13 +487,14 @@ public function findMissingContentDependencies() { $missing_dependencies = []; foreach ($this->activeStorage->readMultiple($this->activeStorage->listAll()) as $config_data) { if (isset($config_data['dependencies']['content'])) { - $content_dependencies = array_merge($content_dependencies, $config_data['dependencies']['content']); + $content_dependencies[] = $config_data['dependencies']['content']; } if (isset($config_data['dependencies']['enforced']['content'])) { - $content_dependencies = array_merge($content_dependencies, $config_data['dependencies']['enforced']['content']); + $content_dependencies[] = $config_data['dependencies']['enforced']['content']; } } - foreach (array_unique($content_dependencies) as $content_dependency) { + $unique_content_dependencies = array_unique(array_merge(...$content_dependencies)); + foreach ($unique_content_dependencies as $content_dependency) { // Format of the dependency is entity_type:bundle:uuid. [$entity_type, $bundle, $uuid] = explode(':', $content_dependency, 3); if (!$this->entityRepository->loadEntityByUuid($entity_type, $uuid)) { diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Query.php b/core/lib/Drupal/Core/Config/Entity/Query/Query.php index a18968873c83c37ee55a7721342d1ae5dbaad24f..9adcd181bb59f83986f7e8da8e4cfcd3fe4d3a3e 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/Query.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/Query.php @@ -129,7 +129,8 @@ protected function loadRecords() { $prefix_length = strlen($prefix); // Search the conditions for restrictions on configuration object names. - $names = FALSE; + $filter_by_names = []; + $has_added_restrictions = FALSE; $id_condition = NULL; $id_key = $this->entityType->getKey('id'); if ($this->condition->getConjunction() == 'AND') { @@ -140,21 +141,22 @@ protected function loadRecords() { if (is_string($condition['field']) && ($operator == 'IN' || $operator == '=')) { // Special case ID lookups. if ($condition['field'] == $id_key) { + $has_added_restrictions = TRUE; $ids = (array) $condition['value']; - $names = array_map(function ($id) use ($prefix) { + $filter_by_names[] = array_map(static function ($id) use ($prefix) { return $prefix . $id; }, $ids); } elseif (in_array($condition['field'], $lookup_keys)) { + $has_added_restrictions = TRUE; // If we don't find anything then there are no matches. No point in // listing anything. - $names = []; $keys = (array) $condition['value']; - $keys = array_map(function ($value) use ($condition) { + $keys = array_map(static function ($value) use ($condition) { return $condition['field'] . ':' . $value; }, $keys); foreach ($this->getConfigKeyStore()->getMultiple($keys) as $list) { - $names = array_merge($names, $list); + $filter_by_names[] = $list; } } } @@ -166,7 +168,7 @@ protected function loadRecords() { // We stop at the first restricting condition on name. In the case where // there are additional restricting conditions, results will be // eliminated when the conditions are checked on the loaded records. - if ($names !== FALSE) { + if ($has_added_restrictions !== FALSE) { // If the condition has been responsible for narrowing the list of // configuration to check there is no point in checking it further. unset($conditions[$condition_key]); @@ -174,52 +176,56 @@ protected function loadRecords() { } } } + // If no restrictions on IDs were found, we need to parse all records. - if ($names === FALSE) { - $names = $this->configFactory->listAll($prefix); + if ($has_added_restrictions === FALSE) { + $filter_by_names = $this->configFactory->listAll($prefix); + } + else { + $filter_by_names = array_merge(...$filter_by_names); } // In case we have an ID condition, try to narrow down the list of config // objects to load. - if ($id_condition && !empty($names)) { + if ($id_condition && !empty($filter_by_names)) { $value = $id_condition['value']; $filter = NULL; switch ($id_condition['operator']) { case '<>': - $filter = function ($name) use ($value, $prefix_length) { + $filter = static function ($name) use ($value, $prefix_length) { $id = substr($name, $prefix_length); return $id !== $value; }; break; case 'STARTS_WITH': - $filter = function ($name) use ($value, $prefix_length) { + $filter = static function ($name) use ($value, $prefix_length) { $id = substr($name, $prefix_length); return strpos($id, $value) === 0; }; break; case 'CONTAINS': - $filter = function ($name) use ($value, $prefix_length) { + $filter = static function ($name) use ($value, $prefix_length) { $id = substr($name, $prefix_length); return strpos($id, $value) !== FALSE; }; break; case 'ENDS_WITH': - $filter = function ($name) use ($value, $prefix_length) { + $filter = static function ($name) use ($value, $prefix_length) { $id = substr($name, $prefix_length); return strrpos($id, $value) === strlen($id) - strlen($value); }; break; } if ($filter) { - $names = array_filter($names, $filter); + $filter_by_names = array_filter($filter_by_names, $filter); } } // Load the corresponding records. $records = []; - foreach ($this->configFactory->loadMultiple($names) as $config) { + foreach ($this->configFactory->loadMultiple($filter_by_names) as $config) { $records[substr($config->getName(), $prefix_length)] = $config->get(); } return $records; diff --git a/core/lib/Drupal/Core/Config/PreExistingConfigException.php b/core/lib/Drupal/Core/Config/PreExistingConfigException.php index ada95f6572c0a901674011457f1467871e495113..05e904e3de0e35fd8aa36c1908af658eef7869ab 100644 --- a/core/lib/Drupal/Core/Config/PreExistingConfigException.php +++ b/core/lib/Drupal/Core/Config/PreExistingConfigException.php @@ -88,9 +88,9 @@ public static function flattenConfigObjects(array $config_objects) { } return $config_name; }, $config_names); - $flat_config_objects = array_merge($flat_config_objects, $config_names); + $flat_config_objects[] = $config_names; } - return $flat_config_objects; + return array_merge(...$flat_config_objects); } } diff --git a/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php b/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php index b0b0d1a288d7fca9186f51427c712253c6ada1e6..431469c7faff7a1b04b6c793715e04d0de6cfd11 100644 --- a/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php +++ b/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php @@ -56,7 +56,7 @@ public function checkConfigSchema(TypedConfigManagerInterface $typed_config, $co foreach ($config_data as $key => $value) { $errors[] = $this->checkValue($key, $value); } - $errors = array_merge([], ...$errors); + $errors = array_merge(...$errors); if (empty($errors)) { return TRUE; } diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index b592f8a79bb839fd6cd9672879cb403cf8e2aca5..72668038721db41aede85d889d9183d2834396d3 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -560,8 +560,9 @@ protected function loadFromSharedTables(array &$values, array &$translations, $l // returns an array keyed by property names so remove the keys // before array_merge() to avoid losing data with fields having the // same columns i.e. value. - $column_names = array_merge($column_names, array_values($table_mapping->getColumnNames($data_field))); + $column_names[] = array_values($table_mapping->getColumnNames($data_field)); } + $column_names = array_merge(...$column_names); $query->fields('data', $column_names); } diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index c8ece6daf6b3e2f83feaf13bb85aad0a671a89c6..262865403e6d1cab43ffffc48315ee22a6182b0d 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -499,7 +499,7 @@ public function alter($type, &$data, &$context1 = NULL, &$context2 = NULL) { foreach ($extra_types as $extra_type) { $extra_modules[] = array_keys($this->getImplementationInfo($extra_type . '_alter')); } - $extra_modules = array_merge([], ...$extra_modules); + $extra_modules = array_merge(...$extra_modules); // If any modules implement one of the extra hooks that do not implement // the primary hook, we need to add them to the $modules array in their // appropriate order. $this->getImplementationInfo() can only return diff --git a/core/lib/Drupal/Core/File/FileSystem.php b/core/lib/Drupal/Core/File/FileSystem.php index 02175f9e109e331e8ffce2bfec5febb19731736b..155fbd7b05b2108a75b121835585cdfc97de0dec 100644 --- a/core/lib/Drupal/Core/File/FileSystem.php +++ b/core/lib/Drupal/Core/File/FileSystem.php @@ -700,7 +700,8 @@ public function scanDirectory($dir, $mask, array $options = []) { * @see \Drupal\Core\File\FileSystemInterface::scanDirectory() */ protected function doScanDirectory($dir, $mask, array $options = [], $depth = 0) { - $files = []; + $files_in_sub_dirs = []; + $files_in_this_directory = []; // Avoid warnings when opendir does not have the permissions to open a // directory. if ($handle = @opendir($dir)) { @@ -714,19 +715,17 @@ protected function doScanDirectory($dir, $mask, array $options = [], $depth = 0) $uri = "$dir/$filename"; } if ($options['recurse'] && is_dir($uri)) { - // Give priority to files in this folder by merging them in after - // any subdirectory files. - $files = array_merge($this->doScanDirectory($uri, $mask, $options, $depth + 1), $files); + $files_in_sub_dirs[] = $this->doScanDirectory($uri, $mask, $options, $depth + 1); } elseif ($depth >= $options['min_depth'] && preg_match($mask, $filename)) { - // Always use this match over anything already set in $files with - // the same $options['key']. + // Always use this match over anything already set with the same + // $options['key']. $file = new \stdClass(); $file->uri = $uri; $file->filename = $filename; $file->name = pathinfo($filename, PATHINFO_FILENAME); $key = $options['key']; - $files[$file->$key] = $file; + $files_in_this_directory[$file->$key] = $file; if ($options['callback']) { $options['callback']($uri); } @@ -739,7 +738,9 @@ protected function doScanDirectory($dir, $mask, array $options = [], $depth = 0) $this->logger->error('@dir can not be opened', ['@dir' => $dir]); } - return $files; + // Give priority to files in this folder by merging them after + // any subdirectory files. + return array_merge(array_merge(...$files_in_sub_dirs), $files_in_this_directory); } } diff --git a/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php b/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php index 538831490d62003bd1f9f1ac813296ca8766cf84..e3bc1211543b0a9c663491a5f55f822e41d4470e 100644 --- a/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php +++ b/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php @@ -108,7 +108,7 @@ public function isGuesserSupported(): bool { */ protected function sortGuessers() { krsort($this->guessers); - return array_merge([], ...$this->guessers); + return array_merge(...$this->guessers); } } diff --git a/core/lib/Drupal/Core/Logger/LoggerChannel.php b/core/lib/Drupal/Core/Logger/LoggerChannel.php index 08cc46f7b844f59f9005158e3d0a36ca174f8a0d..ec5702f91c3a60eb302d2be4e39e983c374f91c4 100644 --- a/core/lib/Drupal/Core/Logger/LoggerChannel.php +++ b/core/lib/Drupal/Core/Logger/LoggerChannel.php @@ -166,7 +166,7 @@ public function addLogger(LoggerInterface $logger, $priority = 0) { */ protected function sortLoggers() { krsort($this->loggers); - return array_merge([], ...$this->loggers); + return array_merge(...$this->loggers); } } diff --git a/core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php b/core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php index b4e8fac7f03e64e147b8bb4b69188dcd8c447f5d..2b4ca1d389c1c040d31b5979a1a2fc5096cb933c 100644 --- a/core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php +++ b/core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php @@ -132,7 +132,7 @@ protected function getOutbound() { */ protected function sortProcessors($type) { krsort($this->{$type}); - return array_merge([], ...$this->{$type}); + return array_merge(...$this->{$type}); } } diff --git a/core/lib/Drupal/Core/RouteProcessor/RouteProcessorManager.php b/core/lib/Drupal/Core/RouteProcessor/RouteProcessorManager.php index 65a358769e04b978590a6ec99fe2da8b4442bc7b..7b64c90c6c6f3b73d1651b62ad0865419ad04f8d 100644 --- a/core/lib/Drupal/Core/RouteProcessor/RouteProcessorManager.php +++ b/core/lib/Drupal/Core/RouteProcessor/RouteProcessorManager.php @@ -72,7 +72,7 @@ protected function getOutbound() { */ protected function sortProcessors() { krsort($this->outboundProcessors); - return array_merge([], ...$this->outboundProcessors); + return array_merge(...$this->outboundProcessors); } } diff --git a/core/lib/Drupal/Core/Routing/MethodFilter.php b/core/lib/Drupal/Core/Routing/MethodFilter.php index 4d24aa57f5a07a118747fc008225adeeb0041298..7cd670518a68adeaeea2c927000a596f18a87dc2 100644 --- a/core/lib/Drupal/Core/Routing/MethodFilter.php +++ b/core/lib/Drupal/Core/Routing/MethodFilter.php @@ -36,14 +36,14 @@ public function filter(RouteCollection $collection, Request $request) { } if (!in_array($method, $supported_methods, TRUE)) { - $all_supported_methods = array_merge($supported_methods, $all_supported_methods); + $all_supported_methods[] = $supported_methods; $collection->remove($name); } } if (count($collection)) { return $collection; } - throw new MethodNotAllowedException(array_unique($all_supported_methods)); + throw new MethodNotAllowedException(array_unique(array_merge(...$all_supported_methods))); } } diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php index a9e42778b14c03c53a82c77782257dd512e357a6..36ca5e16abccfec9c43e35e0d3276f6bbe53f7c5 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php @@ -78,7 +78,7 @@ public function addTranslator(TranslatorInterface $translator, $priority = 0) { */ protected function sortTranslators() { krsort($this->translators); - return array_merge([], ...$this->translators); + return array_merge(...$this->translators); } /** diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php index aeb044a3b4a111f4951aeefaf72afe0a29844ecb..6a6759d1dbadbe1c42f51467a45aae8fa6142b1e 100644 --- a/core/lib/Drupal/Core/Template/Attribute.php +++ b/core/lib/Drupal/Core/Template/Attribute.php @@ -183,8 +183,9 @@ public function addClass() { // Merge the values passed in from the classes array. // The argument is cast to an array to support comma separated single // values or one or more array arguments. - $classes = array_merge($classes, (array) $arg); + $classes[] = (array) $arg; } + $classes = array_merge(...$classes); // Merge if there are values, just add them otherwise. if (isset($this->storage['class']) && $this->storage['class'] instanceof AttributeArray) { @@ -271,8 +272,9 @@ public function removeClass() { // Merge the values passed in from the classes array. // The argument is cast to an array to support comma separated single // values or one or more array arguments. - $classes = array_merge($classes, (array) $arg); + $classes[] = (array) $arg; } + $classes = array_merge(...$classes); // Remove the values passed in from the value array. Use array_values() to // ensure that the array index remains sequential. diff --git a/core/lib/Drupal/Core/Test/JUnitConverter.php b/core/lib/Drupal/Core/Test/JUnitConverter.php index 5af99f07d9cab87874faa4b4d548b2ad6a7ce2ec..6d62d661e6b5efd098dc64d270b1354ae78282f8 100644 --- a/core/lib/Drupal/Core/Test/JUnitConverter.php +++ b/core/lib/Drupal/Core/Test/JUnitConverter.php @@ -90,9 +90,9 @@ public static function findTestCases(\SimpleXMLElement $element, \SimpleXMLEleme if ($file && !$child->attributes()->file) { $child->addAttribute('file', $file); } - $test_cases = array_merge($test_cases, static::findTestCases($child, $element)); + $test_cases[] = static::findTestCases($child, $element); } - return $test_cases; + return array_merge(...$test_cases); } /** diff --git a/core/lib/Drupal/Core/Test/TestSetupTrait.php b/core/lib/Drupal/Core/Test/TestSetupTrait.php index 457966323dbbe6da31e0c68ed596ce30217ee1b7..85b5e237cf59464a9d2f6168f42d76ec4a2dd88a 100644 --- a/core/lib/Drupal/Core/Test/TestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/TestSetupTrait.php @@ -195,12 +195,12 @@ protected function getConfigSchemaExclusions() { $exceptions = []; while ($class) { if (property_exists($class, 'configSchemaCheckerExclusions')) { - $exceptions = array_merge($exceptions, $class::$configSchemaCheckerExclusions); + $exceptions[] = $class::$configSchemaCheckerExclusions; } $class = get_parent_class($class); } // Filter out any duplicates. - return array_unique($exceptions); + return array_unique(array_merge(...$exceptions)); } } diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationMapperList.php b/core/modules/config_translation/src/Controller/ConfigTranslationMapperList.php index cc06c4682eb43faacee5fe51dea698c53515ae8b..61d710654f983e427de6fc4b1b052df6a977372e 100644 --- a/core/modules/config_translation/src/Controller/ConfigTranslationMapperList.php +++ b/core/modules/config_translation/src/Controller/ConfigTranslationMapperList.php @@ -71,7 +71,7 @@ public function render() { $mappers[$weight] = $mapper; } - $build['#rows'] = array_merge([], ...$mappers); + $build['#rows'] = array_merge(...$mappers); return $build; } diff --git a/core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php b/core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php index c4e6c24eb87119762ab6b51a288df5bd6c4cdf7f..bcaf746a1d51ac1713160d6196bd603573b3d564 100644 --- a/core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php +++ b/core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php @@ -50,7 +50,7 @@ public function filter(RouteCollection $collection, Request $request) { $all_supported_methods[] = $route->getMethods(); } - $all_supported_methods = array_merge([], ...$all_supported_methods); + $all_supported_methods = array_merge(...$all_supported_methods); $collection = $this->inner->filter($collection, $request); if (!$this->readOnlyModeIsEnabled) { diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 4afd06e4c0bfd2d05ede7ea2e2243799f64a9e19..6c7a986bcd0171aecb14a6d9e02e0d49decd5992 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -308,7 +308,7 @@ function locale_translate_batch_refresh(&$context) { foreach ($context['results']['stats'] as $report) { $strings[] = $report['strings']; } - $strings = array_merge([], ...$strings); + $strings = array_merge(...$strings); } if ($strings) { // Initialize multi-step string refresh. diff --git a/core/modules/serialization/src/RegisterEntityResolversCompilerPass.php b/core/modules/serialization/src/RegisterEntityResolversCompilerPass.php index c3bb1d11a9aebbaa976cacb8bbd475597f7cf23c..8d4d3af9e4da4d302e61cd68b5be51466a4fa740 100644 --- a/core/modules/serialization/src/RegisterEntityResolversCompilerPass.php +++ b/core/modules/serialization/src/RegisterEntityResolversCompilerPass.php @@ -49,7 +49,7 @@ public function process(ContainerBuilder $container) { */ protected function sort($services) { krsort($services); - return array_merge([], ...$services); + return array_merge(...$services); } } diff --git a/core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php b/core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php index 02c7fa600f6f7d3e93edaea391e40b5e76b214e5..dd3dd9a107c7f33c8fc53e1368f23d067646af63 100644 --- a/core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php +++ b/core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php @@ -75,7 +75,7 @@ public function process(ContainerBuilder $container) { */ protected function sort($services) { krsort($services); - return array_merge([], ...$services); + return array_merge(...$services); } } diff --git a/core/modules/views/src/Plugin/views/field/RenderedEntity.php b/core/modules/views/src/Plugin/views/field/RenderedEntity.php index d4429a5cfac25c3795c931267d4e1c44aefe9b91..40a3a6275546133305fa825add73ab5faab413bb 100644 --- a/core/modules/views/src/Plugin/views/field/RenderedEntity.php +++ b/core/modules/views/src/Plugin/views/field/RenderedEntity.php @@ -163,7 +163,7 @@ public function getCacheTags() { foreach ($view_displays as $view_display) { $tags[] = $view_display->getCacheTags(); } - return array_merge([], ...$tags); + return array_merge(...$tags); } /** diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php index 035df8b59380d383b2daea19f0e729de854a526f..14b335b63f04c9d0b5692af5f046a9b025363c42 100644 --- a/core/modules/views/src/Plugin/views/query/Sql.php +++ b/core/modules/views/src/Plugin/views/query/Sql.php @@ -1429,7 +1429,7 @@ public function query($get_count = FALSE) { * Get the arguments attached to the WHERE and HAVING clauses of this query. */ public function getWhereArgs() { - return array_merge([], ...array_column($this->where, 'args'), ...array_column($this->having, 'args')); + return array_merge(...array_column($this->where, 'args'), ...array_column($this->having, 'args')); } /** diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php index 6e72d8901dbfac52670e7291c5b3669d8b8e36e5..e3763c88a965d7291c34d3559e17e340378658ca 100644 --- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php +++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php @@ -43,7 +43,7 @@ public function testAuthenticationCollector() { krsort($providers); // Merge nested providers from $providers into $sorted_providers. - $sorted_providers = array_merge([], ...$providers); + $sorted_providers = array_merge(...$providers); $this->assertEquals($sorted_providers, $authentication_collector->getSortedProviders()); // Test AuthenticationCollector::getProvider() and