final public function __construct()

in src/core/Node.hack [50:92]


  final public function __construct(
    KeyedTraversable<string, mixed> $attributes,
    Traversable<?\XHPChild> $children,
    dynamic ...$debug_info
  ) {
    invariant(
      $this->__xhpChildrenDeclaration() === self::__NO_LEGACY_CHILDREN_DECLARATION,
      'The `children` keyword is no longer supported',
    );
    invariant(
      $this->__xhpCategoryDeclaration() === self::__NO_LEGACY_CATEGORY_DECLARATION,
      'The `category` keyword is no longer supported',
    );

    foreach ($children as $child) {
      $this->appendChild($child);
    }

    foreach ($attributes as $key => $value) {
      if (self::isSpreadKey($key)) {
        invariant(
          $value is node,
          'Only XHP can be used with an attribute spread operator',
        );
        $this->spreadElementImpl($value);
      } else {
        $this->setAttribute($key, $value);
      }
    }

    if (\Facebook\XHP\ChildValidation\is_enabled()) {
      if (C\count($debug_info) >= 2) {
        $this->source = (string)$debug_info[0].':'.(string)$debug_info[1];
      } else {
        $this->source =
          'You have child validation on, but debug information is not being '.
          'passed to XHP objects correctly. Ensure xhp.include_debug is on '.
          'in your server configuration. Without this option enabled, '.
          'validation errors will be painful to debug at best.';
      }
    }
    $this->init();
  }