src/Router.php
public function add($route, $handler)
    {
        if (trim($route) === '') {
            $token = null;
        } else {
            $token = $this->tokenizer->createToken($route);
        }
        $route = new Route($token, $handler);

        $this->routes[] = $route;

        return $route;
    }
public function add($route, $handler)
    {
        if (trim($route) === '') {
            $token = null;
        } else {
            $token = $this->tokenizer->createToken($route);
        }
        $route = new Route($token, $handler);

        $this->routes[] = $route;

        return $route;
    }
public function add ( $ route , $ handler ) { if ( trim ( $ route ) === '' ) { $ token = null ; } else { $ token = $ this -> tokenizer -> createToken ( $ route ) ; } $ route = new Route ( $ token , $ handler ) ; $ this -> routes [ ] = $ route ; return $ route ; }
Registers a new Route with this Router

@param string   $route   the route expression to match
@param callable $handler route callback that will be executed when this route expression matches
@return Route
@throws InvalidArgumentException if the route expression is invalid
Registers a new Route with this Router