Implemented for backwards compatibility only.

Returns the creation context.

@deprecated since 3.0.0. The creation context should be passed during
instantiation instead.
@param ContainerInterface $container
@return void
3699
public function setServiceLocator(ContainerInterface $container)
    {
        trigger_error(sprintf(
            'Usage of %s is deprecated since v3.0.0; please pass the container to the constructor instead',
            __METHOD__
        ), E_USER_DEPRECATED);
        $this->creationContext = $container;
    }
323834
protected function bindInitialInstances(ContainerInterface $container)
	{
		foreach($this->komponents as $komponent)
		{
			$container->bindInstance(get_class($komponent), $komponent);
		}
	}
400904
public static function buildLogger(ContainerInterface $container)
    {
        $factory = new MonologFactory(
            $container->getParameter('kernel.log_dir'),
            $container->getParameter('kernel.env')
        );

        return($factory->getServiceClass());
    }
222204
public function getContext(TemplateContextInterface $context = null)
    {
        $context = new TemplateContext($context);
        $context->setData($this->getData());
        $context->setParameters($this->getParameters());

        return $context;
    }
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');
  }
274771
public static function create(
        ContainerInterface $container = null,
        array $configs = []
    ){
        if (null === $container) {
            $container = Factory::create();
        }

        return new Cache(
          $container,
          new SerializerManager(),
          new CompressorManager(),
          $configs
        );
    }
1335166
public function context(ContextInterface $context)
    {
        if (!empty($this->vary)) {
            $this->varyValue = $context->get($this->vary);
        }
    }
110068
protected function createPolicyEnforcementPoint(ContainerInterface $container): PolicyEnforcementPointInterface
    {
        $contextDefinitions = [
            ContextProperties::CTX_CONTAINER => $container,
        ];

        $pip = new PolicyInformationPoint($contextDefinitions);
        $pdp = new PolicyDecisionPoint($this->getPoliciesData());
        $pep = new PolicyEnforcementPoint($pip, $pdp);

        if ($this->logger !== null) {
            $pip->setLogger($this->logger);
            $pdp->setLogger($this->logger);
            $pep->setLogger($this->logger);
        }

        return $pep;
    }
331080
public static function inject(ContainerInterface $container, $entry)
    {
        if (! is_object($entry)) {
            return $entry;
        }

        if (! static::classUses($entry, ManageContainerTrait::class)
            && ! $entry instanceof ManageContainerInterface) {
            return $entry;
        }

        // set the container
        return $entry->setAppContainer($container);
    }
669578
public function addContainer(ContainerInterface $container)
    {
        $container->setDelegator($this);
        $this->containers[] = $container;
        return $this;
    }
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));
        }
    }
1085173
public static function buildFromContainer(ContainerInterface $container): App
    {
        return new App(
            self::request($container),
            self::response($container),
            self::processor($container),
            self::matchableRequest($container),
            self::errorHandler($container),
            self::invalidRequestHandler($container),
            self::streamReadLength($container)
        );
    }
193192
public function applyContext(ContainerBuilder $container)
    {
        $definition = $container->findDefinition('sonata.block.context_manager');

        foreach ($container->getParameter('sonata_block.blocks') as $service => $settings) {
            if (\count($settings['settings']) > 0) {
                $definition->addMethodCall('addSettingsByType', [$service, $settings['settings'], true]);
            }
        }
        foreach ($container->getParameter('sonata_block.blocks_by_class') as $class => $settings) {
            if (\count($settings['settings']) > 0) {
                $definition->addMethodCall('addSettingsByClass', [$class, $settings['settings'], true]);
            }
        }
    }
1304036
private function resolveContainer(): ContainerInterface
    {
        if ($this->container === null) {
            $container = $this->containerFactory->build($this);

            if (!$container instanceof ContainerInterface) {
                throw new \RuntimeException(
                    "Invalid factory result, expected ContainerInterface"
                );
            }

            $this->container = $container;
        }

        return $this->container;
    }
848346
protected function injectPackages(ContainerInterface $container)
	{
		foreach ($this->getPackages() as $package) {
			$package->inject($container);
		}
	}
72411
public static function configureContainer(LimoncelloContainerInterface $container): void
    {
        $factory = new Factory($container);

        $container[FactoryInterface::class] = $factory;

        $container[JsonSchemasInterface::class] = function (PsrContainerInterface $container) use ($factory) {
            $settings     = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
            $modelSchemas = $container->get(ModelSchemaInfoInterface::class);

            return $factory->createJsonSchemas(
                $settings[FluteSettings::KEY_MODEL_TO_SCHEMA_MAP],
                $settings[FluteSettings::KEY_TYPE_TO_SCHEMA_MAP],
                $modelSchemas
            );
        };

        $container[ParametersMapperInterface::class] = function (PsrContainerInterface $container) {
            return new ParametersMapper($container->get(JsonSchemasInterface::class));
        };

        $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) {
            /** @var JsonSchemasInterface $jsonSchemas */
            $jsonSchemas = $container->get(JsonSchemasInterface::class);
            $settings    = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
            $encoder     = $factory
                ->createEncoder($jsonSchemas)
                ->withEncodeOptions($settings[FluteSettings::KEY_JSON_ENCODE_OPTIONS])
                ->withEncodeDepth($settings[FluteSettings::KEY_JSON_ENCODE_DEPTH])
                ->withUrlPrefix($settings[FluteSettings::KEY_URI_PREFIX]);
            isset($settings[FluteSettings::KEY_META]) ? $encoder->withMeta($settings[FluteSettings::KEY_META]) : null;
            ($settings[FluteSettings::KEY_IS_SHOW_VERSION] ?? false) ?
                $encoder->withJsonApiVersion(FluteSettings::DEFAULT_JSON_API_VERSION) : null;

            return $encoder;
        };

        $container[RelationshipPaginationStrategyInterface::class] = function (PsrContainerInterface $container) {
            $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);

            return new BasicRelationshipPaginationStrategy($settings[FluteSettings::KEY_DEFAULT_PAGING_SIZE]);
        };

        $container[JsonApiParserFactoryInterface::class] = function (PsrContainerInterface $container) {
            $factory = new JsonApiParserFactory($container);

            return $factory;
        };

        $container[FormValidatorFactoryInterface::class] = function (PsrContainerInterface $container) {
            $factory = new FormValidatorFactory($container);

            return $factory;
        };

        // register date/date time types
        Type::hasType(DateTimeType::NAME) === true ?: Type::addType(DateTimeType::NAME, DateTimeType::class);
        Type::hasType(DateType::NAME) === true ?: Type::addType(DateType::NAME, DateType::class);
    }
1251672
public void createContainerContext(@Observes EventContext<ContainerControlEvent> context) {
        ContainerContext containerContext = this.containerContext.get();
        ContainerControlEvent event = context.getEvent();

        try {
            containerContext.activate(event.getContainerName());
            context.proceed();
        } finally {
            containerContext.deactivate();
        }
    }