From 0191d0c7c51df2f847f702d4a8fc0783d0fe096f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 19 Oct 2024 22:15:13 +0200 Subject: [PATCH] don't return a single space for packages without descriptions (#12162) --- src/Composer/DependencyResolver/Problem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/Problem.php b/src/Composer/DependencyResolver/Problem.php index 6910a39fa..c58d8601b 100644 --- a/src/Composer/DependencyResolver/Problem.php +++ b/src/Composer/DependencyResolver/Problem.php @@ -649,7 +649,7 @@ class Problem $providers = $repositorySet->getProviders($packageName); if (\count($providers) > 0) { $providersStr = implode(array_map(static function ($p): string { - $description = $p['description'] !== '' ? ' '.substr($p['description'] ?? '', 0, 100) : ''; + $description = $p['description'] !== '' && $p['description'] !== null ? ' '.substr($p['description'], 0, 100) : ''; return ' - '.$p['name'].$description."\n"; }, count($providers) > $maxProviders + 1 ? array_slice($providers, 0, $maxProviders) : $providers));