- /**
- * Sorts the enhancers and flattens them.
- *
- * @return \Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[]
- * The enhancers ordered by priority.
- */
- public function getRouteEnhancers() {
- if (!isset($this->sortedEnhancers)) {
- $this->sortedEnhancers = $this->sortRouteEnhancers();
- }
-
- return $this->sortedEnhancers;
- }
-
- /**
- * Sort enhancers by priority.
- *
- * The highest priority number is the highest priority (reverse sorting).
- *
- * @return \Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[]
- * The sorted enhancers.
- */
- protected function sortRouteEnhancers() {
- $sortedEnhancers = [];
- krsort($this->enhancers);
-
- foreach ($this->enhancers as $enhancers) {
- $sortedEnhancers = array_merge($sortedEnhancers, $enhancers);
- }
-
- return $sortedEnhancers;
- }
-