public function getHierarchyRootFQSEN(CodeBase $code_base) : FullyQualifiedClassName
{
if (!$this->hasParentType()) {
return $this->getFQSEN();
}
if (!$code_base->hasClassWithFQSEN($this->getParentClassFQSEN())) {
// Let this emit an issue elsewhere for the
// parent not existing
return $this->getFQSEN();
}
// Get the parent class
$parent = $this->getParentClass($code_base);
// Prevent infinite loops
if ($parent == $this) {
return $this->getFQSEN();
}
return $parent->getHierarchyRootFQSEN($code_base);
}