You are here

public static function UnmetDependenciesException::create in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/UnmetDependenciesException.php \Drupal\Core\Config\UnmetDependenciesException::create()

Creates an exception for an extension and a list of configuration objects.

Parameters

$extension: The name of the extension that is being installed.

array $config_objects: A list of configuration keyed by configuration name, with unmet dependencies as the value.

Return value

\Drupal\Core\Config\PreExistingConfigException

1 call to UnmetDependenciesException::create()
ConfigInstaller::checkConfigurationToInstall in core/lib/Drupal/Core/Config/ConfigInstaller.php
Checks the configuration that will be installed for an extension.

File

core/lib/Drupal/Core/Config/UnmetDependenciesException.php, line 93

Class

UnmetDependenciesException
An exception thrown if configuration has unmet dependencies.

Namespace

Drupal\Core\Config

Code

public static function create($extension, array $config_objects) {
  $message = new FormattableMarkup('Configuration objects provided by %extension have unmet dependencies: %config_names', [
    '%config_names' => static::formatConfigObjectList($config_objects),
    '%extension' => $extension,
  ]);
  $e = new static($message);
  $e->configObjects = $config_objects;
  $e->extension = $extension;
  return $e;
}