Parse all class names for view, controller and callback class.

@param ContainerInterface $container The container where the data shall be stored.

@return void

@throws DcGeneralInvalidArgumentException When the container is of invalid type.
331712
protected function parseClassNames(ContainerInterface $container)
    {
        if ($container->hasDefinition(ExtendedDca::NAME)) {
            $definition = $container->getDefinition(ExtendedDca::NAME);

            if (!($definition instanceof ExtendedDca)) {
                throw new DcGeneralInvalidArgumentException(
                    \sprintf(
                        'Definition with name %s must be an instance of ExtendedDca but instance of %s encountered.',
                        ExtendedDca::NAME,
                        \get_class($definition)
                    )
                );
            }
        } else {
            $definition = new ExtendedDca();
            $container->setDefinition(ExtendedDca::NAME, $definition);
        }

        if (null === $this->getFromDca('dca_config')) {
            return;
        }

        if (null !== ($class = $this->getFromDca('dca_config/controller'))) {
            $definition->setControllerClass($class);
        }

        if (null !== ($class = $this->getFromDca('dca_config/view'))) {
            $definition->setViewClass($class);
        }
    }
691993
private function validateCustomStylesConfiguration(
        ContainerInterface $container,
        array $enabledCustomStyles
    ) {
        $definedCustomStyles = array_keys(
            $container->getParameter(EzPublishCoreExtension::RICHTEXT_CUSTOM_STYLES_PARAMETER)
        );
        foreach ($enabledCustomStyles as $customStyleName) {
            if (!in_array($customStyleName, $definedCustomStyles)) {
                throw new InvalidConfigurationException(
                    "Unknown RichText Custom Style '{$customStyleName}'"
                );
            }
        }
    }
605736
public function setupRequirements(ContainerInterface $container)
    {
        $this->setTranslator($container->get('MvcTranslator'));
        $this->setInputFilterManager($container->get(InputFilterPluginManager::class));
    }
890148
public function process(ContainerBuilder $container)
    {
        $storage = $container->getParameter('o_auth2_server.storage');

        $validator = [
            'authorization_code' => 'OAuth2\\Storage\\IAuthorizationCodeStorage',
            'access_token' => 'OAuth2\\Storage\\IAccessTokenStorage',
            'client' => 'OAuth2\\Storage\\IClientStorage',
            'refresh_token' => 'OAuth2\\Storage\\IRefreshTokenStorage',
        ];

        // validate if there is some unknown key
        $validatorKeys = array_keys($validator);
        $definedKeys = array_keys($storage);
        $diff = array_diff($definedKeys, $validatorKeys);

        if (!empty($diff)) {
            throw new InvalidConfigurationException(
                "Unrecognized storages '" . join(', ', $diff) . "'."
            );
        }

        foreach ($storage as $key => $value) {
            // all storage keys has to be strings (service names)
            if (!is_string($value)) {
                $type = gettype($value);

                throw new InvalidConfigurationException(
                    "o_auth2_server.storage.$key has to be string, $type given."
                );
            }

            // service has to exist
            if (!$container->hasDefinition($value)) {
                throw new InvalidConfigurationException(
                    "Service '$value' does not exist."
                );
            }

            // service has to implement given interface
            $service = $container->getDefinition($value);

            if (!is_subclass_of($service->getClass(), $validator[$key])) {
                throw new InvalidConfigurationException(
                    "Service '$value' does not implement {$validator[$key]}."
                );
            }

            // if is temporary generator, set lifetime from config
            if (is_subclass_of($service->getClass(), 'OAuth2\\Storage\\ITemporaryGenerator')) {
                $service->addMethodCall(
                    'setLifetime',
                    [
                        $container->getParameter("o_auth2_server.{$key}s.lifetime")
                    ]
                );
            }

            $container->setAlias("o_auth2_server.storage.$key", new Alias($value));
        }
    }
1148016
protected function addCommandList(
        DependencyContainerInterface $container
    ): DependencyContainerInterface {
        $container[self::COMMAND_LIST] = function (DependencyContainerInterface $container) {
            return $this->getCommandList();
        };

        return $container;
    }
