DependencyInjection/BridgeExtension.php
private function generateServices(array $services, ContainerBuilder $container)
    {
        foreach ($services as $serviceName => $service) {
            $serviceId = 'bridge.'.$serviceName;

            $serviceDefinition = $this->createComponentDefinition($serviceName, $service['class'], $service['options']);
            $serviceDefinition->addMethodCall('setEventDispatcher', array(new Reference('bridge.event_dispatcher')));
            $serviceDefinition->addMethodCall('setRegistry', array(new Reference('bridge.registry')));

            $this->generateGroups($service['groups'], $serviceId, $serviceDefinition, $container);

            $container->setDefinition($serviceId, $serviceDefinition);

            $container
                ->getDefinition('bridge.registry')
                ->addMethodCall('addService', array(new Reference($serviceId)));
        }
    }
private function generateServices(array $services, ContainerBuilder $container)
    {
        foreach ($services as $serviceName => $service) {
            $serviceId = 'bridge.'.$serviceName;

            $serviceDefinition = $this->createComponentDefinition($serviceName, $service['class'], $service['options']);
            $serviceDefinition->addMethodCall('setEventDispatcher', array(new Reference('bridge.event_dispatcher')));
            $serviceDefinition->addMethodCall('setRegistry', array(new Reference('bridge.registry')));

            $this->generateGroups($service['groups'], $serviceId, $serviceDefinition, $container);

            $container->setDefinition($serviceId, $serviceDefinition);

            $container
                ->getDefinition('bridge.registry')
                ->addMethodCall('addService', array(new Reference($serviceId)));
        }
    }
private function generateServices ( array $ services , ContainerBuilder $ container ) { foreach ( $ services as $ serviceName => $ service ) { $ serviceId = 'bridge.' . $ serviceName ; $ serviceDefinition = $ this -> createComponentDefinition ( $ serviceName , $ service [ 'class' ] , $ service [ 'options' ] ) ; $ serviceDefinition -> addMethodCall ( 'setEventDispatcher' , array ( new Reference ( 'bridge.event_dispatcher' ) ) ) ; $ serviceDefinition -> addMethodCall ( 'setRegistry' , array ( new Reference ( 'bridge.registry' ) ) ) ; $ this -> generateGroups ( $ service [ 'groups' ] , $ serviceId , $ serviceDefinition , $ container ) ; $ container -> setDefinition ( $ serviceId , $ serviceDefinition ) ; $ container -> getDefinition ( 'bridge.registry' ) -> addMethodCall ( 'addService' , array ( new Reference ( $ serviceId ) ) ) ; } }
Generates service definitions for services.

@param array            $services  Services
@param ContainerBuilder $container Container builder
Generates service definitions for services .