/** * Adds a node. * * @param Node $node * @return self * * @throws \InvalidArgumentException */ public function add(Node $node) { $this->children[$node->hashCode()] = $node->setParent($this); return $this; }