1
0
Fork 0

Merge pull request #5025 from curry684/issue-4686

Improved error message when adding a package disallowed by PHP version
pull/4737/head
Jordi Boggiano 2016-03-09 12:23:44 +01:00
commit 6a69a20072
1 changed files with 6 additions and 0 deletions

View File

@ -633,6 +633,12 @@ EOT
$package = $versionSelector->findBestCandidate($name, null, $phpVersion);
if (!$package) {
// Check whether the PHP version was the problem
if ($phpVersion && $versionSelector->findBestCandidate($name)) {
throw new \InvalidArgumentException(sprintf(
'Could not find package %s at any version matching your PHP version %s', $name, $phpVersion
));
}
throw new \InvalidArgumentException(sprintf(
'Could not find package %s at any version for your minimum-stability (%s). Check the package spelling or your minimum-stability',
$name,