fit = $fit; // Support case-insensitive route matching by ensuring the pattern outline // is lowercase. // @see \Drupal\Core\Routing\RouteProvider::getRoutesByPath() $this->patternOutline = Unicode::strtolower($pattern_outline); $this->numParts = $num_parts; } /** * Returns the fit of this route. * * See RouteCompiler for a definition of how the fit is calculated. * * @return int * The fit of the route. */ public function getFit() { return $this->fit; } /** * Returns the number of parts in this route's path. * * The string "foo/bar/baz" has 3 parts, regardless of how many of them are * placeholders. * * @return int * The number of parts in the path. */ public function getNumParts() { return $this->numParts; } /** * Returns the pattern outline of this route. * * The pattern outline of a route is the path pattern of the route, but * normalized such that all placeholders are replaced with %. * * @return string * The normalized path pattern. */ public function getPatternOutline() { return $this->patternOutline; } /** * Returns the options. * * @return array * The options. */ public function getOptions() { return $this->route->getOptions(); } /** * Returns the defaults. * * @return array * The defaults. */ public function getDefaults() { return $this->route->getDefaults(); } /** * Returns the requirements. * * @return array * The requirements. */ public function getRequirements() { return $this->route->getRequirements(); } /** * {@inheritdoc} */ public function serialize() { // Calling the parent method is safer than trying to optimize out the extra // function calls. $data = unserialize(parent::serialize()); $data['fit'] = $this->fit; $data['patternOutline'] = $this->patternOutline; $data['numParts'] = $this->numParts; return serialize($data); } /** * {@inheritdoc} */ public function unserialize($serialized) { parent::unserialize($serialized); $data = unserialize($serialized); $this->fit = $data['fit']; $this->patternOutline = $data['patternOutline']; $this->numParts = $data['numParts']; } }