You are here

public function ElementProcessor::processElement in Cookie Content Blocker 8

Processes the element.

Parameters

array $element: The element to process.

Return value

array The processed element.

Overrides ElementProcessorBase::processElement

File

src/ElementProcessor/ElementProcessor.php, line 31

Class

ElementProcessor
Class ElementProcessor.

Namespace

Drupal\cookie_content_blocker\ElementProcessor

Code

public function processElement(array $element) : array {
  if (!$this
    ->applies($element)) {
    return $element;
  }
  foreach ($this->processors as $processor) {
    if (!$processor
      ->applies($element)) {
      continue;
    }
    $element = $processor
      ->processElement($element);
  }
  return $element;
}