diff --git a/src/Composer/DependencyResolver/Problem.php b/src/Composer/DependencyResolver/Problem.php index 21b76ec3a..cf2cb381e 100644 --- a/src/Composer/DependencyResolver/Problem.php +++ b/src/Composer/DependencyResolver/Problem.php @@ -453,7 +453,7 @@ class Problem } /** - * @param array $versions an array of pretty versions, with normalized versions as keys + * @param array $versions an array of pretty versions, with normalized versions as keys * @return list a list of pretty versions and '...' where versions were removed */ private static function condenseVersionList(array $versions, int $max, int $maxDev = 16): array @@ -465,10 +465,10 @@ class Problem $filtered = []; $byMajor = []; foreach ($versions as $version => $pretty) { - if (0 === stripos($version, 'dev-')) { + if (0 === stripos((string) $version, 'dev-')) { $byMajor['dev'][] = $pretty; } else { - $byMajor[Preg::replace('{^(\d+)\..*}', '$1', $version)][] = $pretty; + $byMajor[Preg::replace('{^(\d+)\..*}', '$1', (string) $version)][] = $pretty; } } foreach ($byMajor as $majorVersion => $versionsForMajor) {