You are here

private function HtmlResponseAttachmentsProcessor::resolveAssets in Cookie Content Blocker 8

Resolves assets.

Parameters

callable $resolver: The resolver to use to resolve the assets.

bool $optimize: Whether to optimize the assets.

Return value

array A keyed array containing:

  • (0) Array of (possibly) optimized allowed assets.
  • (1) Array of un-optimized/raw allowed assets.
  • (2) Array of un-optimized/raw blocked assets
2 calls to HtmlResponseAttachmentsProcessor::resolveAssets()
HtmlResponseAttachmentsProcessor::getCssAssetCollection in src/Render/HtmlResponseAttachmentsProcessor.php
Collects the CSS assets.
HtmlResponseAttachmentsProcessor::getJsAssetCollection in src/Render/HtmlResponseAttachmentsProcessor.php
Collects the JS assets.

File

src/Render/HtmlResponseAttachmentsProcessor.php, line 356

Class

HtmlResponseAttachmentsProcessor
Processes attachments of HTML responses.

Namespace

Drupal\cookie_content_blocker\Render

Code

private function resolveAssets(callable $resolver, bool $optimize) : array {
  if (!is_callable($resolver)) {
    return [];
  }
  return [
    $resolver($this->allowedAssets, $optimize),
    $resolver($this->allowedAssets, FALSE),
    $resolver($this->blockedAssets, FALSE),
  ];
}