Matches a request against all queued matchers.
Request $request The request to match:
array An array of parameters
\Symfony\Component\Routing\Exception\ResourceNotFoundException If no matching resource could be found
\Symfony\Component\Routing\Exception\MethodNotAllowedException If a matching resource was found but the request method is not allowed
Overrides RequestMatcherInterface::matchRequest
public function matchRequest(Request $request) {
$methodNotAllowed = null;
foreach ($this
->all() as $matcher) {
try {
return $matcher
->matchRequest($request);
} catch (ResourceNotFoundException $e) {
// Needs special care
} catch (MethodNotAllowedException $e) {
$methodNotAllowed = $e;
}
}
throw $methodNotAllowed ?: new ResourceNotFoundException("None of the matchers in the chain matched this request.");
}