@param ContainerInterface $container

@return array
194618
private static function getCsrfSettings(ContainerInterface $container): array
    {
        /** @var SettingsProviderInterface $provider */
        assert($container->has(SettingsProviderInterface::class) === true);
        $provider = $container->get(SettingsProviderInterface::class);

        assert($provider->has(CsrfSettings::class));
        $settings = $provider->get(CsrfSettings::class);

        return $settings;
    }
1294072
public function install(ContainerInterface $container)
    {
        // string.my_model_name immediate value
        $container['string.my_model_name'] = function(){
            return 'Prius';
        };
        $container->slot('string.my_model_name')->lock()->mustBeTypeOf('string');
        // array.toyota_branches immediate value
        $container['array.toyota_branches'] = function(){
            return ['Tokyo','Osaka','Sapporo'];
        };
        $container->slot('array.toyota_branches')->lock()->mustBeTypeOf('array');
        // integer.car_seats_sedan immediate value
        $container['integer.car_seats_sedan'] = function(){
            return 4;
        };
    }
669578
public function addContainer(ContainerInterface $container)
    {
        $container->setDelegator($this);
        $this->containers[] = $container;
        return $this;
    }
254631
protected function loadAdditionalDefinitions(ContainerInterface $container)
    {
        if (null !== $this->getFromDca('dca_config/data_provider')) {
            $dataContainerName = $container->getName();
            $this->getDispatcher()->addListener(
                PopulateEnvironmentEvent::NAME,
                function (PopulateEnvironmentEvent $event) use ($dataContainerName) {
                    $environment = $event->getEnvironment();
                    $definition  = $environment->getDataDefinition();
                    if ($definition->getName() !== $dataContainerName) {
                        return;
                    }

                    $parentName = $definition->getBasicDefinition()->getParentDataProvider();
                    if ($parentName) {
                        if ($parentName === $definition->getName()) {
                            $parentDefinition = $definition;
                        } else {
                            $parentDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($parentName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }
                        $environment->setParentDataDefinition($parentDefinition);
                    }

                    $rootName = $definition->getBasicDefinition()->getRootDataProvider();
                    if ($rootName) {
                        if ($rootName === $definition->getName()) {
                            $rootDefinition = $definition;
                        } else {
                            $rootDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($rootName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }

                        $environment->setRootDataDefinition($rootDefinition);
                    }
                }
            );
        }
    }
233982
public static function get(ContainerInterface $container) {
    $test_mode = $container
      ->get('config.factory')
      ->get('acm.connector')
      ->get('test_mode');

    if ($test_mode) {
      return $container->get('acm.test_agent_api');
    }

    return $container->get('acm.agent_api');
  }
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;
    }
642197
private function findAndValidateMappingAwareDefinitionList(ContainerBuilder $container): array
    {
        $mappingAwareServiceDefinitionList = [];
        $methodAwareServiceIdList = array_keys($container->findTaggedServiceIds(self::JSONRPC_METHOD_AWARE_TAG));
        foreach ($methodAwareServiceIdList as $serviceId) {
            $definition = $container->getDefinition($serviceId);

            $this->checkMethodAwareServiceIdList($definition, $serviceId, $container);

            $mappingAwareServiceDefinitionList[$serviceId] = $definition;
        }

        return $mappingAwareServiceDefinitionList;
    }
941229
protected static function getHostUri(ContainerInterface $container): string
    {
        /** @var RequestStorageInterface $curRequestStorage */
        $curRequestStorage = $container->get(RequestStorageInterface::class);
        $curRequestUri     = $curRequestStorage->get()->getUri();

        $scheme = $curRequestUri->getScheme();
        $host   = $curRequestUri->getHost();
        $port   = $curRequestUri->getPort();

        $result = $port === null || $port === 80 ? "$scheme://$host" : "$scheme://$host:$port";

        return $result;
    }
1356724
private function getSelectContainer(EnvironmentInterface $environment)
    {
        $inputProvider  = $environment->getInputProvider();
        $sessionStorage = $environment->getSessionStorage();

        $sessionName = $environment->getDataDefinition()->getName() . '.' . $inputProvider->getParameter('mode');
        if (!$sessionStorage->has($sessionName)) {
            return [];
        }

        $selectAction = $inputProvider->getParameter('select');
        if (!$selectAction) {
            return [];
        }

        $session = $sessionStorage->get($sessionName);
        if (!\array_key_exists($selectAction, $session)) {
            return [];
        }

        return $session[$selectAction];
    }
211416
protected function doBuildWhere(ContainerInterface $container)
    {
        $condition = '';
        if ($container->getCondition()) {
            $condition .= $this->buildCondition($container);
        } else {
            foreach ($container->getCollectionOfConditions() as $subContainer) {
                if (ContainerInterface::CONDITION_NAME === $subContainer->getType()) {
                    $condition .= $this->buildCondition($subContainer);
                } elseif (ContainerInterface::COLLECTION_NAME === $subContainer->getType()) {
                    $condition .= $this->doBuildWhere($subContainer);
                }
            }
        }
        if (!$condition = $this->trimAndOr($condition)) {
            return null;
        }

        return sprintf(
            '%s(%s)',
            $container->getAndOr() ? sprintf(' %s ', $container->getAndOr()) : null,
            $condition
        );
    }
222101
public function inject(Container $container) : array
    {
        $parameters = $this->arguments;
        foreach ($parameters as &$parameter) {
            $parameter = $this->getParameter($container, $parameter);
        }

        return $parameters;
    }
1310004
private function readFromContainer(ContainerInterface $container)
    {
        $this->setValueIfParameterExists($container, $this->uriPrefixes[self::IMAGE_URL], 'bbapp.routing.image_uri_prefix')
                ->setValueIfParameterExists($container, $this->uriPrefixes[self::MEDIA_URL], 'bbapp.routing.media_uri_prefix')
                ->setValueIfParameterExists($container, $this->uriPrefixes[self::RESOURCE_URL], 'bbapp.routing.resource_uri_prefix')
                ->setValueIfParameterExists($container, $this->defaultScheme, 'bbapp.routing.default_protocol');

        if (null === $this->logger && $container->has('logging')) {
            $this->logger = $container->get('logging');
        }
    }
465879
public function cachedContainer(): ContainerInterface
    {
        /**
         * @noinspection   PhpIncludeInspection Include generated file
         * @psalm-suppress UnresolvableInclude Include generated file
         */
        include_once $this->getContainerClassPath();

        /** @psalm-var class-string<\Symfony\Component\DependencyInjection\Container> $containerClassName */
        $containerClassName = $this->getContainerClassName();

        /** @var ContainerInterface $container */
        $container = new $containerClassName();

        return $container;
    }
838261
protected function parsePalettes(ContainerInterface $container)
    {
        $palettesDefinitionArray    = $this->getFromDca('palettes');
        $subPalettesDefinitionArray = $this->getFromDca('subpalettes');

        // Skip while there is no legacy palette definition.
        if (!\is_array($palettesDefinitionArray)) {
            return;
        }

        // Ignore non-legacy sub palette definition.
        if (!\is_array($subPalettesDefinitionArray)) {
            $subPalettesDefinitionArray = [];
        }

        if ($container->hasDefinition(PalettesDefinitionInterface::NAME)) {
            $palettesDefinition = $container->getDefinition(PalettesDefinitionInterface::NAME);
        } else {
            $palettesDefinition = new DefaultPalettesDefinition();
            $container->setDefinition(PalettesDefinitionInterface::NAME, $palettesDefinition);
        }

        $palettesParser = new LegacyPalettesParser();
        $palettesParser->parse(
            $palettesDefinitionArray,
            $subPalettesDefinitionArray,
            $palettesDefinition
        );
    }
651845
private function getRedisConfig(ContainerInterface $container)
    {
        if (!$container->has('config')) {
            return [];
        }

        $config = $container->get('config');

        if (!isset($config['doctrine']['cache']['redis'])) {
            return [];
        }

        return $config['doctrine']['cache']['redis'];
    }
429688
public function getDispatcherFactory(ContainerInterface $container): DispatcherFactoryInterface
    {
        $autowired = $container->get('ellipse.dispatcher.autowiring.status');

        if ($autowired) {

            $interfaces = $container->get('ellipse.dispatcher.autowiring.interfaces');

            $container = new ReflectionContainer($container, $interfaces);

        }

        return new DefaultResolver($container);
    }
136631
private static function matchableRequest(ContainerInterface $container): MatchableRequestInterface
    {
        if (!$container->has(MatchableRequestInterface::class)) {
            return new MatchableRequest($container->get(ServerRequestInterface::class));
        }

        return $container->get(MatchableRequestInterface::class);
    }