You are here

public function ThemeDataCollector::collect in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/ThemeDataCollector.php \Drupal\webprofiler\DataCollector\ThemeDataCollector::collect()
  2. 8.2 webprofiler/src/DataCollector/ThemeDataCollector.php \Drupal\webprofiler\DataCollector\ThemeDataCollector::collect()
  3. 4.x webprofiler/src/DataCollector/ThemeDataCollector.php \Drupal\webprofiler\DataCollector\ThemeDataCollector::collect()

File

webprofiler/src/DataCollector/ThemeDataCollector.php, line 57

Class

ThemeDataCollector
Class ThemeDataCollector

Namespace

Drupal\webprofiler\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = NULL) {
  $activeTheme = $this->themeManager
    ->getActiveTheme();
  $this->data['activeTheme'] = [
    'name' => $activeTheme
      ->getName(),
    'path' => $activeTheme
      ->getPath(),
    'engine' => $activeTheme
      ->getEngine(),
    'owner' => $activeTheme
      ->getOwner(),
    'baseThemes' => $activeTheme
      ->getBaseThemes(),
    'extension' => $activeTheme
      ->getExtension(),
    'styleSheetsRemove' => $activeTheme
      ->getStyleSheetsRemove(),
    'libraries' => $activeTheme
      ->getLibraries(),
    'regions' => $activeTheme
      ->getRegions(),
  ];
  if ($this->themeNegotiator instanceof ThemeNegotiatorWrapper) {
    $this->data['negotiator'] = [
      'class' => $this
        ->getMethodData($this->themeNegotiator
        ->getNegotiator(), 'determineActiveTheme'),
      'id' => $this->themeNegotiator
        ->getNegotiator()->_serviceId,
    ];
  }
}