/** * */ public function __clone() { parent::__clone(); $children = $this->children; $this->children = []; foreach ($children as $child) { $this->appendChild(clone $child); } }
/** * Text constructor. * * @param string $text * @param NodeInterface $parent */ public function __construct($text, NodeInterface $parent = null) { parent::__construct($parent); $this->text = $text; }