/** * @param AnnotationInterface $child * @return Route */ public function addChild(AnnotationInterface $child) { // trim leading slash from child route if parent is root route (/). if ($this->route == '/') { $child->setRoute(ltrim($child->getRoute(), '/')); } $this->children[] = $child; return $this; }