/** * Node constructor. * * @param NodeInterface $parent * @param array $children */ public function __construct(NodeInterface $parent = null, array $children = null) { parent::__construct($parent); $this->children = []; if (!is_null($children)) { $this->setChildren($children); } }
/** * Text constructor. * * @param string $text * @param NodeInterface $parent */ public function __construct($text, NodeInterface $parent = null) { parent::__construct($parent); $this->text = $text; }