public static function compile(Route
$route): CompiledRoute
{ // Symfony 4 requires that all UTF-8 route patterns have the "utf8" option
// set and Drupal does not support non UTF-8 routes.
$route->
setOption('utf8', TRUE
);
$symfony_compiled = parent::
compile($route);
// The Drupal-specific compiled information.
$stripped_path =
static::
getPathWithoutDefaults($route);
$fit =
static::
getFit($stripped_path);
$pattern_outline =
static::
getPatternOutline($stripped_path);
// We count the number of parts including any optional trailing parts. This
// allows the RouteProvider to filter candidate routes more efficiently.
$num_parts =
count(explode('/',
trim($route->
getPath(), '/'
)));
return new CompiledRoute( $fit,
$pattern_outline,
$num_parts,