You are here

TransparentFilter.php in Config Filter 8

Same filename and directory in other branches
  1. 8.2 src/Tests/TransparentFilter.php

File

src/Tests/TransparentFilter.php
View source
<?php

namespace Drupal\config_filter\Tests;

use Drupal\config_filter\Config\StorageFilterInterface;
use Drupal\config_filter\Plugin\ConfigFilterBase;

/**
 * A transparent filter making the storages public for tests.
 */
class TransparentFilter extends ConfigFilterBase implements StorageFilterInterface {

  /**
   * TransparentFilter constructor.
   */
  public function __construct() {
    parent::__construct([], 'transparent_test', []);
  }

  /**
   * Get the read-only source Storage.
   *
   * @return \Drupal\Core\Config\StorageInterface
   *   The source storage.
   */
  public function getPrivateSourceStorage() {
    return $this
      ->getSourceStorage();
  }

  /**
   * Get the decorator storage which applies the filters.
   *
   * @return \Drupal\Core\Config\StorageInterface
   *   The filtered decorator storage.
   */
  public function getPrivateFilteredStorage() {
    return $this
      ->getFilteredStorage();
  }

}

Classes

Namesort descending Description
TransparentFilter A transparent filter making the storages public for tests.