create mapping from services

@param ContainerBuilder $container container builder
@return void
553168
public function process(ContainerBuilder $container)
    {
        $map = [];

        $services = array_keys($container->findTaggedServiceIds('graviton.rest'));
        foreach ($services as $id) {
            list($ns, $bundle,, $doc) = explode('.', $id);

            $tag = $container->getDefinition($id)->getTag('graviton.rest');
            if (!empty($tag[0]) && array_key_exists('collection', $tag[0])) {
                $collection = $tag[0]['collection'];
            } else {
                $collection = ucfirst($doc);
            }

            $map[$collection] = implode('.', [$ns, $bundle, 'rest', $doc]);
        }
        $container->setParameter('graviton.document.type.extref.mapping', $map);
    }
388225
public function process(ContainerBuilder $container)
    {
        $this->loader = $container->get('sulu.content.path_cleaner.replacer_loader');

        $service = $container->getDefinition('sulu.content.path_cleaner');
        $replacers = $this->loader->load($this->filename);
        $service->addArgument($replacers);
    }
362167
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /*
         * Adds compiler passes.
         */
        foreach ($this->getCompilerPasses() as $compilerPass) {
            $container->addCompilerPass($compilerPass);
        }
    }
521863
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /**
         * Adds compiler pass.
         */
        $container
            ->addCompilerPass(new MappingCompilerPass())
            ->addCompilerPass(new ContextCompilerPass())
            ->addCompilerPass(new ExpressionLanguageCompilerPass());
    }
505518
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        if ($container->hasDefinition('jms_translation.config_factory')) {
            $container->addCompilerPass(new TraductionCompilerPass());
        }
        $container->addCompilerPass(new AccessMapCompilerPass());
        $container->addCompilerPass(new OverrideServiceCompilerPass());
    }
1019886
public function process(ContainerBuilder $container){
		if (!$container->hasDefinition(ParserChainInterface::SERVICE_ID)) {
			return;
		}
		
		$definition = $container->getDefinition(ParserChainInterface::SERVICE_ID);

		$taggedServices = $container->findTaggedServiceIds(MediaParserInterface::SERVICE_TAG);
		
		foreach ($taggedServices as $id => $tagAttributes) {
			foreach ($tagAttributes as $attributes) {
				$definition->addMethodCall(
						'addParser',
						array(new Reference($id))
				);
			}
		}
	}
578733
protected function prepareContainer(ContainerBuilder $container)
    {
        parent::prepareContainer($container);
        $container->setParameter('smart_core_cms.modules', $this->modules);
        $container->setParameter('smart_core_cms.site_name', $this->siteName);
    }
103283
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->buildReader();
        $this->buildUseCaseProxies();
    }
452459
public function process(ContainerBuilder $container)
    {
        if (!$container->has('netgen_siteaccess_routes.matcher')) {
            return;
        }

        $matcher = $container->findDefinition('netgen_siteaccess_routes.matcher');
        $voters = $container->findTaggedServiceIds('netgen_siteaccess_routes.voter');

        $voterServices = array();
        foreach ($voters as $serviceName => $tag) {
            $voterServices[] = new Reference($serviceName);
        }

        $matcher->replaceArgument(0, $voterServices);
    }
379028
public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');

        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $map[$document->getClass()] = $this->getFieldNames($document);
        }
        $container->setParameter('graviton.document.field.names', $map);
    }
1321203
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

        $parameterReplacer = $container->get(ServiceNames::PARAMETER_REPLACER);

        $parameterReplacer->processParameterBag($parameterBag, $container);
    }
399602
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new DocumentMapCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            100
        );
        $container->addCompilerPass(
            new ExtRefMappingCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ExtRefFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RqlFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new TranslatableFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new DocumentFieldNamesCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ReadOnlyFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RestrictionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RecordOriginExceptionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new SolrDefinitionCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
    }
33750
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->graph = $container->getCompiler()->getServiceReferenceGraph();
        $this->graph->clear();
        $this->lazy = false;

        foreach ($container->getAliases() as $id => $alias) {
            $targetId = $this->getDefinitionId((string) $alias);
            $this->graph->connect($id, $alias, $targetId, $this->getDefinition($targetId), null);
        }

        parent::process($container);
    }
