Adds services tagged 'chained_matcher' to the 'matcher' service.
Expanded class hierarchy of RegisterMatchersPass
class RegisterMatchersPass implements CompilerPassInterface {
/**
* Adds services tagged 'chained_matcher' to the 'matcher' service.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* The container to 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,
));
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegisterMatchersPass:: |
public | function |
Adds services tagged 'chained_matcher' to the 'matcher' service. Overrides CompilerPassInterface:: |