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

getLastElementChild() public method

Returns the last element child node
public getLastElementChild ( ) : Element | null
return FluentDOM\Element | null
    public function getLastElementChild()
    {
        if ($this instanceof Document) {
            return $this->documentElement;
        }
        /** @var \DOMNode $this */
        $node = $this->lastChild;
        do {
            if ($node instanceof Element) {
                return $node;
            }
            $node = $node->previousSibling;
        } while ($node instanceof \DOMNode);
        return NULL;
    }