Syntactic sugar: registers a GET route.

@param string $uri
@param string $handler
@param string $name
(Optional) An unique name for this route.
491970
public function addGet(string $uri, string $handler, string $name = null)
    {
        $this->addRoute("GET", $uri, $handler, $name);
    }
684673
public function patch(
        string $definition,
        RequestHandlerInterface $handler,
        ?string $name = null,
        $data = null
    ): Route {
        return $this->route(Method::PATCH, $definition, $handler, $name, $data);
    }
978476
public function post($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('POST', $path);
        return $this->addRuler($ruler, $handler);
    }
19389
public function controller($uri, $controller, $names = [])
    {
        $arr = explode('\\', $controller);
        $controllerClassName = $arr[  sizeof($arr) -1  ];
        $routable = (new ControllerInspector)->getRoutable($this->addGroupNamespace($controller), $uri);
        foreach ($routable as $method => $routes) {
            if ($method == 'getMethodProperties') {
                continue;
            }

            foreach ($routes as $route) {
//  original code
//                $this->{$route['verb']}($route['uri'], [
//                        'uses' => $controller.'@'.$method,
//                        'as' => array_get($names, $method)
//                ]);
//                Route::{$route['verb']}( $route['uri'] ,  "{$controller}@{$method}" );

// should add middleware support later
                Route::{$route['verb']}( $route['uri'] ,  "{$controllerClassName}@{$method}" );

// middleware support not working as following
//                Route::{$route['verb']}( $route['uri'] ,  [
//                    'uses' => $controller.'@'.$method,
//                    'as' => array_get($names, $method)
//                ]);
            }
        }
    }
431121
public static function register($name, $path, $controller, $methods=null, $restrictTo=null, $defaultResponse, $options=array()) {
		if( $methods && !is_array($methods) ) {
			$methods = array($methods);
		}
		foreach( static::$knownMethods as $method ) {
			if( (!$methods && !empty(static::$routes[$name][$method])) || ($methods && !in_array($method, $methods)) ) {
				continue;
			}
			static::$routes[$name][$method] = new static($name, $path, $controller, $method, $restrictTo, $defaultResponse, $options);
		}
	}
403496
public function patch($uri, $handler, $middlewares = array())
    {
        return $this->add($this->route('PATCH', $uri, $handler, $middlewares));
    }
297730
public function get(string $path, $handler, array $pathParams = [], array $opts = []): Route
    {
        return $this->add('GET', $path, $handler, $pathParams, $opts);
        // return $this->map(['GET', 'HEAD'], $path, $handler, $pathParams, $opts);
    }
1070269
public function applyData($name, $handler = null)
    {
        if (is_callable($name)) {
            $handler = $name;
            $name    = null;
        }

        $handler($this->getRepository($name), $this->getData());

        return $this;
    }
122696
public function connect($uri, $handler, $middlewares = array())
    {
        return $this->add($this->route('CONNECT', $uri, $handler, $middlewares));
    }
1105251
public function head($uri, $handler, $middlewares = array())
    {
        return $this->add($this->route('HEAD', $uri, $handler, $middlewares));
    }
61398
public function post($uri, $handler, $middlewares = array())
    {
        return $this->add($this->route('POST', $uri, $handler, $middlewares));
    }
809249
public function add($uri, $storage, $name = null, $methods = null){
        $route = new Route($uri, $storage, $methods);
        if($name !== null){
            $this->routes[$name] = $route;
        }else{
            $this->routes[] = $route;
        }
        return $route;
    }
560396
public function map($route, $handler)
    {
        $this->_routes[] = ['/'.$route, $handler];

        if ($handler) {
            $this->_handlers[$handler][] = '/'.$route;
        }
    }
232611
public function register($name, $handler)
    {
        Assert::string($name, 'The handler name must be a string. Got: %s');
        Assert::notEmpty($name, 'The handler name must not be empty.');

        if (!is_object($handler)) {
            Assert::isCallable($handler, 'The handler must be a callable or an object. Got: %s');
        }

        $this->handlers[$name] = $handler;

        if (!$this->selectedHandler) {
            $this->selectedHandler = $name;
        }
    }
412198
public function addPatch(string $uri, string $handler, string $name = null)
    {
        $this->addRoute("PATCH", $uri, $handler, $name);
    }
701935
protected function route($method, $uri, $handler, $middlewares)
    {
        if (is_string($handler) === true)
        {
            $namespace = $this->namespace;

            $namespace !== '' && $namespace .= '\\';

            $handler = $namespace . $handler;
        }

        return new Route($method, $uri, $handler, $middlewares);
    }
743151
public function hasHandlers($name, $handler = null)
    {
        $args = new Args;
        $this->runByHandler($name, $handler, [$this, 'hasHandler'], $args);
        $result = $args->get('hasHandler');

        return $result;
    }