You are here

public function TwitterWidgetSubscriber::__construct in Twitter Profile Widget 3.x

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/TwitterWidgetSubscriber.php \Drupal\twitter_profile_widget\EventSubscriber\TwitterWidgetSubscriber::__construct()
  2. 8 src/EventSubscriber/TwitterWidgetSubscriber.php \Drupal\twitter_profile_widget\EventSubscriber\TwitterWidgetSubscriber::__construct()

Constructs a TwitterWidgetSubscriber object.

Parameters

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager object for retrieving the correct language code.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

\Drupal\Core\PageCache\RequestPolicyInterface $request_policy: A policy rule determining the cacheability of a request.

\Drupal\Core\PageCache\ResponsePolicyInterface $response_policy: A policy rule determining the cacheability of a response.

\Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager: The cache contexts manager service.

bool $http_response_debug_cacheability_headers: (optional) Whether to send cacheability headers for debugging purposes.

File

src/EventSubscriber/TwitterWidgetSubscriber.php, line 81

Class

TwitterWidgetSubscriber
Class TwitterWidgetSubscriber.

Namespace

Drupal\twitter_profile_widget\EventSubscriber

Code

public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE) {
  $this->languageManager = $language_manager;
  $this->config = $config_factory
    ->get('system.performance');
  $this->requestPolicy = $request_policy;
  $this->responsePolicy = $response_policy;
  $this->cacheContextsManager = $cache_contexts_manager;
  $this->debugCacheabilityHeaders = $http_response_debug_cacheability_headers;
}