Adds services tagged 'chained_matcher' to the 'matcher' service.
\Symfony\Component\DependencyInjection\ContainerBuilder $container: The container to process.
Overrides CompilerPassInterface::process
public function process(ContainerBuilder $container) {
if (!$container
->hasDefinition('matcher')) {
return;
}
$matcher = $container
->getDefinition('matcher');
foreach ($container
->findTaggedServiceIds('chained_matcher') as $id => $attributes) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$matcher
->addMethodCall('add', array(
new Reference($id),
$priority,
));
}
}