/** * {@inheritdoc} */ public function removeChild(NodeInterface $child) { foreach ($this->children as $key => $myChild) { if ($child == $myChild) { unset($this->children[$key]); } } $this->children = array_values($this->children); $child->setParent(null); return $this; }