Compiles the current route instance.
\Symfony\Component\Routing\Route $route: A Route instance.
\Drupal\Core\Routing\CompiledRoute A CompiledRoute instance.
Overrides RouteCompilerInterface::compile
public function compile(Route $route) {
$stripped_path = $this
->getPathWithoutDefaults($route);
$fit = $this
->getFit($stripped_path);
$pattern_outline = $this
->getPatternOutline($stripped_path);
$num_parts = count(explode('/', trim($pattern_outline, '/')));
$regex = $this
->getRegex($route, $route
->getPattern());
return new CompiledRoute($route, $fit, $pattern_outline, $num_parts, $regex);
}