1311392
protected function parsePropertyCallbacks(ContainerInterface $container, EventDispatcherInterface $dispatcher)
    {
        foreach ((array) $this->getFromDca('fields') as $propName => $propInfo) {
            $args = [$container->getName(), $propName];
            foreach ([
                    'load_callback'        => [
                        'event' => DecodePropertyValueForWidgetEvent::NAME,
                        'class' => PropertyOnLoadCallbackListener::class
                    ],
                    'save_callback'        => [
                        'event' => EncodePropertyValueFromWidgetEvent::NAME,
                        'class' => PropertyOnSaveCallbackListener::class
                    ],
                    'options_callback'     => [
                        'event' => GetPropertyOptionsEvent::NAME,
                        'class' => ModelOptionsCallbackListener::class
                    ],
                    'input_field_callback' => [
                        'event' => BuildWidgetEvent::NAME,
                        'class' => PropertyInputFieldCallbackListener::class
                    ],
                    'wizard'               => [
                        'event' => ManipulateWidgetEvent::NAME,
                        'class' => PropertyInputFieldGetWizardCallbackListener::class
                    ],
                    'xlabel'               => [
                        'event' => ManipulateWidgetEvent::NAME,
                        'class' => PropertyInputFieldGetXLabelCallbackListener::class
                    ]
                ] as $name => $callback) {
                if (isset($propInfo[$name])) {
                    $this->parseCallback($dispatcher, $propInfo[$name], $callback['event'], $args, $callback['class']);
                }
            }
        }
    }
323834
protected function bindInitialInstances(ContainerInterface $container)
	{
		foreach($this->komponents as $komponent)
		{
			$container->bindInstance(get_class($komponent), $komponent);
		}
	}
524817
protected function parseDataProvider(ContainerInterface $container)
    {
        if ($container->hasDataProviderDefinition()) {
            $config = $container->getDataProviderDefinition();
        } else {
            $config = new DefaultDataProviderDefinition();
            $container->setDataProviderDefinition($config);
        }

        // If mode is 5, we need to define tree view.
        if ((5 === $this->getFromDca('list/sorting/mode'))
            && !$container->getBasicDefinition()->getRootDataProvider()
        ) {
            $container->getBasicDefinition()->setRootDataProvider($container->getName());
        }

        if (null !== ($parentTable = $this->getFromDca('config/ptable'))) {
            // Check config if it already exists, if not, add it.
            if (!$config->hasInformation($parentTable)) {
                $providerInformation = new ContaoDataProviderInformation();
                $providerInformation->setName($parentTable);
                $config->addInformation($providerInformation);
            } else {
                $providerInformation = $config->getInformation($parentTable);
            }

            if ($providerInformation instanceof ContaoDataProviderInformation) {
                $initializationData = (array) $providerInformation->getInitializationData();

                $providerInformation
                    ->setTableName($parentTable)
                    ->setInitializationData(
                        \array_merge(
                            [
                                'source' => $parentTable,
                                'name'   => $parentTable,
                            ],
                            $initializationData
                        )
                    );

                if (!$container->getBasicDefinition()->getRootDataProvider()) {
                    $container->getBasicDefinition()->setRootDataProvider($parentTable);
                }
                if (!$container->getBasicDefinition()->getParentDataProvider()) {
                    $container->getBasicDefinition()->setParentDataProvider($parentTable);
                }
            }
        }

        $providerName = $container->getBasicDefinition()->getDataProvider() ?: $container->getName();

        // Check config if it already exists, if not, add it.
        if (!$config->hasInformation($providerName)) {
            $providerInformation = new ContaoDataProviderInformation();
            $providerInformation->setName($providerName);
            $config->addInformation($providerInformation);
        } else {
            $providerInformation = $config->getInformation($providerName);
        }

        if ($providerInformation instanceof ContaoDataProviderInformation) {
            $initializationData = (array) $providerInformation->getInitializationData();

            if (!isset($initializationData['source'])) {
                $providerInformation
                    ->setTableName($providerName)
                    ->setInitializationData(
                        \array_merge(
                            [
                                'source' => $providerName,
                                'name'   => $providerName
                            ],
                            $initializationData
                        )
                    );
            }
            $providerInformation
                ->setVersioningEnabled((bool) $this->getFromDca('config/enableVersioning'));

            if (!$container->getBasicDefinition()->getDataProvider()) {
                $container->getBasicDefinition()->setDataProvider($providerName);
            }
        }
    }
1138176
protected function criteriaToParameters(ContainerInterface $Container)
    {
        /*
         * @var CriteriumInterface $Criterium
         */
        $parameters = [];
        foreach ($Container->getCriteria()->getCriteriumCollection() as $Criterium) {
            $SqlPart = $Criterium->getSqlPart();
            $parameters[] = $SqlPart->getParameters();
        }

        return $parameters;
    }
