1
0
Fork 0

Adding explicit message to `why-not` if package is already installed

Closes #12227
pull/12231/head
Thomas Landauer 2024-12-10 16:37:59 +01:00 committed by GitHub
parent eefa012204
commit e132a5a84a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -126,6 +126,8 @@ abstract class BaseDependencyCommand extends BaseCommand
$extraNotice = ' (version provided by config.platform)';
}
$this->getIO()->writeError('<info>Package "'.$needle.' '.$textConstraint.'" found in version "'.$matchedPackage->getPrettyVersion().'"'.$extraNotice.'.</info>');
} elseif ($inverted) {
$this->getIO()->write('<comment>Package "'.$needle.'" '.$matchedPackage->getPrettyVersion().' is already installed! To find out why, run `composer why '.$needle.'`</comment>');
}
// Include replaced packages for inverted lookups as they are then the actual starting point to consider