diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index c9ac50326..0194662b7 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -472,7 +472,11 @@ EOT if ($writeLatest && $latestPackage) { $packageViewData['latest'] = $latestPackage->getFullPrettyVersion(); $packageViewData['latest-status'] = $this->getUpdateStatus($latestPackage, $package); - $latestLength = max($latestLength, strlen($latestPackage->getFullPrettyVersion())); + $latestLength = max($latestLength, strlen($packageViewData['latest'])); + } elseif ($writeLatest) { + $packageViewData['latest'] = '[none matched]'; + $packageViewData['latest-status'] = 'up-to-date'; + $latestLength = max($latestLength, strlen($packageViewData['latest'])); } if ($writeDescription && $package instanceof CompletePackageInterface) { $packageViewData['description'] = $package->getDescription();