1
0
Fork 0

Simplify ordering of links (there cannot be multiple links to the same target)

pull/1544/head
perprogramming 2013-01-31 10:19:16 +01:00
parent 704837c574
commit 9219e1ab0a
1 changed files with 1 additions and 9 deletions

View File

@ -60,18 +60,10 @@ class ArrayDumper
foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
if ($links = $package->{'get'.ucfirst($opts['method'])}()) {
usort($links, function (Link $a, Link $b) {
$comparison = strcmp($a->getTarget(), $b->getTarget());
if (0 !== $comparison) {
return $comparison;
}
return strcmp($a->getPrettyConstraint(), $b->getPrettyConstraint());
});
foreach ($links as $link) {
$data[$type][$link->getTarget()] = $link->getPrettyConstraint();
}
ksort($data[$type]);
}
}