You are here

public function NormalizedReadOnlyStorage::__construct in Configuration Normalizer 2.0.x

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

Create a NormalizedReadOnlyStorage decorating another storage.

Parameters

\Drupal\Core\Config\StorageInterface $storage: The decorated storage.

\Drupal\config_normalizer\ConfigNormalizerInterface|mixed $normalizer: The normalization manager. In 2.0.0 we will add a typehint.

array $context: (optional, deprecated) This parameter will be removed in 2.0.0.

Overrides ReadOnlyStorage::__construct

File

src/Config/NormalizedReadOnlyStorage.php, line 31

Class

NormalizedReadOnlyStorage
Defines the normalized read only storage.

Namespace

Drupal\config_normalizer\Config

Code

public function __construct(StorageInterface $storage, $normalizer, array $context = []) {
  parent::__construct($storage);
  if (!$normalizer instanceof ConfigNormalizerInterface) {
    $normalizer = \Drupal::service('config_normalizer.normalizer');
  }
  $this->normalizer = $normalizer;
}