/** * {@inheritdoc} */ public function add($routeName, RouteInterface $route) { if (!is_string($routeName)) { throw new \InvalidArgumentException('Routename must be string.'); } $this->routes[$routeName] =& $route; foreach ($route->getMethods() as $method) { $this->methodIndex[$method][$routeName] = true; } foreach ($route->getSchemes() as $scheme) { $this->schemeIndex[$scheme][$routeName] = true; } }