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,7 +251,8 @@ class Problem
if ($providers = $repositorySet->getProvidersAndReplacers($packageName)) { if ($providers = $repositorySet->getProvidersAndReplacers($packageName)) {
$maxProviders = 20; $maxProviders = 20;
$providersStr = implode(array_map(function ($p) { $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)); }, count($providers) > $maxProviders+1 ? array_slice($providers, 0, $maxProviders) : $providers));
if (count($providers) > $maxProviders+1) { if (count($providers) > $maxProviders+1) {
$providersStr .= ' ... and '.(count($providers)-$maxProviders).' more.'."\n"; $providersStr .= ' ... and '.(count($providers)-$maxProviders).' more.'."\n";