/** * Adds the router. * @param mixed * @param IRouter * @return void */ public function offsetSet($index, $route) { if (!$route instanceof IRouter) { throw new Nette\InvalidArgumentException('Argument must be IRouter descendant.'); } parent::offsetSet($index, $route); }
/** * @param mixed $index * @param BookPage $page * @throws \InvalidArgumentException */ function offsetSet($index, $page) { if (!$page instanceof BookPage) { throw new \InvalidArgumentException("Argument must be of type HelpPage."); } elseif ($this->hasPage($page->slug)) { throw new \RuntimeException("Duplicate slug {$page->slug}."); } parent::offsetSet($index, $page); }