Closed
Description
Similar issue to (in the sense of having a similar context) than #11460
In Drupal we have a lot of tagged services which are injected into a single one. When we started most of them had custom Compiler Passed, but than we realized that we can easily extract that into a common service:
This would be the "collector" service:
breadcrumb:
class: Drupal\Core\Breadcrumb\BreadcrumbManager
arguments: ['@module_handler']
tags:
- { name: service_collector, tag: breadcrumb_builder, call: addBuilder }
and then you do something like that in the client service:
forum.breadcrumb.listing:
class: Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder
arguments: ['@entity.manager', '@config.factory', '@forum_manager']
tags:
- { name: breadcrumb_builder, priority: 314 }
Any oppinions?