You are here

protected function ThemeNegotiatorWrapper::getSortedNegotiators in Devel 8.2

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Theme/ThemeNegotiatorWrapper.php \Drupal\webprofiler\Theme\ThemeNegotiatorWrapper::getSortedNegotiators()
  2. 8 webprofiler/src/Theme/ThemeNegotiatorWrapper.php \Drupal\webprofiler\Theme\ThemeNegotiatorWrapper::getSortedNegotiators()
  3. 4.x webprofiler/src/Theme/ThemeNegotiatorWrapper.php \Drupal\webprofiler\Theme\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
Determine the active theme for the request.

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;
}