Avoid rendering problem output for dev-master aliases which is useless
parent
1ea3111583
commit
8a7f3a9a09
|
@ -104,7 +104,7 @@ class Problem
|
||||||
$template = preg_replace('{^\S+ \S+ }', '%s%s ', $message);
|
$template = preg_replace('{^\S+ \S+ }', '%s%s ', $message);
|
||||||
$messages[] = $template;
|
$messages[] = $template;
|
||||||
$templates[$template][$m[1]][$parser->normalize($m[2])] = $m[2];
|
$templates[$template][$m[1]][$parser->normalize($m[2])] = $m[2];
|
||||||
} else {
|
} elseif ($message !== '') {
|
||||||
$messages[] = $message;
|
$messages[] = $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,10 @@ abstract class Rule
|
||||||
$learnedString = ', learned rules:'."\n - ";
|
$learnedString = ', learned rules:'."\n - ";
|
||||||
$reasons = array();
|
$reasons = array();
|
||||||
foreach ($learnedPool[$this->reasonData] as $learnedRule) {
|
foreach ($learnedPool[$this->reasonData] as $learnedRule) {
|
||||||
$reasons[] = $learnedRule->getPrettyString($repositorySet, $request, $pool, $installedMap, $learnedPool);
|
$reason = $learnedRule->getPrettyString($repositorySet, $request, $pool, $installedMap, $learnedPool);
|
||||||
|
if ($reason !== '') {
|
||||||
|
$reasons[] = $reason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$learnedString .= implode("\n - ", array_unique($reasons));
|
$learnedString .= implode("\n - ", array_unique($reasons));
|
||||||
} else {
|
} else {
|
||||||
|
@ -284,7 +287,11 @@ abstract class Rule
|
||||||
|
|
||||||
return 'Conclusion: '.$ruleText.$learnedString;
|
return 'Conclusion: '.$ruleText.$learnedString;
|
||||||
case self::RULE_PACKAGE_ALIAS:
|
case self::RULE_PACKAGE_ALIAS:
|
||||||
$aliasPackage = $this->deduplicateMasterAlias($pool->literalToPackage($literals[0]));
|
$aliasPackage = $pool->literalToPackage($literals[0]);
|
||||||
|
// avoid returning content like "9999999-dev is an alias of dev-master" as it is useless
|
||||||
|
if ($aliasPackage->getVersion() === VersionParser::DEV_MASTER_ALIAS) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
$package = $this->deduplicateMasterAlias($pool->literalToPackage($literals[1]));
|
$package = $this->deduplicateMasterAlias($pool->literalToPackage($literals[1]));
|
||||||
|
|
||||||
return $aliasPackage->getPrettyString() .' is an alias of '.$package->getPrettyString().' and thus requires it to be installed too.';
|
return $aliasPackage->getPrettyString() .' is an alias of '.$package->getPrettyString().' and thus requires it to be installed too.';
|
||||||
|
|
Loading…
Reference in New Issue