You are here

public function TestTracker::onDependencyRemoval in Search API 8

Informs the plugin that some of its dependencies are being removed.

The plugin should attempt to change its configuration in a way to remove its dependency on those items. However, to avoid problems, it should (as far as possible) not add any new dependencies in the process, since there is no guarantee that those are not currently being removed, too.

Parameters

object[][] $dependencies: An array of dependencies, keyed by dependency type ("module", "config", etc.) and dependency name.

Return value

bool Whether the dependency was successfully removed from the plugin – that is, after the configuration changes that were made, none of the removed items are dependencies of this plugin anymore.

Overrides ConfigurablePluginBase::onDependencyRemoval

File

tests/search_api_test/src/Plugin/search_api/tracker/TestTracker.php, line 132

Class

TestTracker
Provides a tracker implementation which uses a FIFO-like processing order.

Namespace

Drupal\search_api_test\Plugin\search_api\tracker

Code

public function onDependencyRemoval(array $dependencies) {
  $remove = $this
    ->getReturnValue(__FUNCTION__, FALSE);
  if ($remove) {
    $this->configuration['dependencies'] = [];
  }
  return $remove;
}