563114
protected function setupContainer(Container $container=null)
    {
        $this->container = $container ?? $this->container ?? new Container;

        $prefix= $this->getAbstractPrefix();

        if (! $this->container->bound( $prefix.'config')) {
            $this->container->instance( $prefix .'config', new Repository);
        }

        $this->config=$this->container->make( $prefix . 'config');
    }
1212282
public function process(ContainerBuilder $container)
    {
        // Setup
        $this->compiler = $container->getCompiler();
        $this->formatter = $this->compiler->getLoggingFormatter();
        // First collect all alias targets that need to be replaced
        $seenAliasTargets = array();
        $replacements = array();
        foreach ($container->getAliases() as $definitionId => $target) {
            $targetId = (string) $target;
            // Special case: leave this target alone
            if ('service_container' === $targetId) {
                continue;
            }
            // Check if target needs to be replaces
            if (isset($replacements[$targetId])) {
                $container->setAlias($definitionId, $replacements[$targetId]);
            }
            // No need to process the same target twice
            if (isset($seenAliasTargets[$targetId])) {
                continue;
            }
            // Process new target
            $seenAliasTargets[$targetId] = true;
            try {
                $definition = $container->getDefinition($targetId);
            } catch (InvalidArgumentException $e) {
                throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $definitionId, $targetId), null, $e);
            }
            if ($definition->isPublic()) {
                continue;
            }
            // Remove private definition and schedule for replacement
            $definition->setPublic(true);
            $container->setDefinition($definitionId, $definition);
            $container->removeDefinition($targetId);
            $replacements[$targetId] = $definitionId;
        }

        // Now replace target instances in all definitions
        foreach ($container->getDefinitions() as $definitionId => $definition) {
            $definition->setArguments($this->updateArgumentReferences($replacements, $definitionId, $definition->getArguments()));
            $definition->setMethodCalls($this->updateArgumentReferences($replacements, $definitionId, $definition->getMethodCalls()));
            $definition->setProperties($this->updateArgumentReferences($replacements, $definitionId, $definition->getProperties()));
            $definition->setFactory($this->updateFactoryReference($replacements, $definition->getFactory()));
        }
    }
345437
public function process(ContainerBuilder $container)
    {
        $this->container = $container;

        foreach ($container->getDefinitions() as $definition) {
            if ($definition->isSynthetic() || $definition->isAbstract()) {
                continue;
            }

            $definition->setArguments($this->processArguments($definition->getArguments()));
            $definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
            $definition->setProperties($this->processArguments($definition->getProperties()));
            $definition->setFactory($this->processFactory($definition->getFactory()));
        }

        foreach ($container->getAliases() as $id => $alias) {
            $aliasId = (string) $alias;
            if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) {
                $container->setAlias($id, new Alias($defId, $alias->isPublic()));
            }
        }
    }
1293454
public function process(ContainerBuilder $container)
    {
        // First collect all alias targets that need to be replaced
        $seenAliasTargets = array();
        $replacements = array();
        foreach ($container->getAliases() as $definitionId => $target) {
            $targetId = $container->normalizeId($target);
            // Special case: leave this target alone
            if ('service_container' === $targetId) {
                continue;
            }
            // Check if target needs to be replaces
            if (isset($replacements[$targetId])) {
                $container->setAlias($definitionId, $replacements[$targetId])->setPublic($target->isPublic())->setPrivate($target->isPrivate());
            }
            // No need to process the same target twice
            if (isset($seenAliasTargets[$targetId])) {
                continue;
            }
            // Process new target
            $seenAliasTargets[$targetId] = true;
            try {
                $definition = $container->getDefinition($targetId);
            } catch (InvalidArgumentException $e) {
                throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $definitionId, $targetId), null, $e);
            }
            if ($definition->isPublic() || $definition->isPrivate()) {
                continue;
            }
            // Remove private definition and schedule for replacement
            $definition->setPublic(!$target->isPrivate());
            $definition->setPrivate($target->isPrivate());
            $container->setDefinition($definitionId, $definition);
            $container->removeDefinition($targetId);
            $replacements[$targetId] = $definitionId;
        }
        $this->replacements = $replacements;

        parent::process($container);
        $this->replacements = array();
    }