Do not read require-dev except for the root package when sorting packages
parent
890b8fad3d
commit
d67953266f
|
@ -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…
Reference in New Issue