in src/PageSections/InterfaceSynopsis.hack [196:238]
private function getInheritanceInformation(ScannedClassish $c): string {
$ret = '';
$ns = $c->getNamespaceName();
if ($ns !== '') {
$ret .= 'namespace '.$ns.";\n\n";
}
if ($c->isAbstract()) {
$ret .= 'abstract ';
}
if ($c->isFinal()) {
$ret .= 'final ';
}
if ($c is ScannedClass) {
$ret .= 'class ';
} else if ($c is ScannedInterface) {
$ret .= 'interface ';
} else if ($c is ScannedTrait) {
$ret .= 'trait ';
} else {
invariant_violation("Don't know what a %s is.", \get_class($c));
}
$ret .= $c->getShortName();
$p = $c->getParentClassInfo();
if ($p !== null) {
$ret .= ' extends '._Private\stringify_typehint($ns, $p);
}
$interfaces = $c->getInterfaceInfo();
if ($interfaces) {
$ret .= $interfaces
|> Vec\map($$, $i ==> _Private\stringify_typehint($ns, $i))
|> Str\join($$, ', ')
|> ' implements '.$$;
}
$ret .= ' {...}';
return "```Hack\n".$ret."\n```";
}