/** * @param self $child * @return static */ public function appendChild(self $child) { $child->attachNode($this); $name = $child->getName(); $this->children[$name] = $child; return $this; }