1
0
Fork 0

Add hint in solver exceptions as to what may be wrong

pull/873/merge
Jordi Boggiano 2012-07-04 15:57:51 +02:00
parent a5f0872152
commit 6573fd3f77
2 changed files with 9 additions and 1 deletions

View File

@ -35,6 +35,10 @@ class SolverProblemsException extends \RuntimeException
$text .= " Problem ".($i+1).$problem->getPrettyString($this->installedMap)."\n";
}
if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) {
$text .= "\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.\n";
}
return $text;
}

View File

@ -699,7 +699,11 @@ class SolverTest extends TestCase
$msg = "\n";
$msg .= " Problem 1\n";
$msg .= " - Installation request for a -> satisfiable by A 1.0.\n";
$msg .= " - A 1.0 requires b >= 2.0 -> no matching package found.\n";
$msg .= " - A 1.0 requires b >= 2.0 -> no matching package found.\n\n";
$msg .= "Potential causes:\n";
$msg .= " - A typo in the package name\n";
$msg .= " - The package is not available in a stable-enough version according to your minimum-stability setting\n";
$msg .= " see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.\n";
$this->assertEquals($msg, $e->getMessage());
}
}