Fix invalid usage of Link class, fixes #9252
parent
f966de94a9
commit
9528ce7057
|
@ -15,6 +15,7 @@ namespace Composer\Repository;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Package\Version\VersionParser;
|
||||||
use Composer\Semver\Constraint\ConstraintInterface;
|
use Composer\Semver\Constraint\ConstraintInterface;
|
||||||
use Composer\Semver\Constraint\Constraint;
|
use Composer\Semver\Constraint\Constraint;
|
||||||
|
use Composer\Semver\Constraint\MatchAllConstraint;
|
||||||
use Composer\Package\AliasPackage;
|
use Composer\Package\AliasPackage;
|
||||||
use Composer\Package\RootPackageInterface;
|
use Composer\Package\RootPackageInterface;
|
||||||
use Composer\Package\Link;
|
use Composer\Package\Link;
|
||||||
|
@ -176,7 +177,7 @@ class InstalledRepository extends CompositeRepository
|
||||||
|
|
||||||
$platformPkg = $this->findPackage($link->getTarget(), '*');
|
$platformPkg = $this->findPackage($link->getTarget(), '*');
|
||||||
$description = $platformPkg ? 'but '.$platformPkg->getPrettyVersion().' is installed' : 'but it is missing';
|
$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;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +200,7 @@ class InstalledRepository extends CompositeRepository
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$results[] = array($package, $link, false);
|
$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 {
|
} else {
|
||||||
// no root so let's just print whatever we found
|
// no root so let's just print whatever we found
|
||||||
$results[] = array($package, $link, false);
|
$results[] = array($package, $link, false);
|
||||||
|
|
Loading…
Reference in New Issue