diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php index 92a28e6..e7806bc 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php @@ -19,7 +19,7 @@ * handled in the correct order. For example, node types are created before * their fields, and both are created before the view display configuration. * - * The configuration dependency value is structured like so: + * The configuration dependency value is structured like this: * * array( * 'entity => array( @@ -33,7 +33,7 @@ * ), * 'enforced' => array( * // An array of configuration dependencies that the config entity is - * // ensured to have regardless of the state of the configuration. These + * // ensured to have regardless of the details of the configuration. These * // dependencies are not recalculated on save. * 'entity' => array(), * 'module' => array(), @@ -42,29 +42,26 @@ * ); * * - * Configuration entity dependencies are recalculated on save based on the state - * of the configuration. For example, a filter format will depend on the modules - * that provide the filter plugins it configures. The filter format can be - * reconfigured to use a different filter plugin provided by another module. If - * this occurs, the dependencies will be recalculated on save and the old module - * will be removed from the list of dependencies and replaced with the new one. + * Configuration entity dependencies are recalculated on save based on the + * current values of the configuration. For example, a filter format will depend + * on the modules that provide the filter plugins it configures. The filter + * format can be reconfigured to use a different filter plugin provided by + * another module. If this occurs, the dependencies will be recalculated on save + * and the old module will be removed from the list of dependencies and replaced + * with the new one. * * Configuration entity classes usually extend * \Drupal\Core\Config\Entity\ConfigEntityBase. The base class provides a * generic implementation of the calculateDependencies() method that can * discover dependencies due to enforced dependencies, plugins, and third party * settings. If the configuration entity has dependencies that cannot be - * discovered by the base class's implementation then it needs to implement + * discovered by the base class's implementation, then it needs to implement * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies() to * calculate (and return) the dependencies. In this method, use * \Drupal\Core\Config\Entity\ConfigEntityBase::addDependency() to add * dependencies. Implementations should call the base class implementation to * inherit the generic functionality. * - * To get a configuration entity's current dependencies without forcing a - * recalculation use - * \Drupal\Core\Config\Entity\ConfigEntityInterface::getDependencies(). - * * Classes for configurable plugins are a special case. They can either declare * their configuration dependencies using the calculateDependencies() method * described in the paragraph above, or if they have only static dependencies, @@ -84,7 +81,9 @@ * provides the configuration entity class being installed. This is important * for configuration synchronization, which needs to be able to validate * configuration in the staging directory before the synchronization has - * occurred. + * occurred. Also, if you have a configuration entity object and you want to + * get the current dependencies without recalculation, you can use + * \Drupal\Core\Config\Entity\ConfigEntityInterface::getDependencies(). * * When uninstalling a module or a theme, configuration entities that are * dependent will also be removed. This default behavior can lead to undesirable @@ -95,10 +94,9 @@ * which allows the entity class to remove dependencies instead of being deleted * themselves. Implementations should save the entity if dependencies have been * successfully removed, in order to register the newly cleaned-out dependency - * list. So, in the above example, the node view mode configuration entity class + * list. So, for example, the node view mode configuration entity class * should implement this method to remove references to formatters if the plugin * that supplies them depends on a module that is being uninstalled. - * that supplies them depends on a module that is being uninstalled. * * If a configuration entity is provided as default configuration by an * extension (module, theme, or profile), the extension has to depend on any