You are here

protected function NestedMatcher::sortFilters in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/NestedMatcher/NestedMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher::sortFilters()

Sort filters by priority.

The highest priority number is the highest priority (reverse sorting).

Return value

RouteFilterInterface[] the sorted filters

1 call to NestedMatcher::sortFilters()
NestedMatcher::getRouteFilters in vendor/symfony-cmf/routing/NestedMatcher/NestedMatcher.php
Sorts the filters and flattens them.

File

vendor/symfony-cmf/routing/NestedMatcher/NestedMatcher.php, line 178

Class

NestedMatcher
A more flexible approach to matching. The route collection to match against can be dynamically determined based on the request and users can inject their own filters or use a custom final matching strategy.

Namespace

Symfony\Cmf\Component\Routing\NestedMatcher

Code

protected function sortFilters() {
  $sortedFilters = array();
  krsort($this->filters);
  foreach ($this->filters as $filters) {
    $sortedFilters = array_merge($sortedFilters, $filters);
  }
  return $sortedFilters;
}