protected function mapRoute($args)
    {
        $pattern = array_shift($args);
        $callable = array_pop($args);
        $route = $this->router->map($pattern, $callable);
        if (count($args) > 0) {
            $route->setMiddleware($args);
        }

        return $route;
    }
protected function mapRoute($args)
    {
        $pattern = array_shift($args);
        $callable = array_pop($args);
        $route = $this->router->map($pattern, $callable);
        if (count($args) > 0) {
            $route->setMiddleware($args);
        }

        return $route;
    }
protected function mapRoute ( $ args ) { $ pattern = array_shift ( $ args ) ; $ callable = array_pop ( $ args ) ; $ route = $ this -> router -> map ( $ pattern , $ callable ) ; if ( count ( $ args ) > 0 ) { $ route -> setMiddleware ( $ args ) ; } return $ route ; }
Add GET|POST|PUT|DELETE route

Adds a new route to the router with associated callable. This
route will only be invoked when the HTTP request's method matches
this route's method.

ARGUMENTS:

First:       string  The URL pattern (REQUIRED)
In-Between:  mixed   Anything that returns TRUE for `is_callable` (OPTIONAL)
Last:        mixed   Anything that returns TRUE for `is_callable` (REQUIRED)

The first argument is required and must always be the
route pattern (ie. '/books/:id').

The last argument is required and must always be the callable object
to be invoked when the route matches an HTTP request.

You may also provide an unlimited number of in-between arguments;
each interior argument must be callable and will be invoked in the
order specified before the route's callable is invoked.

USAGE:

Slim::get('/foo'[, middleware, middleware, ...], callable);

@param   array (See notes above)
@return  \Slim\Route
Add GET|POST|PUT|DELETE route