You are here

protected function NormalizedStorageComparerTrait::createStorageComparer in Configuration Normalizer 2.0.x

Same name and namespace in other branches
  1. 8 src/Config/NormalizedStorageComparerTrait.php \Drupal\config_normalizer\Config\NormalizedStorageComparerTrait::createStorageComparer()

Creates and returns a storage comparer.

Parameters

\Drupal\Core\Config\StorageInterface $source_storage: The source storage.

\Drupal\Core\Config\StorageInterface $target_storage: The target storage.

string $mode: (optional, deprecated) The normalization mode.

Return value

\Drupal\Core\Config\StorageComparer A storage comparer.

File

src/Config/NormalizedStorageComparerTrait.php, line 39

Class

NormalizedStorageComparerTrait
Using this trait will add a ::createStorageComparer() method to the class.

Namespace

Drupal\config_normalizer\Config

Code

protected function createStorageComparer(StorageInterface $source_storage, StorageInterface $target_storage, $mode = NULL) {

  // Set up a storage comparer using normalized storages.
  $storage_comparer = new StorageComparer(new NormalizedReadOnlyStorage($source_storage, $this
    ->getNormalizer()), new NormalizedReadOnlyStorage($target_storage, $this
    ->getNormalizer()));
  return $storage_comparer;
}