public static function forFunction($function, array $functionParameters = []) : RouteMatch
    {
        try {
            $controller = new \ReflectionFunction($function);
        } catch (\ReflectionException $e) {
            throw RoutingException::invalidControllerFunction($e, $function);
        }

        return new self($controller, [], $functionParameters);
    }
public static function forFunction($function, array $functionParameters = []) : RouteMatch
    {
        try {
            $controller = new \ReflectionFunction($function);
        } catch (\ReflectionException $e) {
            throw RoutingException::invalidControllerFunction($e, $function);
        }

        return new self($controller, [], $functionParameters);
    }
public static function forFunction ( $ function , array $ functionParameters = [ ] ) : RouteMatch { try { $ controller = new \ ReflectionFunction ( $ function ) ; } catch ( \ ReflectionException $ e ) { throw RoutingException :: invalidControllerFunction ( $ e , $ function ) ; } return new self ( $ controller , [ ] , $ functionParameters ) ; }
Returns a RouteMatch for the given function or closure.

@param string|\Closure $function
@param array           $functionParameters

@return RouteMatch The route match.

@throws RoutingException If the function is invalid.
Returns a RouteMatch for the given function or closure .