Process the ContainerBuilder to resolve invalid references.
979932
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->signalingException = new RuntimeException('Invalid reference.');

        try {
            $this->processValue($container->getDefinitions(), 1);
        } finally {
            $this->container = $this->signalingException = null;
        }
    }
612299
public function process(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
    {
        if (!$container->hasDefinition("thelia.admin.resources")) {
            return;
        }

        /** @var \Symfony\Component\DependencyInjection\Definition $adminResources */
        $adminResources = $container->getDefinition("thelia.admin.resources");

        $adminResources->addMethodCall("addModuleResources", [$this->getResources(), $this->getModuleCode()]);
    }
816105
private boolean cleanUp(Reference<?> reference) {
    Method finalizeReferentMethod = getFinalizeReferentMethod();
    if (finalizeReferentMethod == null) {
      return false;
    }
    do {
      /*
       * This is for the benefit of phantom references. Weak and soft
       * references will have already been cleared by this point.
       */
      reference.clear();

      if (reference == frqReference) {
        /*
         * The client no longer has a reference to the
         * FinalizableReferenceQueue. We can stop.
         */
        return false;
      }

      try {
        finalizeReferentMethod.invoke(reference);
      } catch (Throwable t) {
        logger.log(Level.SEVERE, "Error cleaning up after reference.", t);
      }

      /*
       * Loop as long as we have references available so as not to waste
       * CPU looking up the Method over and over again.
       */
    } while ((reference = queue.poll()) != null);
    return true;
  }
82267
public function process(ContainerBuilder $container)
    {
        $this->registerStateExtractors($container);
        $this->registerStateElements($container);
        $this->registerResultModifications($container);
    }
766027
public function process(ContainerBuilder $container)
    {
        $compiler = $container->getCompiler();
        $formatter = $compiler->getLoggingFormatter();
        $graph = $compiler->getServiceReferenceGraph();

        $hasChanged = false;
        foreach ($container->getDefinitions() as $id => $definition) {
            if ($definition->isPublic()) {
                continue;
            }

            if ($graph->hasNode($id)) {
                $edges = $graph->getNode($id)->getInEdges();
                $referencingAliases = array();
                $sourceIds = array();
                foreach ($edges as $edge) {
                    $node = $edge->getSourceNode();
                    $sourceIds[] = $node->getId();

                    if ($node->isAlias()) {
                        $referencingAliases[] = $node->getValue();
                    }
                }
                $isReferenced = (count(array_unique($sourceIds)) - count($referencingAliases)) > 0;
            } else {
                $referencingAliases = array();
                $isReferenced = false;
            }

            if (1 === count($referencingAliases) && false === $isReferenced) {
                $container->setDefinition((string) reset($referencingAliases), $definition);
                $definition->setPublic(true);
                $container->removeDefinition($id);
                $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'replaces alias '.reset($referencingAliases)));
            } elseif (0 === count($referencingAliases) && false === $isReferenced) {
                $container->removeDefinition($id);
                $container->resolveEnvPlaceholders(serialize($definition));
                $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'unused'));
                $hasChanged = true;
            }
        }

        if ($hasChanged) {
            $this->repeatedPass->setRepeat();
        }
    }
279056
private function processLoaders(ContainerBuilder $container)
    {
        $references = $this->processor->findAndSortTaggedServices($container, self::LOADER_TAG);
        $definition = $container->getDefinition(self::MANAGER_ID);

        foreach ($references as $reference) {
            $definition->addMethodCall('addLoader', array($reference));
        }
    }
103343
private function processEvents()
	{
		$builder = $this->getContainerBuilder();

		$eventManager = $builder->addDefinition($this->prefix('eventManager'))
			->setClass(EventManager::class);

		$entityListenerResolver = $builder->addDefinition($this->prefix('entityListenerResolver'))
			->setClass(ContainerEntityListenerResolver::class);

		$rc = new \ReflectionClass(Events::class);
		$events = $rc->getConstants();

		foreach ($this->config['listeners'] as $event => $listeners) {
			if (!isset($events[$event])) {
				throw new InvalidStateException("Event '$event' is not valid doctrine event. See class "
					. Events::class . ' for list of available events.');
			}
			foreach ((array) $listeners as $listener) {
				$builder->getDefinition($this->prefix('eventManager'))->addSetup('$service->addEventListener(['
					. Events::class . '::?], ?)', [$event, $listener]);
			}
		}
	}
