Do not read require-dev except for the root package when sorting packages

main
Jordi Boggiano 2 years ago
parent 890b8fad3d
commit d67953266f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -13,6 +13,7 @@
namespace Composer\Util;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface;
class PackageSorter
{
@ -29,7 +30,11 @@ class PackageSorter
$usageList = array();
foreach ($packages as $package) {
foreach (array_merge($package->getRequires(), $package->getDevRequires()) as $link) {
$links = $package->getRequires();
if ($package instanceof RootPackageInterface) {
$links = array_merge($links, $package->getDevRequires());
}
foreach ($links as $link) {
$target = $link->getTarget();
$usageList[$target][] = $package->getName();
}

Loading…
Cancel
Save