Esempio n. 1
0
 /**
  * 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);
     }
 }
Esempio n. 2
0
 /**
  * Text constructor.
  *
  * @param string $text
  * @param NodeInterface $parent
  */
 public function __construct($text, NodeInterface $parent = null)
 {
     parent::__construct($parent);
     $this->text = $text;
 }