You are here

public function CriticalCssProvider::__construct in Critical CSS 8

CriticalCssProvider constructor.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: Request.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: Config Factory.

\Drupal\Core\Routing\ResettableStackedRouteMatchInterface $current_route_match: Current route.

\Drupal\Core\Path\CurrentPathStack $current_path_stack: Current path.

\Drupal\Core\Session\AccountProxyInterface $current_user: Current user.

\Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The Theme Manager.

\Drupal\Core\Routing\AdminContext $admin_context: The route admin context service.

File

src/Asset/CriticalCssProvider.php, line 126

Class

CriticalCssProvider
Critical CSS Provider.

Namespace

Drupal\critical_css\Asset

Code

public function __construct(ModuleHandlerInterface $module_handler, RequestStack $request_stack, ConfigFactoryInterface $config_factory, ResettableStackedRouteMatchInterface $current_route_match, CurrentPathStack $current_path_stack, AccountProxyInterface $current_user, ThemeManagerInterface $theme_manager, AdminContext $admin_context) {
  $this->moduleHandler = $module_handler;
  $this->request = $request_stack
    ->getCurrentRequest();
  $this->config = $config_factory
    ->get('critical_css.settings');
  $this->currentRouteMatch = $current_route_match;
  $this->currentPathStack = $current_path_stack;
  $this->currentUser = $current_user;
  $this->themeManager = $theme_manager;
  $this->adminContext = $admin_context;
}