Implements Drupal\Core\Routing\FinalMatcherInterface::matchRequest().
Overrides FinalMatcherInterface::matchRequest
public function matchRequest(Request $request) {
// Return whatever the first route in the collection is.
foreach ($this->routes as $name => $route) {
$path = '/' . $request->attributes
->get('system_path');
$route
->setOption('compiler_class', '\\Drupal\\Core\\Routing\\RouteCompiler');
$compiled = $route
->compile();
preg_match($compiled
->getRegex(), $path, $matches);
$route
->setOption('_name', $name);
return array_merge($this
->mergeDefaults($matches, $route
->getDefaults()), array(
'_route' => $route,
));
}
}