function ThemeNegotiatorWrapper::getSortedNegotiators

Returns the sorted array of theme negotiators.

Return value

array|\Drupal\Core\Theme\ThemeNegotiatorInterface[] An array of theme negotiator objects.

TODO: remove this method when we decide to drop Drupal 8.3.x support.

1 call to ThemeNegotiatorWrapper::getSortedNegotiators()
ThemeNegotiatorWrapper::determineActiveTheme in webprofiler/src/Theme/ThemeNegotiatorWrapper.php

File

webprofiler/src/Theme/ThemeNegotiatorWrapper.php, line 66

Class

ThemeNegotiatorWrapper
Class ThemeNegotiatorWrapper

Namespace

Drupal\webprofiler\Theme

Code

protected function getSortedNegotiators() {
    if (!isset($this->sortedNegotiators)) {
        // Sort the negotiators according to priority.
        krsort($this->negotiators);
        // Merge nested negotiators from $this->negotiators into
        // $this->sortedNegotiators.
        $this->sortedNegotiators = [];
        foreach ($this->negotiators as $builders) {
            $this->sortedNegotiators = array_merge($this->sortedNegotiators, $builders);
        }
    }
    return $this->sortedNegotiators;
}