public function addRoute(string $path, string $controller, string $action = 'index', string $method = Request::METHOD_GET) : self
    {
        $endPoint = new RouteEndpoint($this->namespace, $controller, $action, $method);
        $this->routes[] = new Route($path, $endPoint);
        
        return $this;
    }
public function addRoute(string $path, string $controller, string $action = 'index', string $method = Request::METHOD_GET) : self
    {
        $endPoint = new RouteEndpoint($this->namespace, $controller, $action, $method);
        $this->routes[] = new Route($path, $endPoint);
        
        return $this;
    }
public function addRoute ( string $ path , string $ controller , string $ action = 'index' , string $ method = Request :: METHOD_GET ) : self { $ endPoint = new RouteEndpoint ( $ this -> namespace , $ controller , $ action , $ method ) ; $ this -> routes [ ] = new Route ( $ path , $ endPoint ) ; return $ this ; }
Add a new route to the collection

@param string $path
@param string $controller
@param string $action
@param string $method

@return $this
Add a new route to the collection