compiler pass for route filters
Port the route filters pass from drupal into the component. Left over from #70
see http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterRouteFiltersPass.php btw, why is there no priorities on the filters pass? the enhancer and router passes do have priorities. for performance reasons, priorities could also be important here.
when we do that, don't forget to enable the pass in the CmfRoutingBundle
/cc @Crell
@dawehner if you have too much time left after #97 this could be another cleanup. though much less important.
In the meantime we abstracted that into http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php?id=refs/heads;id2=8.0.x
which allows you to specify a service to collect other services. 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 }
Do you think that this is something we could even push into symfony itself?
@dawehner sorry for the late reply. are you proposing a generic way of doing compiler passes for tags? compiler passes can do all kind of things, but for the standard case of late-and-implicit hooking up services together, this seems a good idea to me. i would propose that to symfony and see if they like the idea. it seems a DX improvement to me. a variant of your proposal would be a generic compiler pass that the bundle can instantiate with the options about the receiving service and its add-method and the tag name - might be a tad more straightforward. (what would happen if we define several service collectors for the same tag?)
feel free to ping me in the symfony/symfony issue to help with the discussion, btw.