@param ContainerInterface $container

@return array

@throws ContainerExceptionInterface
@throws NotFoundExceptionInterface
764866
protected static function getSessionSettings(ContainerInterface $container): array
    {
        /** @var SettingsProviderInterface $provider */
        $provider = $container->get(SettingsProviderInterface::class);
        $settings = $provider->get(C::class);

        return $settings;
    }
222101
public function inject(Container $container) : array
    {
        $parameters = $this->arguments;
        foreach ($parameters as &$parameter) {
            $parameter = $this->getParameter($container, $parameter);
        }

        return $parameters;
    }
38991
private function getBuses(ContainerBuilder $container)
    {
        $buses = [];
        $busDefinitions = $container->findTaggedServiceIds('sokil.command_bus');
        foreach ($busDefinitions as $busServiceId => $busTags) {
            foreach ($busTags as $busTagParams) {
                $buses[$busServiceId] = $container->findDefinition($busServiceId);
            }
        }

        return $buses;
    }
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);
            }
        }
    }
708201
private function getFileSystem(ContainerInterface $container): FileSystemInterface
    {
        assert($container->has(FileSystemInterface::class));

        /** @var FileSystemInterface $fileSystem */
        $fileSystem = $container->get(FileSystemInterface::class);

        return $fileSystem;
    }
136999
public static function getFirewallWithAccessListenerNames(Container $container)
    {
        $names = [];

        foreach (self::getFirewallNames($container) as $firewallName) {
            /** @var FirewallContext $firewall */
            $firewall = $container->get(sprintf('security.firewall.map.context.%s', $firewallName));

            if (0 === count($firewall->getContext())) {
                continue;
            }

            $firewallContext = $firewall->getContext();
            if (false === isset($firewallContext[0]) || 0 === count($firewallContext[0])) {
                continue;
            }

            foreach ($firewallContext[0] as $listener) {
                if ($listener instanceof AccessListener) {
                    $names[] = $firewallName;
                }
            }
        }

        return $names;
    }
1056027
public static function get(ContainerInterface $container) {
    $storage_type = $container
      ->get('config.factory')
      ->get('acm.commerce_users')
      ->get('storage_type');

    switch ($storage_type) {
      case 'database_store':
        $storage = $container
          ->get('acm.database_session_store')
          ->get('acm');
        break;

      default:
        $storage = $container
          ->get('acm.php_session_store');
        break;
    }

    return $storage;
  }
309214
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        if ($this->container->has('request') && $this->container->hasScope('request') && $this->container->isScopeActive('request')) {
            $this->request = $this->container->get('request');
        }
    }
1111700
public static function get(ContainerInterface $container) {
    $use_ecomm_sessions = $container
      ->get('config.factory')
      ->get('acm.commerce_users')
      ->get('use_ecomm_sessions');

    if ($use_ecomm_sessions) {
      return $container->get('acm.external_commerce_account_proxy');
    }

    return $container->get('acm.commerce_account_proxy');
  }
137134
protected function parseDataProvider(ContainerInterface $container)
    {
        // Parse data provider.
        if ($container->hasDataProviderDefinition()) {
            $config = $container->getDataProviderDefinition();
        } else {
            $config = new DefaultDataProviderDefinition();
            $container->setDataProviderDefinition($config);
        }

        // First check if we are using the "new" notation used in DcGeneral 0.9.
        if (!\is_array($this->getFromDca('dca_config/data_provider'))) {
            return;
        }

        $dataProvidersDca = $this->getFromDca('dca_config/data_provider');

        foreach ($dataProvidersDca as $dataProviderDcaName => $dataProviderDca) {
            $providerInformation = $this->parseSingleDataProvider(
                $container,
                $config,
                $dataProviderDca,
                $dataProviderDcaName
            );

            if ($providerInformation instanceof ContaoDataProviderInformation) {
                $initializationData     = (array) $providerInformation->getInitializationData();
                $baseInitializationData = [
                    'name' => $dataProviderDcaName
                ];

                switch ((string) $dataProviderDcaName) {
                    case 'default':
                        $providerInformation->setVersioningEnabled(
                            (bool) $this->getFromDca('config/enableVersioning')
                        );

                        $container->getBasicDefinition()->setDataProvider($providerInformation->getName());
                        $baseInitializationData['name'] = $providerInformation->getName();
                        break;

                    case 'root':
                        $container->getBasicDefinition()->setRootDataProvider($providerInformation->getName());
                        $baseInitializationData['name'] = $providerInformation->getName();
                        break;

                    case 'parent':
                        $container->getBasicDefinition()->setParentDataProvider($providerInformation->getName());
                        $baseInitializationData['name'] = $providerInformation->getName();
                        break;

                    default:
                }

                $providerInformation->setInitializationData(
                    \array_merge(
                        $baseInitializationData,
                        $dataProviderDca,
                        $initializationData
                    )
                );
            }
        }
    }
1267863
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        $this->application = null !== $container ? $this->container->get('bbapp') : null;
    }
896565
protected function parseBasicDefinition(ContainerInterface $container)
    {
        // Parse data provider.
        if ($container->hasBasicDefinition()) {
            $config = $container->getBasicDefinition();
        } else {
            $config = new DefaultBasicDefinition();
            $container->setBasicDefinition($config);
        }

        $this->parseBasicMode($config);
        $this->parseBasicFlags($config);

        if ((null !== ($filters = $this->getFromDca('list/sorting/filter')))
            && \is_array($filters)
            && !empty($filters)
        ) {
            if ($config->hasAdditionalFilter()) {
                $builder = FilterBuilder::fromArrayForRoot($config->getAdditionalFilter())->getFilter();
            } else {
                $builder = FilterBuilder::fromArrayForRoot()->getFilter();
            }

            foreach ($filters as $filter) {
                $builder->andPropertyEquals($filter[0], $filter[1]);
            }

            $config->setAdditionalFilter($config->getDataProvider(), $builder->getAllAsArray());
        }
    }
181388
public function migrate(ContainerInterface $container): void
    {
        foreach ($this->getMigrations($container) as $class) {
            assert(is_string($class));
            $this->getIO()->writeInfo("Starting migration for `$class`..." . PHP_EOL, IoInterface::VERBOSITY_VERBOSE);
            if (($migration = $this->createMigration($class, $container)) !== null) {
                $migration->init($container)->migrate();
                $this->getIO()->writeInfo("Migration finished for `$class`." . PHP_EOL, IoInterface::VERBOSITY_NORMAL);
            }
        }
    }
147415
private function getRollbacks(ContainerInterface $container): Generator
    {
        $connection = $this->getConnection($container);
        $migrated   = $this->readMigrated($connection);

        foreach (array_reverse($migrated, true) as $index => $class) {
            yield $class;
            $this->removeMigration($connection, $index);
        }
    }
867160
public function add(ContainerInterface $container, $name = null)
    {
        if ($name !== null) {
            $this->containers[$name] = $container;
        } else {
            array_push($this->containers, $container);
        }
    }
405325
public function get(ContainerInterface $container = null)
    {
        if (empty($this->arguments)) {
            $instance = new $this->class();
        } else {
            $ref = new \ReflectionClass($this->class);
            $instance = $ref->newInstanceArgs($this->prepare($container, $this->arguments));
        }

        return $this->executeMethods($instance, $container);
    }
1310312
protected function finish(ContainerInterface $container)
	{
		foreach ($this->getPackages() as $package) {
			$package->finish($container);
		}
	}