diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index d90e02f7a..de4f4c098 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -18,6 +18,7 @@ use Composer\Json\JsonFile; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Link; +use Composer\Package\AliasPackage; use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionSelector; @@ -365,6 +366,9 @@ EOT || !is_object($packages[$type][$package->getName()]) || version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<') ) { + while ($package instanceof AliasPackage) { + $package = $package->getAliasOf(); + } if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) { if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) { $packages[$type][$package->getName()] = $package;