1
0
Fork 0

Fix warning for packages not existing while they exist but not at the required stability, fixes #7044

pull/7070/head
Jordi Boggiano 2018-01-31 16:11:37 +01:00
parent 9b3ab4896d
commit a61a8d78b1
1 changed files with 10 additions and 0 deletions

View File

@ -705,8 +705,18 @@ EOT
));
}
// Check for similar names/typos
$similar = $this->findSimilar($name);
if ($similar) {
// Check whether the minimum stability was the problem but the package exists
if ($requiredVersion === null && in_array($name, $similar, true)) {
throw new \InvalidArgumentException(sprintf(
'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.',
$name,
$this->getMinimumStability($input)
));
}
throw new \InvalidArgumentException(sprintf(
"Could not find package %s.\n\nDid you mean " . (count($similar) > 1 ? 'one of these' : 'this') . "?\n %s",
$name,