Bind handler to route pattern
@return NULL
@param $pattern string|array
@param $handler callback
@param $ttl int
@param $kbps int
556985
function route($pattern,$handler,$ttl=0,$kbps=0) {
		$types=['sync','ajax','cli'];
		$alias=null;
		if (is_array($pattern)) {
			foreach ($pattern as $item)
				$this->route($item,$handler,$ttl,$kbps);
			return;
		}
		preg_match('/([\|\w]+)\h+(?:(?:@?(.+?)\h*:\h*)?(@(\w+)|[^\h]+))'.
			'(?:\h+\[('.implode('|',$types).')\])?/u',$pattern,$parts);
		if (isset($parts[2]) && $parts[2])
			$this->hive['ALIASES'][$alias=$parts[2]]=$parts[3];
		elseif (!empty($parts[4])) {
			if (empty($this->hive['ALIASES'][$parts[4]]))
				user_error(sprintf(self::E_Named,$parts[4]),E_USER_ERROR);
			$parts[3]=$this->hive['ALIASES'][$alias=$parts[4]];
		}
		if (empty($parts[3]))
			user_error(sprintf(self::E_Pattern,$pattern),E_USER_ERROR);
		$type=empty($parts[5])?0:constant('self::REQ_'.strtoupper($parts[5]));
		foreach ($this->split($parts[1]) as $verb) {
			if (!preg_match('/'.self::VERBS.'/',$verb))
				$this->error(501,$verb.' '.$this->hive['URI']);
			$this->hive['ROUTES'][$parts[3]][$type][strtoupper($verb)]=
				[$handler,$ttl,$kbps,$alias];
		}
	}
560396
public function map($route, $handler)
    {
        $this->_routes[] = ['/'.$route, $handler];

        if ($handler) {
            $this->_handlers[$handler][] = '/'.$route;
        }
    }
1301069
public function match($pattern, callable $to)
    {
        $route = new TopicRoute($pattern, $to);
        $controller = new Controller($route);
        $routeName = $controller->generateRouteName('');

        $controller->bind($routeName);

        $this->routeCollection->add($routeName, $route);

        return $controller;
    }
521889
public function route(Route $route, $handler) 
	{
		if (!is_callable($handler)) {
			throw new Exception('Route handler must be callable.');
		}

		$this->currentContext->addRoute($route, $handler);
		return $this;
	}
48602
public function map($methods, $pattern, $callable)
	{
		$methods = (array) $methods;
		if (!is_string($pattern)) {
			throw new InvalidArgumentException('Route pattern must be a string');
		}
		
		// Prepend parent group pattern(s)
		if ($this->routeGroups) {
			$pattern = $this->processGroups() . $pattern;
		}
		
		// According to RFC methods are defined in uppercase (See RFC 7231)
		$methods = array_map("strtoupper", $methods);
		
		// Add route
		$route = $this->createRoute($methods, $pattern, $callable);
		$this->routes[$route->getIdentifier()] = $route;
		$this->routeCounter++;
		
		return $route;
	}
351064
public function get(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "GET") {
            $this->mapRoute($pattern, $callback);
        }
    }
325209
public function option($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('OPTION', $path);
        return $this->addRuler($ruler, $handler);
    }
917179
public RouteMatcher patchWithRegEx(String regex, Handler<HttpServerRequest> handler) {
		addRegEx(regex, handler, patchBindings);
		return this;
	}
30576
public function put($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('PUT', $path);
        return $this->addRuler($ruler, $handler);
    }
887202
public function handler(RouteHandlerInterface $handler)
    {
        $this->_method('before', [$handler, 'before']);
        $this->_method('wrap', [$handler, 'wrap']);
        $this->_method('after', [$handler, 'after']);

        return $this;
    }
601390
public Router patch(@NotNull final String pattern, @NotNull final IMiddleware... handlers) {
        addPattern("PATCH", pattern, handlers, patchBindings);
        return this;
    }
1119490
public Router trace(@NotNull final String pattern, @NotNull final IMiddleware... handlers) {
        addPattern("TRACE", pattern, handlers, traceBindings);
        return this;
    }
533635
public function bindHandler($commandName, $handler)
    {
        // If the $handler given is an instance of CommandHandler, simply bind that
        if ($handler instanceof CommandHandler) {
            $this->handlers[$commandName] = $handler;
            return;
        }

        // If the handler given is callable, wrap it up in a CallableCommandHandler for executing later
        if (is_callable($handler)) {
            return $this->bindHandler($commandName, new CallableCommandHandler($handler));
        }

        // If the handler given is a string, wrap it up in a LazyLoadingCommandHandler for loading later
        if (is_string($handler)) {
            return $this->bindHandler($commandName, new LazyLoadingCommandHandler($handler, $this->container));
        }

        throw new \InvalidArgumentException('Could not push handler. Command Handlers should be an
            instance of Chief\CommandHandler, a callable, or a string representing a CommandHandler class');
    }
186506
public Router trace(@NotNull final Pattern regex, @NotNull final IMiddleware... handlers) {
        addRegEx("TRACE", regex, handlers, traceBindings);
        return this;
    }
931204
public function uriNotMatch($pattern, callable $handler)
    {
        if (!preg_match($pattern, $this->getCleanUri(), $matches)) {
            return $handler($this->getCleanUri(), $matches);
        }
    }
201371
public function all($pattern, $handler)
    {

        return $this->addRoute(
            new Route([Method::GET, Method::POST], $pattern, $handler)
        );
    }
978476
public function post($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('POST', $path);
        return $this->addRuler($ruler, $handler);
    }