1
0
Fork 0

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]]`)
pull/9076/head
Tyson Andre 2020-07-26 15:22:59 -04:00
parent 5fceb4799a
commit e5c7835d57
1 changed files with 1 additions and 1 deletions

View File

@ -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) {