1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

Implement getProviders on reposet for all repo types and add replacers

This way errors during require dev extraction make more sense
This commit is contained in:
Nils Adermann 2020-03-11 17:38:16 +01:00
parent ddb1e79bef
commit 1f467046d7
5 changed files with 64 additions and 9 deletions

View file

@ -31,7 +31,7 @@ class SolverProblemsException extends \RuntimeException
parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', 2);
}
public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool)
public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, $isDevExtraction = false)
{
$installedMap = $request->getPresentMap(true);
$text = "\n";
@ -44,7 +44,7 @@ class SolverProblemsException extends \RuntimeException
}
}
if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) {
if (!$isDevExtraction && (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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.\n - It's a private package and you forgot to add a custom repository to find it\n\nRead <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.";
}