src/PHPHtmlParser/Dom/InnerNode.php
public function isDescendant(int $id): bool
    {
        if ($this->isChild($id)) {
            return true;
        }

        foreach ($this->children as $childId => $child) {
            /** @var InnerNode $node */
            $node = $child['node'];
            if ($node instanceof InnerNode &&
                $node->hasChildren() &&
                $node->isDescendant($id)
            ) {
                return true;
            }
        }

        return false;
    }
public function isDescendant(int $id): bool
    {
        if ($this->isChild($id)) {
            return true;
        }

        foreach ($this->children as $childId => $child) {
            /** @var InnerNode $node */
            $node = $child['node'];
            if ($node instanceof InnerNode &&
                $node->hasChildren() &&
                $node->isDescendant($id)
            ) {
                return true;
            }
        }

        return false;
    }
public function isDescendant ( int $ id ) : bool { if ( $ this -> isChild ( $ id ) ) { return true ; } foreach ( $ this -> children as $ childId => $ child ) { /** @var InnerNode $node */ $ node = $ child [ 'node' ] ; if ( $ node instanceof InnerNode && $ node -> hasChildren ( ) && $ node -> isDescendant ( $ id ) ) { return true ; } } return false ; }
Checks if the given node id is a descendant of the
current node.

@param int $id
@return bool
Checks if the given node id is a descendant of the current node .