Adds the monolog handler to the service container

@param Definition       $handlerDefinition
@param ContainerBuilder $container
173587
private function addLoggerReferenceToContainer (Definition $handlerDefinition, ContainerBuilder $container)
    {
        // first wrap logger in FingersCrossedHandler
        $monitoringDefinition = new Definition(FingersCrossedHandler::class, [
            $handlerDefinition,
            Logger::WARNING
        ]);
        $monitoringDefinition->setPublic(false);

        $container->setDefinition(self::MONOLOG_HANDLER_SERVICE_ID, $monitoringDefinition);
    }
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());
        }
    }
731184
public function process(ContainerBuilder $container): void
    {
        if (!$container->hasDefinition(Aggregator::class)) {
            return;
        }

        $aggregatorDefinition = $container->getDefinition(Aggregator::class);
        $taggedServiceIds = $container->findTaggedServiceIds(self::TAG_CONFIG_PROVIDER);

        foreach ($taggedServiceIds as $taggedServiceId => $tags) {
            foreach ($tags as $tag) {
                $key = $tag['key'] ?? $taggedServiceId;
                $aggregatorDefinition->addMethodCall('addProvider', [$key, new Reference($taggedServiceId)]);
            }
        }
    }
379560
private function processTerminalFactoryRegistration(ContainerBuilder $container)
    {
        $references = $this->processor->findAndSortTaggedServices($container, self::TERMINAL_FACTORY_TAG);
        $definition = $container->getDefinition(Extension::TERMINAL_COLLECTION_FACTORY_ID);

        foreach ($references as $reference) {
            $definition->addMethodCall('registerTerminalFactory', array($reference));
        }
    }
1206949
private function resolveDefinition(ContainerBuilder $container, DefinitionDecorator $definition)
    {
        try {
            return $this->doResolveDefinition($container, $definition);
        } catch (ExceptionInterface $e) {
            $r = new \ReflectionProperty($e, 'message');
            $r->setAccessible(true);
            $r->setValue($e, sprintf('Service "%s": %s', $this->currentId, $e->getMessage()));

            throw $e;
        }
    }
663406
public function process(ContainerBuilder $container)
    {
        foreach ($container->getDefinitions() as $definition) {
            $interfaces = class_implements($definition->getClass());
            foreach ($interfaces as $interface) {
                if (substr($interface, -14) === 'AwareInterface') {
                    $camelCasedServiceId = substr($interface, strrpos($interface, '\\') + 1, -14);
                    $serviceId = Container::underscore($camelCasedServiceId);

                    if ($container->has($serviceId)) {
                        $setterMethod = 'set'.$camelCasedServiceId;

                        $definition->addMethodCall($setterMethod, array(new Reference($serviceId)));
                    }
                }
            }
        }
    }
428442
private function processContextInitializers(ContainerBuilder $container)
    {
        $references = $this->processor->findAndSortTaggedServices($container, self::INITIALIZER_TAG);
        $definition = $container->getDefinition(self::FACTORY_ID);

        foreach ($references as $reference) {
            $definition->addMethodCall('registerContextInitializer', array($reference));
        }
    }
956842
public function process(ContainerBuilder $container)
    {
        $metaTagHandlers = $container->findTaggedServiceIds('netgen_open_graph.meta_tag_handler');
        if (!empty($metaTagHandlers) && $container->hasDefinition('netgen_open_graph.handler_registry')) {
            $handlerRegistry = $container->getDefinition('netgen_open_graph.handler_registry');
            foreach ($metaTagHandlers as $serviceId => $metaTagHandler) {
                if (!isset($metaTagHandler[0]['alias'])) {
                    throw new LogicException(
                        'netgen_open_graph.meta_tag_handler service tag needs an "alias" attribute to identify the handler. None given.'
                    );
                }
                $handlerRegistry->addMethodCall(
                    'addHandler',
                    array(
                        $metaTagHandler[0]['alias'],
                        new Reference($serviceId),
                    )
                );
            }
        }
    }
235379
public function process(ContainerBuilder $container)
    {
        if ($container->hasDefinition($this->filesystemTag)) {
            $filesystem = new Reference($this->filesystemTag);

            $reportBugCommandDefinition = $container->getDefinition(ReportBugCommand::class);
            $reportBugCommandDefinition->addMethodCall('setFilesystem', [$filesystem]);

            $captureScreenshotsCommandDefinition = $container->getDefinition(CaptureScreenshotsCommand::class);
            $captureScreenshotsCommandDefinition->addMethodCall('setFilesystem', [$filesystem]);

            $removeScreenshotsCommandDefinition = $container->getDefinition(RemoveScreenshotsCommand::class);
            $removeScreenshotsCommandDefinition->addMethodCall('setFilesystem', [$filesystem]);
        }
    }
655002
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->collectionServiceId)) {
            return;
        }

        $collection = $this->getCollection($container);

        foreach ($container->findTaggedServiceIds($this->serviceTag) as $id => $attributes) {
            $this->addServiceToCollection($collection, $id);
        }
    }
1166323
protected function defineRequestTimeMiddleware(ContainerBuilder $container, Definition $handler, string $clientName)
    {
        $requestTimeMiddlewareDefinitionName = sprintf('eight_points_guzzle.middleware.request_time.%s', $clientName);
        $requestTimeMiddlewareDefinition = new Definition('%eight_points_guzzle.middleware.request_time.class%');
        $requestTimeMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.logger'));
        $requestTimeMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.data_collector'));
        $requestTimeMiddlewareDefinition->setPublic(true);
        $container->setDefinition($requestTimeMiddlewareDefinitionName, $requestTimeMiddlewareDefinition);

        $requestTimeExpression = new Expression(sprintf("service('%s')", $requestTimeMiddlewareDefinitionName));
        $handler->addMethodCall('after', ['log', $requestTimeExpression, 'request_time']);
    }
1277211
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds(
            self::TAG_NAME
        );

        foreach ($taggedServices as $id => $tag) {
            $definition = $container->findDefinition($id);

            $this->processTag($tag, $definition);
        }
    }
82267
public function process(ContainerBuilder $container)
    {
        $this->registerStateExtractors($container);
        $this->registerStateElements($container);
        $this->registerResultModifications($container);
    }
365817
private function collectReportTransformers (Definition $handler, ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds(self::REPORT_TRANSFORMER_TAG);

        foreach ($taggedServices as $serviceId => $tags)
        {
            $handler->addMethodCall("addReportTransformer", [new Reference($serviceId)]);
        }
    }
461173
public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->getCollectorServiceName())) {
            return;
        }

        $definition = $container->findDefinition(
            $this->getCollectorServiceName()
        );

        $taggedServices = $this->findAndSortTaggedServices(
            $this->getTagName(),
            $container
        );

        /*
         * Per each service, add a new method call reference
         */
        foreach ($taggedServices as $service) {
            $definition->addMethodCall(
                $this->getCollectorMethodName(),
                [$service]
            );
        }
    }
1368332
public function process(ContainerBuilder $container)
    {
        $def = $container->getDefinition('zicht_admin.event_propagator');

        foreach ($container->findTaggedServiceIds('zicht_admin.event_propagation') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                $def->addTag('kernel.event_listener', array('event' => $attribute['event'], 'method' => 'onEvent'));
                $def->addMethodCall('registerPropagation', array($attribute['event'], new Reference($id)));
            }
        }
    }
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))
				);
			}
		}
	}