public function add(Route $route)
    {
        foreach ($route->getMethods() as $method) {
            $this->routes[$method][$route->getPath()] = $route;

            $this->allRoutes[$route->getPath()] = $route;
        }

        return $route;
    }
public function add(Route $route)
    {
        foreach ($route->getMethods() as $method) {
            $this->routes[$method][$route->getPath()] = $route;

            $this->allRoutes[$route->getPath()] = $route;
        }

        return $route;
    }
public function add ( Route $ route ) { foreach ( $ route -> getMethods ( ) as $ method ) { $ this -> routes [ $ method ] [ $ route -> getPath ( ) ] = $ route ; $ this -> allRoutes [ $ route -> getPath ( ) ] = $ route ; } return $ route ; }
Add route to the collection.

@param Route $route
Add route to the collection .