function TestConfigurablePlugin::onCollectionDependencyRemoval

Informs the plugin in a collection to act on removal of dependencies.

This method allows a plugin instance in a collection to remove dependencies from their configuration. For example, if a plugin integrates with a specific module, it should remove that module from its own configuration when the module is uninstalled.

Parameters

array<string, list<string>> $dependencies: An array of dependencies that will be deleted keyed by dependency type. Dependency types are, for example, entity, module and theme.

Return value

\Drupal\Core\Plugin\RemovableDependentPluginReturn

  • RemovableDependentPluginReturn::Changed if the configuration of the plugin instance has changed
  • RemovableDependentPluginReturn::Remove if the plugin instance should be removed from the plugin collection
  • RemovableDependentPluginReturn::Unchanged if the configuration of the plugin instance has not changed.

Overrides RemovableDependentPluginInterface::onCollectionDependencyRemoval

File

core/tests/Drupal/Tests/Core/Plugin/Fixtures/TestConfigurablePlugin.php, line 26

Class

TestConfigurablePlugin
A configurable plugin implementation used for testing.

Namespace

Drupal\Tests\Core\Plugin\Fixtures

Code

public function onCollectionDependencyRemoval(array $dependencies) : RemovableDependentPluginReturn {
  return RemovableDependentPluginReturn::Unchanged;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.