You are here

public function ServiceContainerServiceProvider::processPluginManagers in Service Container 7

Same name and namespace in other branches
  1. 7.2 src/ServiceContainer/ServiceProvider/ServiceContainerServiceProvider.php \Drupal\service_container\ServiceContainer\ServiceProvider\ServiceContainerServiceProvider::processPluginManagers()

Processes plugin managers of varying types and registers them in the container based on the given discovery class.

Parameters

array $container_definition: The container definition to process.

string $discovery_class: The discovery class this plugin manager type uses.

array $plugin_managers: The plugin managers to register.

1 call to ServiceContainerServiceProvider::processPluginManagers()
ServiceContainerServiceProvider::alterContainerDefinition in src/ServiceContainer/ServiceProvider/ServiceContainerServiceProvider.php
Allows to alter the container definition.

File

src/ServiceContainer/ServiceProvider/ServiceContainerServiceProvider.php, line 321
Contains \Drupal\service_container\ServiceContainer\ServiceProvider\ServiceContainerServiceProvider

Class

ServiceContainerServiceProvider
Provides render cache service definitions.

Namespace

Drupal\service_container\ServiceContainer\ServiceProvider

Code

public function processPluginManagers(&$container_definition, $discovery_class, $plugin_managers) {
  foreach ($plugin_managers as $name => $plugin_manager) {
    if (!isset($container_definition['services'][$name]) || !empty($container_definition['services'][$name])) {
      continue;
    }
    $container_definition['services'][$name] = $this
      ->getPluginManagerDefinition($name, $discovery_class, $plugin_manager);
    $tags = $container_definition['services'][$name]['tags'];
    foreach ($tags as $tag) {
      $tag_name = $tag['name'];
      unset($tag['name']);
      $container_definition['tags'][$tag_name][$name][] = $tag;
    }
  }
}