private function calculateDepthOfInheritanceTree(ASTClass $class)
{
$dit = 0;
$id = $class->getId();
$root = $class->getId();
foreach ($class->getParentClasses() as $parent) {
if (!$parent->isUserDefined()) {
++$dit;
}
++$dit;
$root = $parent->getId();
}
// Collect max dit value
$this->maxDIT = max($this->maxDIT, $dit);
if (empty($this->rootClasses[$root]) || $this->rootClasses[$root] < $dit) {
$this->rootClasses[$root] = $dit;
}
$this->nodeMetrics[$id][self::M_DEPTH_OF_INHERITANCE_TREE] = $dit;
}