You are here

protected function ConfigManager::getHeadersToRemoveFromCache in Remove HTTP headers 8

Returns the configured headers to remove from cache.

Return value

array|null The cached data. NULL if not in cache or invalid format.

1 call to ConfigManager::getHeadersToRemoveFromCache()
ConfigManager::getHeadersToRemove in src/Config/ConfigManager.php
Gets the HTTP headers that should be removed.

File

src/Config/ConfigManager.php, line 100

Class

ConfigManager
Manages module configuration.

Namespace

Drupal\remove_http_headers\Config

Code

protected function getHeadersToRemoveFromCache() : ?array {
  $cachedHeadersToRemove = FALSE;
  $headersToRemoveCacheData = $this->cache
    ->get(self::HEADERS_TO_REMOVE_CACHE_ID);
  if ($headersToRemoveCacheData instanceof \stdClass) {
    if (property_exists($headersToRemoveCacheData, 'data')) {
      $cachedHeadersToRemove = $headersToRemoveCacheData->data;
    }
  }
  $cachedHeadersToRemove = $this
    ->validateHeadersToRemoveDataFormat($cachedHeadersToRemove);
  return $cachedHeadersToRemove;
}