From 9528ce705796a9b3b7fb541c30de8a0cba59f9b1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 12 Oct 2020 09:22:23 +0200 Subject: [PATCH] Fix invalid usage of Link class, fixes #9252 --- src/Composer/Repository/InstalledRepository.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/InstalledRepository.php b/src/Composer/Repository/InstalledRepository.php index 157867553..8a7ad5b08 100644 --- a/src/Composer/Repository/InstalledRepository.php +++ b/src/Composer/Repository/InstalledRepository.php @@ -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);