function 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,
        ];
    }
}