src/Tree/AbstractTreeNode.php
public function getSumChildCount(): int
    {
        $count = count($this->children);

        foreach ($this->children as $node) {
            $count += $node->getChildCount();
        }

        return $count;
    }
public function getSumChildCount(): int
    {
        $count = count($this->children);

        foreach ($this->children as $node) {
            $count += $node->getChildCount();
        }

        return $count;
    }
public function getSumChildCount ( ) : int { $ count = count ( $ this -> children ) ; foreach ( $ this -> children as $ node ) { $ count += $ node -> getChildCount ( ) ; } return $ count ; }
Returns the total sum of all children and their children.

@return int The total sum of all children
Returns the total sum of all children and their children .