Fix composer show -a usage, fixes #9304

main
Jordi Boggiano 4 years ago
parent 99a5469b5e
commit 14ec957e96
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -584,7 +584,11 @@ EOT
$matchedPackage = null;
$versions = array();
$pool = $repositorySet->createPoolWithAllPackages();
if (PlatformRepository::isPlatformPackage($name)) {
$pool = $repositorySet->createPoolWithAllPackages();
} else {
$pool = $repositorySet->createPoolForPackage($name);
}
$matches = $pool->whatProvides($name, $constraint);
foreach ($matches as $index => $package) {
// select an exact match if it is in the installed repo and no specific version was required

@ -280,6 +280,10 @@ class RepositorySet
$request = new Request($lockedRepo);
foreach ($packageNames as $packageName) {
if (PlatformRepository::isPlatformPackage($packageName)) {
throw new \LogicException('createPoolForPackage(s) can not be used for platform packages, as they are never loaded by the PoolBuilder which expects them to be fixed. Use createPoolWithAllPackages or pass in a proper request with the platform packages you need fixed in it.');
}
$request->requireName($packageName);
}

Loading…
Cancel
Save