233386
public function process(ContainerBuilder $container)
    {
        $this->container = $container;

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

            $this->currentId = $id;

            $this->validateReferences($definition->getArguments());
            $this->validateReferences($definition->getMethodCalls());
            $this->validateReferences($definition->getProperties());
        }
    }
167137
public function process(ContainerBuilder $container)
    {
        if (!$container->hasAlias(SchemaBuilder::class)
            || !$container->hasDefinition(self::CLEAN_INSTALLER_DEF_ID)
        ) {
            return;
        }

        $cleanInstallerDefinition = $container->getDefinition(self::CLEAN_INSTALLER_DEF_ID);
        $cleanInstallerDefinition->setClass(CoreInstaller::class);
        $cleanInstallerDefinition->addArgument(new Reference(SchemaBuilder::class));
    }
1243537
protected void processRemoterElements(TypeSpec.Builder classBuilder, ElementVisitor elementVisitor, MethodSpec.Builder methodBuilder) {
        processRemoterElements(classBuilder, getRemoterInterfaceElement(), 0, elementVisitor, methodBuilder);
    }
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);
    }
746723
private void processCollectionStore() {
        String fieldClassName = getDottedClassConstantOperand();
        if (fieldClassName.equals(className) && (stack.getStackDepth() > 0)) {
            OpcodeStack.Item item = stack.getStackItem(0);
            if (item.getUserValue() != null) {
                String fieldName = getNameConstantOperand();
                if (fieldName != null) {
                    FieldInfo fi = collectionFields.get(fieldName);
                    if (fi != null) {
                        fi.getFieldAnnotation().setSourceLines(SourceLineAnnotation.fromVisitedInstruction(this));
                        fi.setSynchronized();
                    }
                }
            }
        }
    }
1279302
public function beforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->getConfig();

		// Compile defined middlewares
		if ($config['middlewares'] !== []) {
			$this->compileDefinedMiddlewares();

			return;
		}

		// Compile tagged middlewares
		if ($builder->findByTag(self::MIDDLEWARE_TAG) !== []) {
			$this->compileTaggedMiddlewares();

			return;
		}

		throw new InvalidStateException('There must be at least one middleware registered or added by tag.');
	}
1010835
protected function process()
    {

        // clean-up the repositories etc. to free memory
        $this->getCustomerAddressBunchProcessor()->cleanUp();

        // temporary persist the last customer address entity ID
        $this->setLastEntityId($this->getValue(ColumnKeys::ENTITY_ID));
    }
720704
public function process(ContainerBuilder $container)
    {
        $graph = $container->getCompiler()->getServiceReferenceGraph();

        $this->checkedNodes = [];
        foreach ($graph->getNodes() as $id => $node) {
            $this->currentPath = [$id];

            $this->checkOutEdges($node->getOutEdges());
        }
    }
1141466
private void handleConref() {
        // Get pure conref targets
        final Set<URI> pureConrefTargets = new HashSet<>(128);
        for (final URI target: conrefTargetSet) {
            if (!nonConrefCopytoTargetSet.contains(target)) {
                pureConrefTargets.add(target);
            }
        }
        conrefTargetSet = pureConrefTargets;

        // Remove pure conref targets from fullTopicSet
        fullTopicSet.removeAll(pureConrefTargets);
        // Treat pure conref targets same as resource-only
        resourceOnlySet.addAll(pureConrefTargets);
    }
965485
public function process(ContainerBuilder $container)
    {
        /** @var Glob $glob */
        $glob = $container->get(Glob::class);

        $locales = $glob->execGlob(ROOT . 'lang/*.po');
        $locales = array_map(function ($file) {
            return basename($file, '.po');
        }, $locales);

        $container->setParameter('locales', $locales);
    }