public static function fromJSON()

in codegen/syntax/NamespaceGroupUseDeclaration.hack [48:135]


  public static function fromJSON(
    dict<arraykey, mixed> $json,
    string $file,
    int $initial_offset,
    string $source,
    string $_type_hint,
  ): this {
    $offset = $initial_offset;
    $keyword = Node::fromJSON(
      ($json['namespace_group_use_keyword']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'UseToken',
    );
    $keyword = $keyword as nonnull;
    $offset += $keyword->getWidth();
    $kind = Node::fromJSON(
      ($json['namespace_group_use_kind'] ?? dict['kind' => 'missing'])
        as dict<_, _>,
      $file,
      $offset,
      $source,
      'Token',
    );
    $offset += $kind?->getWidth() ?? 0;
    $prefix = Node::fromJSON(
      ($json['namespace_group_use_prefix']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'QualifiedName',
    );
    $prefix = $prefix as nonnull;
    $offset += $prefix->getWidth();
    $left_brace = Node::fromJSON(
      ($json['namespace_group_use_left_brace']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'LeftBraceToken',
    );
    $left_brace = $left_brace as nonnull;
    $offset += $left_brace->getWidth();
    $clauses = Node::fromJSON(
      ($json['namespace_group_use_clauses']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'NodeList<ListItem<NamespaceUseClause>>',
    );
    $clauses = $clauses as nonnull;
    $offset += $clauses->getWidth();
    $right_brace = Node::fromJSON(
      ($json['namespace_group_use_right_brace']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'RightBraceToken',
    );
    $right_brace = $right_brace as nonnull;
    $offset += $right_brace->getWidth();
    $semicolon = Node::fromJSON(
      ($json['namespace_group_use_semicolon']) as dict<_, _>,
      $file,
      $offset,
      $source,
      'SemicolonToken',
    );
    $semicolon = $semicolon as nonnull;
    $offset += $semicolon->getWidth();
    $source_ref = shape(
      'file' => $file,
      'source' => $source,
      'offset' => $initial_offset,
      'width' => $offset - $initial_offset,
    );
    return new static(
      /* HH_IGNORE_ERROR[4110] */ $keyword,
      /* HH_IGNORE_ERROR[4110] */ $kind,
      /* HH_IGNORE_ERROR[4110] */ $prefix,
      /* HH_IGNORE_ERROR[4110] */ $left_brace,
      /* HH_IGNORE_ERROR[4110] */ $clauses,
      /* HH_IGNORE_ERROR[4110] */ $right_brace,
      /* HH_IGNORE_ERROR[4110] */ $semicolon,
      $source_ref,
    );
  }