From e5c7835d575e35349fc25dc2e201cee10f05ad12 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 26 Jul 2020 15:22:59 -0400 Subject: [PATCH] Properly support PHP 8.0 Named Arguments See https://wiki.php.net/rfc/named_params#internal_functions (implemented but not yet merged) An ArgumentCountError will be thrown when passing variadic arguments to a function with call_user_func_array() if extra unknown named arguments are encountered. Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in phar:///path/to/composer.phar/src/Composer/DependencyResolver/DefaultPolicy.php:84 (e.g. for `['phpunit/phpunit' => [72]]`) --- src/Composer/DependencyResolver/DefaultPolicy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/DefaultPolicy.php b/src/Composer/DependencyResolver/DefaultPolicy.php index 542c6e625..d7d386801 100644 --- a/src/Composer/DependencyResolver/DefaultPolicy.php +++ b/src/Composer/DependencyResolver/DefaultPolicy.php @@ -81,7 +81,7 @@ class DefaultPolicy implements PolicyInterface $literals = $this->pruneRemoteAliases($pool, $literals); } - $selected = call_user_func_array('array_merge', $packages); + $selected = call_user_func_array('array_merge', array_values($packages)); // now sort the result across all packages to respect replaces across packages usort($selected, function ($a, $b) use ($policy, $pool, $installedMap, $requiredPackage) {