You are here

public function ConfigRewriter::rewriteConfig in Configuration Rewrite 8.2

Same name and namespace in other branches
  1. 8 src/ConfigRewriter.php \Drupal\config_rewrite\ConfigRewriter::rewriteConfig()

Returns rewritten configuration.

Parameters

array $original_config: The original configuration array to rewrite.

array $rewrite: An array of configuration rewrites.

Return value

array The rewritten config.

Overrides ConfigRewriterInterface::rewriteConfig

1 call to ConfigRewriter::rewriteConfig()
ConfigRewriter::rewriteDirectoryConfig in src/ConfigRewriter.php
Finds files in a given directory and uses them to rewrite active config.

File

src/ConfigRewriter.php, line 163

Class

ConfigRewriter
Provides methods to rewrite configuration.

Namespace

Drupal\config_rewrite

Code

public function rewriteConfig($original_config, $rewrite) {
  if (isset($rewrite['config_rewrite']) && $rewrite['config_rewrite'] == 'replace') {
    return $rewrite;
  }
  return NestedArray::mergeDeep($original_config, $rewrite);
}