1
0
Fork 0

Merge remote-tracking branch 'arjank/abandoned_package_warning'

pull/6717/merge
Jordi Boggiano 2017-11-29 14:16:10 +01:00
commit fedef55362
1 changed files with 11 additions and 1 deletions

View File

@ -394,7 +394,17 @@ EOT
$exactMatch = null;
$choices = array();
foreach ($matches as $position => $foundPackage) {
$choices[] = sprintf(' <info>%5s</info> %s', "[$position]", $foundPackage['name']);
$abandoned = '';
if (isset($foundPackage['abandoned'])) {
if (is_string($foundPackage['abandoned'])) {
$replacement = sprintf('Use %s instead', $foundPackage['abandoned']);
} else {
$replacement = 'No replacement was suggested';
}
$abandoned = sprintf('<warning>Abandoned. %s.</warning>', $replacement);
}
$choices[] = sprintf(' <info>%5s</info> %s %s',"[$position]", $foundPackage['name'], $abandoned);
if ($foundPackage['name'] === $package) {
$exactMatch = true;
break;