FluentDOM\Node\ParentNode\Implementation::getFirstElementChild PHP Method

getFirstElementChild() public method

Returns the first element child node
public getFirstElementChild ( ) : Element | null
return FluentDOM\Element | null
    public function getFirstElementChild()
    {
        if ($this instanceof Document) {
            return $this->documentElement;
        }
        $node = $this->firstChild;
        do {
            if ($node instanceof Element) {
                return $node;
            }
            $node = $node->nextSibling;
        } while ($node instanceof \DOMNode);
        return NULL;
    }