1
0
Fork 0

Improve decisions debug output

pull/9477/head
Nils Adermann 2020-11-13 16:58:43 +01:00
parent c02d2842b0
commit d19b858e20
1 changed files with 7 additions and 2 deletions

View File

@ -197,15 +197,20 @@ class Decisions implements \Iterator, \Countable
}
}
public function __toString()
public function toString(Pool $pool = null)
{
$decisionMap = $this->decisionMap;
ksort($decisionMap);
$str = '[';
foreach ($decisionMap as $packageId => $level) {
$str .= $packageId.':'.$level.',';
$str .= (($pool) ? $pool->literalToPackage($packageId) : $packageId).':'.$level.',';
}
$str .= ']';
return $str;
}
public function __toString()
{
return $this->toString();
}
}