protected function buildGenericsDeclaration()

in src/CodegenClassish.hack [289:307]


  protected function buildGenericsDeclaration(): string {
    $generics_count = C\count($this->genericsDecl);
    if ($generics_count === 0) {
      return '';
    }

    if ($generics_count === 1) {
      return '<'.C\onlyx($this->genericsDecl).'>';
    }

    return $this->genericsDecl
      |> Vec\map(
        $$,
        $decl ==> '    '.$decl.",\n",
      )
      |> Str\join($$, '')
      |> Str\strip_suffix($$, ",\n")
      |> "\n  <\n".$$."\n  >";
  }