/** * {@inheritdoc} */ public function addRoute(Route $route) { if (parent::has($this->getStorageName($route))) { throw new \InvalidArgumentException("Route to '{$route->getPath()}'" . " with method(s) {$route->getMethodsAsString()} already exists."); } parent::set($this->getStorageName($route), $route); }
/** * Returns true if collection has header with given case-insensitive name. * Returns false otherwise. * * @param string $key A key to check. * * @return bool */ public function has($name) { return parent::has($this->normalizeName($name)); }