1
0
Fork 0

Fix invalid usage of Link class, fixes #9252

pull/9278/head
Jordi Boggiano 2020-10-12 09:22:23 +02:00
parent f966de94a9
commit 9528ce7057
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ namespace Composer\Repository;
use Composer\Package\Version\VersionParser;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Package\AliasPackage;
use Composer\Package\RootPackageInterface;
use Composer\Package\Link;
@ -176,7 +177,7 @@ class InstalledRepository extends CompositeRepository
$platformPkg = $this->findPackage($link->getTarget(), '*');
$description = $platformPkg ? 'but '.$platformPkg->getPrettyVersion().' is installed' : 'but it is missing';
$results[] = array($package, new Link($package->getName(), $link->getTarget(), null, Link::TYPE_REQUIRE, $link->getPrettyConstraint().' '.$description), false);
$results[] = array($package, new Link($package->getName(), $link->getTarget(), new MatchAllConstraint, Link::TYPE_REQUIRE, $link->getPrettyConstraint().' '.$description), false);
continue;
}
@ -199,7 +200,7 @@ class InstalledRepository extends CompositeRepository
}
}
$results[] = array($package, $link, false);
$results[] = array($rootPackage, new Link($rootPackage->getName(), $link->getTarget(), null, 'does not require', 'but ' . $pkg->getPrettyVersion() . ' is installed'), false);
$results[] = array($rootPackage, new Link($rootPackage->getName(), $link->getTarget(), new MatchAllConstraint, 'does not require', 'but ' . $pkg->getPrettyVersion() . ' is installed'), false);
} else {
// no root so let's just print whatever we found
$results[] = array($package, $link, false);