src/Request.php
public static function process(Request $request, $routes = null)
    {
        Base::getLog()->debug(__METHOD__ . ' process request and find the route');

        $routes = (empty($routes)) ? Route::all() : $routes;
        Base::getLog()->debug(__METHOD__ . ' get route list for process route', [
            'routes' => array_keys($routes),
        ]);

        $params = null;
        foreach ($routes as $name => $route)
        {
            Base::getLog()->debug(__METHOD__ . ' check route', [
                'name'   => $name,
                'method' => $request->method,
            ]);

            /* @var $route Entry */
            if ($params = $route->matches($request->uri, $request->method))
            {
                Base::getLog()->debug(__METHOD__ . ' matched route found', [
                    'name'   => $name,
                    'params' => $params,
                ]);
                return [
                    'params' => $params,
                    'route'  => $route,
                ];
            }
        }

        return null;
    }
public static function process(Request $request, $routes = null)
    {
        Base::getLog()->debug(__METHOD__ . ' process request and find the route');

        $routes = (empty($routes)) ? Route::all() : $routes;
        Base::getLog()->debug(__METHOD__ . ' get route list for process route', [
            'routes' => array_keys($routes),
        ]);

        $params = null;
        foreach ($routes as $name => $route)
        {
            Base::getLog()->debug(__METHOD__ . ' check route', [
                'name'   => $name,
                'method' => $request->method,
            ]);

            /* @var $route Entry */
            if ($params = $route->matches($request->uri, $request->method))
            {
                Base::getLog()->debug(__METHOD__ . ' matched route found', [
                    'name'   => $name,
                    'params' => $params,
                ]);
                return [
                    'params' => $params,
                    'route'  => $route,
                ];
            }
        }

        return null;
    }
解析请求，查找路由

@param  Request $request Request
@param  Route[] $routes  Route
@return array