Skip to content
Snippets Groups Projects

Resolve #3432827 "Plugincacheclearer tagged iterator"

1 unresolved thread

Closes #3432827

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
15 14 * {@inheritdoc}
16 15 */
17 16 public function process(ContainerBuilder $container): void {
18 $cache_clearer_definition = $container->getDefinition('plugin.cache_clearer');
19 17 foreach ($container->getDefinitions() as $service_id => $definition) {
20 if (str_starts_with($service_id, 'plugin.manager.') || $definition->hasTag('plugin_manager_cache_clear')) {
18 if (str_starts_with($service_id, 'plugin.manager.') && !$definition->hasTag('plugin_manager_cache_clear')) {
21 19 if (is_subclass_of($definition->getClass(), '\Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface')) {
22 $cache_clearer_definition->addMethodCall('addCachedDiscovery', [new Reference($service_id)]);
20 $definition->addTag('plugin_manager_cache_clear');
  • Can't we remove this entire pass and use autocofniguration by adding

        $container->registerForAutoconfiguration(CachedDiscoveryInterface::class)
          ->addTag('plugin_manager_cache_clear');

    somewhere.

  • Please register or sign in to reply
Please register or sign in to reply
Loading