protected function matchCollection($pathinfo, RouteCollection
$routes): array
{ // Try a case-sensitive match.
$match =
$this->
doMatchCollection($pathinfo,
$routes, TRUE
);
// Try a case-insensitive match.
if ($match === NULL &&
$routes->
count() > 0
) { $match =
$this->
doMatchCollection($pathinfo,
$routes, FALSE
);
} if ($match === NULL
) { throw 0 <
count($this->allow
) ?
new MethodNotAllowedException(array_unique($this->allow
)) :
new ResourceNotFoundException(sprintf('No routes found for "%s".',
$this->currentPath->
getPath()));
} return $match;
} /**
* Tries to match a URL with a set of routes.
*
* This code is very similar to Symfony's UrlMatcher::matchCollection() but it
* supports case-insensitive matching. The static prefix optimization is
* removed as this duplicates work done by the query in
* RouteProvider::getRoutesByPath().
*
* @param string $pathinfo
* The path info to be parsed
* @param \Symfony\Component\Routing\RouteCollection $routes
* The set of routes.
* @param bool $case_sensitive
* Determines if the match should be case-sensitive of not.
*
* @return array|null
* An array of parameters. NULL when there is no match.
*
* @see \Symfony\Component\Routing\Matcher\UrlMatcher::matchCollection()
* @see \Drupal\Core\Routing\RouteProvider::getRoutesByPath()
*/