+ return $dependencies;
+ }
+
+ /**
+ * 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.
+ *
+ * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance
+ * The plugin instance.
+ */
+ protected function calculatePluginDependencies(PluginInspectionInterface $instance) {
+ $this->addDependencies($this->getPluginDependencies($instance));