Shortcut to return the first child.

@return AbstractNode
@uses $this->getChild()
776196
public function firstChild()
    {
        reset($this->children);
        $key = key($this->children);

        return $this->getChild($key);
    }
657078
public function getChild()
    {
        $children = $this->getChildren();

        if (!$children) {
            throw new OutOfBoundsException(sprintf(
                'Expected exactly one child, got "%s"',
                count($children)
            ));
        }

        if (count($children) > 1) {
            throw new OutOfBoundsException(sprintf(
                'More than one child node but getChild will only ever return one. "%d" returned.',
                count($children)
            ));
        }

        return current($children);
    }
1270056
public function getTree() {
    $children = array();
    $properties = $this->getChildProperties();
    $child = $this->head;
    $i = 0;
    while ($child) {
      $key = array_search($child, $properties, TRUE);
      if (!$key) {
        $key = $i;
      }
      if ($child instanceof ParentNode) {
        $children[$key] = $child->getTree();
      }
      else {
        /** @var TokenNode $child */
        $children[$key] = array($child->getTypeName() => $child->getText());
      }
      $child = $child->next;
      $i++;
    }
    $class_name = get_class($this);
    return array($class_name => $children);
  }
2119
public function prev()
    {
        return $this->getParent() !== null ? $this->getParent()->getChildByIndex($this->getIndex() - 1) : null;
    }
1216368
public function getChildren() 
    {
        if (!$this->_children) { 

			$this->_children = new Iterator\Catalog\Children( $this );          
        
        }
        return $this->_children;
    }
531062
public function getChildren()
    {
        $element = $this->current();
        $childContext = $this->elementProcessor->processElementChildren(
            $element,
            $this->contexts[$this->contextMap[$this->key()]]
        );
        return new static($element->childNodes, $childContext, $this->elementProcessor);
    }
911673
public function getRoot() : Node {
        $node = $this;
        while ($node->parent !== null) {
            $node = $node->parent;
        }
        return $node;
    }
368967
public function first()
    {
        $arr = $this->val();
        $first = reset($arr);

        return StdObjectWrapper::returnStdObject($first);
    }
1341546
private Node getFirstChild(Node node) {

		if (node == null)
			return null;

		Node newNode = node.getFirstChild();
		if (newNode == null)
			return null;

		int accept = acceptNode(newNode);
		if (accept == NodeFilter.FILTER_ACCEPT)
			return newNode;
		else if (accept == NodeFilter.FILTER_SKIP && newNode.hasChildNodes())
			return getFirstChild(newNode);

		// if (accept == NodeFilter.REJECT_NODE)
		return getNextSibling(newNode);
	}
115407
protected function getNodeBuilder()
    {
        if (null === $this->nodeBuilder) {
            $this->nodeBuilder = new NodeBuilder();
        }

        return $this->nodeBuilder->setParent($this);
    }
1206836
public function first()
    {
        if ($this->isEmpty()) {
            return $this->makeItem(null);
        }

        $arResultIDList = $this->arElementIDList;

        $iElementID = array_shift($arResultIDList);

        return $this->makeItem($iElementID);
    }
157363
public function next_sibling()
    {
        if ($this->parent === null) {
            return null;
        }

        $idx = 0;
        $count = count($this->parent->children);
        while ($idx < $count && $this !== $this->parent->children[$idx]) {
            ++$idx;
        }
        if (++$idx >= $count) {
            return null;
        }
        return $this->parent->children[$idx];
    }
502642
public function getFirst()
    {
        $row = $this->getIterator()->current();

        if ($row !== null) {
            $this->close(); // don't leave the SQL statement open
        }

        return $row;
    }
1007063
public function getFirst()
    {
        $this->internalDataListUpdate();
        if (isset($this->internalDataListData[0])) {
            return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
        }
        return null;
    }
654356
public function getFullStart() : int {
        foreach($this::CHILD_NAMES as $name) {

            if (($child = $this->$name) !== null) {

                if (\is_array($child)) {
                    if(!isset($child[0])) {
                        continue;
                    }
                    $child = $child[0];
                }

                if ($child instanceof Node) {
                    return $child->getFullStart();
                }

                if ($child instanceof Token) {
                    return $child->fullStart;
                }

                throw new \Exception("Unknown type in AST: " . \gettype($child));
            }
        };

        throw new \RuntimeException("Could not resolve full start position");
    }
581078
public function getRoot()
    {
        $next_parent = $this->getParent();
        $parent = null;
        while ($next_parent) {
            $parent = $next_parent;
            $next_parent = $parent->getParent();
        }

        return $parent ? $parent : $this;
    }
1194612
public function getChildren()
    {
        if($this->children === null)
        {
            $this->children = $this->getDescendants(1);
        }

        return $this->children;
    }