final public function appendChild()

in src/core/Node.hack [103:121]


  final public function appendChild(mixed $child): this {
    if ($this->__isRendered) {
      throw new UseAfterRenderException(
        Str\format("Can't %s after render", __FUNCTION__),
      );
    }
    if ($child is Traversable<_>) {
      foreach ($child as $c) {
        $this->appendChild($c);
      }
    } else if ($child is frag) {
      foreach ($child->getChildren() as $new_child) {
        $this->children[] = $new_child;
      }
    } else if ($child !== null) {
      $this->children[] = $child as \XHPChild;
    }
    return $this;
  }