Tries to match a URL path with a set of routes.
If the matcher can not find information, it must throw one of the exceptions documented below.
@api
string $pathinfo The path info to be parsed (raw format, i.e. not: urldecoded)
array An array of parameters
ResourceNotFoundException If the resource could not be found
MethodNotAllowedException If the resource was found but the request method is not allowed
Overrides UrlMatcherInterface::match
public function match($pathinfo) {
if (!empty($this->uriFilterRegexp) && !preg_match($this->uriFilterRegexp, $pathinfo)) {
throw new ResourceNotFoundException("{$pathinfo} does not match the '{$this->uriFilterRegexp}' pattern");
}
$matcher = $this
->getMatcher();
if (!$matcher instanceof UrlMatcherInterface) {
throw new \InvalidArgumentException('Wrong matcher type, you need to call matchRequest');
}
$defaults = $matcher
->match($pathinfo);
return $this
->applyRouteEnhancers($defaults, Request::create($pathinfo));
}