1
0
Fork 0

Remove trailing spaces from output

pull/8684/head
Nils Adermann 2020-03-11 21:32:55 +01:00
parent 1f467046d7
commit 06f460c557
1 changed files with 3 additions and 2 deletions

View File

@ -251,12 +251,13 @@ class Problem
if ($providers = $repositorySet->getProvidersAndReplacers($packageName)) {
$maxProviders = 20;
$providersStr = implode(array_map(function ($p) {
return " - ${p['name']} ".substr($p['description'], 0, 100)."\n";
$description = $p['description'] ? ' '.substr($p['description'], 0, 100) : '';
return " - ${p['name']}".$description."\n";
}, count($providers) > $maxProviders+1 ? array_slice($providers, 0, $maxProviders) : $providers));
if (count($providers) > $maxProviders+1) {
$providersStr .= ' ... and '.(count($providers)-$maxProviders).' more.'."\n";
}
return array("- Root composer.json requires $packageName".self::constraintToText($constraint).", it ", "could not be found in any version, but the following packages provide it: \n".$providersStr." Consider requiring one of these to satisfy the $packageName requirement.");
return array("- Root composer.json requires $packageName".self::constraintToText($constraint).", it ", "could not be found in any version, but the following packages provide it:\n".$providersStr." Consider requiring one of these to satisfy the $packageName requirement.");
}
return array("- Root composer.json requires $packageName, it ", "could not be found in any version, there may be a typo in the package name.");