public function getExpandedTree(Node ...$nodes): MerkleTree
    {
        $thisTree = $this->nodes;
        foreach ($nodes as $node) {
            $thisTree []= $node;
        }
        return (new MerkleTree(...$thisTree))
            ->setHashSize($this->outputSize)
            ->setPersonalizationString($this->personalization);
    }
public function getExpandedTree(Node ...$nodes): MerkleTree
    {
        $thisTree = $this->nodes;
        foreach ($nodes as $node) {
            $thisTree []= $node;
        }
        return (new MerkleTree(...$thisTree))
            ->setHashSize($this->outputSize)
            ->setPersonalizationString($this->personalization);
    }
public function getExpandedTree ( Node ... $ nodes ) : MerkleTree { $ thisTree = $ this -> nodes ; foreach ( $ nodes as $ node ) { $ thisTree [ ] = $ node ; } return ( new MerkleTree ( ... $ thisTree ) ) -> setHashSize ( $ this -> outputSize ) -> setPersonalizationString ( $ this -> personalization ) ; }
Merkle Trees are immutable. Return a replacement with extra nodes.

@param array<int, Node> $nodes
@return MerkleTree
@throws InvalidDigestLength
Merkle Trees are immutable . Return a replacement with extra nodes .