public function getInheritanceTree() { $parent_entries = []; $parents = $this->reflection->getParentClassNameList(); $currentNamespace = $this->reflection->getNamespaceName(); if (!empty($parents)) { foreach ($parents as $key => $parent) { $string = ':ref:`'; $string .= str_replace('\\', '-', $parent) . "`"; $parent_entries[] = $string; } } else { return ""; } $refs = join(' => ', $parent_entries); $title = "**Inheritance Hierarchy:**\n"; return "{$title}{$refs}\n\n"; }
/** * * @param ReflectionClass $reflection * @return string */ protected static function getParents(ReflectionClass $reflection) { return implode("\n", $reflection->getParentClassNameList()); }