public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->serviceId)) {
            return;
        }
        $definition = $container->findDefinition($this->serviceId);
        $handlers = array();
        $this->collectServiceIds(
            $container,
            $this->tag,
            $this->keyAttribute,
            function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
                if (isset($tagAttributes['method'])) {
                    $callable = [$serviceId, $tagAttributes['method']];
                } else {
                    $callable = $serviceId;
                }
                $handlers[ltrim($key, '\\')] = $callable;
            }
        );
        $definition->replaceArgument(0, $handlers);
    }
public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->serviceId)) {
            return;
        }
        $definition = $container->findDefinition($this->serviceId);
        $handlers = array();
        $this->collectServiceIds(
            $container,
            $this->tag,
            $this->keyAttribute,
            function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
                if (isset($tagAttributes['method'])) {
                    $callable = [$serviceId, $tagAttributes['method']];
                } else {
                    $callable = $serviceId;
                }
                $handlers[ltrim($key, '\\')] = $callable;
            }
        );
        $definition->replaceArgument(0, $handlers);
    }
public function process ( ContainerBuilder $ container ) { if ( ! $ container -> has ( $ this -> serviceId ) ) { return ; } $ definition = $ container -> findDefinition ( $ this -> serviceId ) ; $ handlers = array ( ) ; $ this -> collectServiceIds ( $ container , $ this -> tag , $ this -> keyAttribute , function ( $ key , $ serviceId , array $ tagAttributes ) use ( & $ handlers ) { if ( isset ( $ tagAttributes [ 'method' ] ) ) { $ callable = [ $ serviceId , $ tagAttributes [ 'method' ] ] ; } else { $ callable = $ serviceId ; } $ handlers [ ltrim ( $ key , '\\' ) ] = $ callable ; } ) ; $ definition -> replaceArgument ( 0 , $ handlers ) ; }
Search for message handler services and provide them as a constructor argument to the message handler map
service.

@param ContainerBuilder $container
Search for message handler services and provide them as a constructor argument to the message handler map service .