public function route(Request $httpRequest)
{
$cachedMatchResults = $this->routerCachingService->getCachedMatchResults($httpRequest);
if ($cachedMatchResults !== false) {
return $cachedMatchResults;
}
$this->lastMatchedRoute = null;
$this->createRoutesFromConfiguration();
/** @var $route Route */
foreach ($this->routes as $route) {
if ($route->matches($httpRequest) === true) {
$this->lastMatchedRoute = $route;
$matchResults = $route->getMatchResults();
if ($matchResults !== null) {
$this->routerCachingService->storeMatchResults($httpRequest, $matchResults);
}
$this->systemLogger->log(sprintf('Router route(): Route "%s" matched the path "%s".', $route->getName(), $httpRequest->getRelativePath()), LOG_DEBUG);
return $matchResults;
}
}
$this->systemLogger->log(sprintf('Router route(): No route matched the route path "%s".', $httpRequest->getRelativePath()), LOG_NOTICE);
return null;
}