classes/Route.php
public static function & map($URLPattern, $callbacks = []){
      $route           = new static($URLPattern);
      $route->callback = [];
      foreach ($callbacks as $method => $callback) {
        $method = strtolower($method);
        if (Request::method() !== $method) continue;
        $route->callback[$method] = $callback;
        $route->methods[$method]  = 1;
      }
      return $route;
    }
public static function & map($URLPattern, $callbacks = []){
      $route           = new static($URLPattern);
      $route->callback = [];
      foreach ($callbacks as $method => $callback) {
        $method = strtolower($method);
        if (Request::method() !== $method) continue;
        $route->callback[$method] = $callback;
        $route->methods[$method]  = 1;
      }
      return $route;
    }
public static function & map ( $ URLPattern , $ callbacks = [ ] ) { $ route = new static ( $ URLPattern ) ; $ route -> callback = [ ] ; foreach ( $ callbacks as $ method => $ callback ) { $ method = strtolower ( $ method ) ; if ( Request :: method ( ) !== $ method ) continue ; $ route -> callback [ $ method ] = $ callback ; $ route -> methods [ $ method ] = 1 ; } return $ route ; }
Map a HTTP Method => callable array to a route.

Example:
<code>
Route::map('/test'[
'get'     => function(){ echo "HTTP GET"; },
'post'    => function(){ echo "HTTP POST"; },
'put'     => function(){ echo "HTTP PUT"; },
'delete'  => function(){ echo "HTTP DELETE"; },
]);
</code>

@param  string $URLPattern The URL to match against, you can define named segments to be extracted and passed to the callback.
@param  array $callbacks The HTTP Method => callable map.
@return Route
Map a HTTP Method = > callable array to a route .