BpNode: Count missing nodes in getStateSummary

Children that are missing should increment the counter, as well as
if no children are present.

So it's easy to find missing nodes following the counters.
This commit is contained in:
Markus Frosch 2017-06-01 16:51:22 +02:00
parent 75a0da12fe
commit 98cc43f01b

View file

@ -68,11 +68,16 @@ class BpNode extends Node
foreach ($counters as $k => $v) {
$this->counters[$k] += $v;
}
} elseif ($child->isMissing()) {
$this->counters['MISSING']++;
} else {
$state = $child->getStateName();
$this->counters[$state]++;
}
}
if (! $this->hasChildren()) {
$this->counters['MISSING']++;
}
}
return $this->counters;
}