1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Merge pull request #7625 from naderman/repository-set

Separate RepositorySet from Package Pool, load only metadata of packages directly required
This commit is contained in:
Nils Adermann 2018-09-12 14:22:01 +02:00 committed by GitHub
commit 5c491ecc9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 826 additions and 507 deletions

View file

@ -126,7 +126,7 @@ abstract class Rule
abstract public function isAssertion();
public function getPrettyString(Pool $pool, array $installedMap = array())
public function getPrettyString(Pool $pool, array $installedMap = array(), array $learnedPool = array())
{
$literals = $this->getLiterals();
@ -230,7 +230,18 @@ abstract class Rule
case self::RULE_PACKAGE_IMPLICIT_OBSOLETES:
return $ruleText;
case self::RULE_LEARNED:
return 'Conclusion: '.$ruleText;
// TODO not sure this is a good idea, most of these rules should be listed in the problem anyway
$learnedString = '(learned rule, ';
if (isset($learnedPool[$this->reasonData])) {
foreach ($learnedPool[$this->reasonData] as $learnedRule) {
$learnedString .= $learnedRule->getPrettyString($pool, $installedMap, $learnedPool);
}
} else {
$learnedString .= 'reasoning unavailable';
}
$learnedString .= ')';
return 'Conclusion: '.$ruleText.' '.$learnedString;
case self::RULE_PACKAGE_ALIAS:
return $ruleText;
default: