/** * Attach a route to collection * * @param instanceof Attw\Router\Route $route */ public function add(Route $route) { if ($this->has($route->getName())) { throw new RouterException('A route with this name have already was registred'); } $this->routes[$route->getName()] = $route; }