952904
public function process(ContainerBuilder $container)
    {
        $this->setupPools($container);
        
        $pools = $container->getParameter('gendoria_command_queue.pools');

        foreach ($container->findTaggedServiceIds(self::QUEUE_MANAGER_TAG) as $id => $tags) {
            $def = $container->getDefinition($id);
            $reflection = new ReflectionClass($def->getClass());
            if ($reflection->implementsInterface(MultipleQueueManagerInterface::class)) {
                $this->setupMultipleQueueManager($id, $def, $tags, $pools);
            } elseif ($reflection->implementsInterface(SingleQueueManagerInterface::class)) {
                $this->setupSingleQueueManager($id, $def, $tags, $pools);
            } else {
                throw new InvalidArgumentException(sprintf('Service "%s" does not implement one of required interfaces.', $id));
            }
        }
    }
1183754
public function process (ContainerBuilder $container)
    {
        if (!$container->hasDefinition('thrace_data_grid.provider')) {
            return;
        }
                
        $definition = $container->getDefinition('thrace_data_grid.provider');
        
        $dataGrids = array();
        
        foreach ($container->findTaggedServiceIds('thrace_data_grid.datagrid') as $id => $tags) {
            foreach ($tags as $attributes) {
                if (empty($attributes['alias'])) {
                    throw new \InvalidArgumentException(
                        sprintf('The alias is not defined in the "thrace_data_grid.datagrid" tag for the service "%s"', $id)
                    );
                }
                
                $dataGrids[$attributes['alias']] = $id;
            }
        }
        
        $definition->replaceArgument(1, $dataGrids);
    }
735785
public function process(ContainerBuilder $container)
    {
        $configuration = $container->get('configuration', ContainerInterface::NULL_ON_INVALID_REFERENCE);
        if ($configuration instanceof ConfigurationInterface) {
            $this->registerService($container, 'deployment_strategy', $configuration->getDeploymentStrategyClass());

            $connectionManager = $container->get('connection_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE);
            if ($connectionManager instanceof ConnectionManagerInterface) {
                foreach ($configuration->getDeploymentConnectionClasses() as $connectionType => $connectionAdapterClass) {
                    $connectionManager->registerConnectionAdapter($connectionType, $connectionAdapterClass);
                }
            }
        }
    }
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),
                    )
                );
            }
        }
    }
787991
public function process(ContainerBuilder $container)
    {
        if (!$container->has(PluginManager::class)) {
            return;
        }

        $pluginsData = [];

        // Find all Plugin services.
        $plugins = $container->findTaggedServiceIds('expansion.plugin');
        foreach ($plugins as $id => $tags) {
            $pluginsData[$id]['dataProviders'] = [];
            foreach ($tags as $attributes) {
                if (isset($attributes['data_provider'])) {
                    $pluginsData[$id]['dataProviders'][] = $attributes['data_provider'];
                }
            }
        }

        // Find the parent services.
        $plugins = $container->findTaggedServiceIds('expansion.plugin.parent');
        foreach ($plugins as $id => $tags) {
            foreach ($tags as $attributes) {
                $pluginsData[$id]['parent'][] = $attributes['parent'];
            }
        }

        // Get the data provider manager service definition to register data providers into.
        $definition = $container->getDefinition(PluginManager::class);

        foreach ($pluginsData as $pluginId => $data)
        {
            $definition->addMethodCall('registerPlugin', [
                    $pluginId,
                    empty($data['dataProviders']) ? [] : $data['dataProviders'],
                    empty($data['parent']) ? [] : $data['parent'],
                ]
            );
        }
    }
265835
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        $this->resourceManager = $container->get('claroline.manager.resource_manager');
        $this->workspaceManager = $container->get('claroline.manager.workspace_manager');
        $this->om = $container->get('claroline.persistence.object_manager');
        $this->tokenStorage = $container->get('security.token_storage');
        $this->request = $container->get('request_stack');
        $this->httpKernel = $container->get('httpKernel');
        $this->filesDir = $container->getParameter('claroline.param.files_directory');
    }
1043797
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        if ($container) {
            // Specifically inject translator for tryTranslate method
            $this->translator = $container->get('translator');
        }
    }
1159883
public function process(ContainerBuilder $container)
    {
        if (!$container->has(CronHandler::class)) {
            return;
        }

        $definition = $container->findDefinition(CronHandler::class);

        $taggedServices = $container->findTaggedServiceIds(self::TAG_NAME);

        foreach ($taggedServices as $id => $tags) {
            foreach ($tags as $attributes) {
                if (!isset($attributes['alias'])) {
                    throw new InvalidArgumentException($id, 'Tag ' . self::TAG_NAME . ' must contain "alias" argument.');
                }

                $definition->addMethodCall('addCron', [
                    new Reference($id),
                    $attributes['alias'],
                    !isset($attributes['priority']) ? 0 : (int)$attributes['priority'],
                    !isset($attributes['expression']) ? '* * * * *' : $attributes['expression'],
                    !isset($attributes['arguments']) ? '' : $attributes['arguments'],
                ]);
            }
        }
    }