You are here

protected function ConfigFactory::loadOverrides in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::loadOverrides()
  2. 9 core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::loadOverrides()

Get arbitrary overrides for the named configuration objects from modules.

Parameters

array $names: The names of the configuration objects to get overrides for.

Return value

array An array of overrides keyed by the configuration object name.

File

core/lib/Drupal/Core/Config/ConfigFactory.php, line 204

Class

ConfigFactory
Defines the configuration object factory.

Namespace

Drupal\Core\Config

Code

protected function loadOverrides(array $names) {
  $overrides = [];
  foreach ($this->configFactoryOverrides as $override) {

    // Existing overrides take precedence since these will have been added
    // by events with a higher priority.
    $overrides = NestedArray::mergeDeepArray([
      $override
        ->loadOverrides($names),
      $overrides,
    ], TRUE);
  }
  return $overrides;
}