function PluginManagerPass::process

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/PluginManagerPass.php \Drupal\Core\Plugin\PluginManagerPass::process()
  2. 8.9.x core/lib/Drupal/Core/Plugin/PluginManagerPass.php \Drupal\Core\Plugin\PluginManagerPass::process()
  3. 10 core/lib/Drupal/Core/Plugin/PluginManagerPass.php \Drupal\Core\Plugin\PluginManagerPass::process()

File

core/lib/Drupal/Core/Plugin/PluginManagerPass.php, line 16

Class

PluginManagerPass
Registers plugin managers to the plugin.cache_clearer service.

Namespace

Drupal\Core\Plugin

Code

public function process(ContainerBuilder $container) : void {
    foreach ($container->getDefinitions() as $service_id => $definition) {
        if (str_starts_with($service_id, 'plugin.manager.') && !$definition->hasTag('plugin_manager_cache_clear')) {
            if (is_subclass_of($definition->getClass(), '\\Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface')) {
                $definition->addTag('plugin_manager_cache_clear');
            }
        }
    }
}

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