1
0
Fork 0

Fix incorrect --no-dev handling of replaced packages

pull/8621/head
remorhaz 2020-02-18 17:10:41 +02:00
parent 5aff184fbc
commit 339ee953e5
1 changed files with 8 additions and 1 deletions

View File

@ -939,16 +939,23 @@ INITIALIZER;
{
$packages = array();
$include = array();
$replacedBy = array();
foreach ($packageMap as $item) {
$package = $item[0];
$name = $package->getName();
$packages[$name] = $package;
foreach ($package->getReplaces() as $replace) {
$replacedBy[$replace->getTarget()] = $name;
}
}
$add = function (PackageInterface $package) use (&$add, $packages, &$include) {
$add = function (PackageInterface $package) use (&$add, $packages, &$include, $replacedBy) {
foreach ($package->getRequires() as $link) {
$target = $link->getTarget();
if (isset($replacedBy[$target])) {
$target = $replacedBy[$target];
}
if (!isset($include[$target])) {
$include[$target] = true;
if (isset($packages[$target])) {