Drest\Mapping\RouteMetaData::matches PHP Method

matches() public method

Does this request match the route pattern
public matches ( DrestCommon\Request\Request $request, boolean $matchVerb = true, string $basePath = null ) : boolean
$request DrestCommon\Request\Request
$matchVerb boolean - Whether you want to match the route using the request HTTP verb - useful for OPTIONS requests to provide route info
$basePath string - add a base path to the route pattern
return boolean $result
    public function matches(Request $request, $matchVerb = true, $basePath = null)
    {
        $matcher = new RouteMatcher($this);
        if (!$matcher->matches($request, $matchVerb, $basePath)) {
            return false;
        }
        // set determined parameters from running the match
        $this->route_params = $matcher->getRouteParams();
        $this->unmapped_route_params = $matcher->getUnmappedRouteParams();
        $this->param_names = $matcher->getParamNames();
        $this->param_names_path = $matcher->getParamNamesPath();
        return true;
    }