1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

Improve error reporting for RULE_PACKAGE_ALIAS

This commit is contained in:
Jordi Boggiano 2020-06-02 10:35:04 +02:00
parent 0ea9eafcaf
commit 2ddf4346ef
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
2 changed files with 5 additions and 2 deletions

View file

@ -288,7 +288,10 @@ abstract class Rule
return 'Conclusion: '.$ruleText.$learnedString;
case self::RULE_PACKAGE_ALIAS:
return $ruleText;
$aliasPackage = $this->deduplicateMasterAlias($pool->literalToPackage($literals[0]));
$package = $this->deduplicateMasterAlias($pool->literalToPackage($literals[1]));
return $aliasPackage->getPrettyString() .' is an alias of '.$package->getPrettyString().' and thus requires it to be installed too.';
default:
return '('.$ruleText.')';
}