function FilterFormat::calculatePluginDependencies

Same name and namespace in other branches
  1. 8.9.x core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::calculatePluginDependencies()
  2. 10 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::calculatePluginDependencies()
  3. 11.x core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::calculatePluginDependencies()

Calculates and adds dependencies of a specific plugin instance.

Dependencies are added for the module that provides the plugin, as well as any dependencies declared by the instance's calculateDependencies() method, if it implements \Drupal\Component\Plugin\DependentPluginInterface.

Parameters

\Drupal\Component\Plugin\PluginInspectionInterface $instance: The plugin instance.

Overrides PluginDependencyTrait::calculatePluginDependencies

File

core/modules/filter/src/Entity/FilterFormat.php, line 437

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Entity

Code

protected function calculatePluginDependencies(PluginInspectionInterface $instance) {
    // Only add dependencies for plugins that are actually configured. This is
    // necessary because the filter plugin collection will return all available
    // filter plugins.
    // @see \Drupal\filter\FilterPluginCollection::getConfiguration()
    if (isset($this->filters[$instance->getPluginId()])) {
        parent::calculatePluginDependencies($instance);
    }
}

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