PSR-11 set container

@param   string $container
@param   string|object $object
@param   ConfigInterface $config
@return  ContainersInterface
166383
public function set(string $container, $object, ConfigInterface $config = null): ContainersInterface
    {
        if (!$this->has($container)) {
            if (\is_object($object)) {
                $this->setContainer($container, $object);
            } else {
                $class = '\\DrMVC\\' . $object;
                $this->setContainer($container, new $class($config));
            }
        }
        return $this;
    }
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');
        }
    }
1251746
public function setContainer(ContainerInterface $container = null)
    {
        $this->abortIf(is_null($container), 'Requires DI container');

        $this->fs = $container->get('filesystem');
        $this->em = $container->get('doctrine.orm.entity_manager');
        $this->target = $container->getParameter('kernel.root_dir').'/../web/media/example/';
        $this->source = $container->get('kernel')->locateResource('@AnimeDbDevBundle/Resource/private/images/');
    }
61870
public function build(array $config, ContainerInterface $container = null)
    {
        $dispatcher = new Dispatcher($container);
        foreach ((array) $config as $name => $listeners) {
            foreach ($listeners as $listener) {
                if (is_callable($listener)) {
                    $dispatcher->register($name, $listener);
                    continue;
                }

                $listener = $this->applyDefaults($listener);

                $dispatcher->register(
                    $name,
                    $this->buildDefinition($listener)
                );
            }
        }

        return $dispatcher;
    }
435560
public static function configureContainer(LimoncelloContainerInterface $container): void
    {
        static::baseConfigureContainer($container);

        $container[PassportServerIntegrationInterface::class] = function (
            PsrContainerInterface $container
        ): PassportServerIntegrationInterface {
            return new PassportServerIntegration($container);
        };

        $container[TokenRepositoryInterface::class] = function (
            PsrContainerInterface $container
        ): TokenRepositoryInterface {
            $connection = $container->get(Connection::class);
            $schema     = $container->get(DatabaseSchemaInterface::class);

            return new TokenRepository($connection, $schema);
        };
    }
1353472
protected function buildContainer($config)
    {
        $container = new ContainerBuilder(new ParameterBag($this->getParameters()));

        $this->prepareContainer($container);
        $this->getContainerLoader($container)->load($config);

        return $container;
    }
630129
public function setContainer(Container $container)
    {
        $pipeline = $this->pipeline;

        $closure = function () use ($container) {
            $this->container = $container;
        };

        $resetPipeline = $closure->bindTo($pipeline, $pipeline);
        $resetPipeline();

        return $this;
    }
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');
    }
1129655
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $reflection = new \ReflectionClass(Configuration::class);
        $container->addResource(new FileResource($reflection->getFileName()));

        return new Configuration();
    }
757569
public static function getInstance(AnConfigInterface $config, AnServiceInterface $container)
    {
        if (!$container->has($config->service_identifier)) {
            $instance = new AnMail($config);
            $container->set($config->service_identifier, $instance);
        }

        return $container->get($config->service_identifier);
    }
743219
public function setContainer(ContainerInterface $container = null)
    {
        parent::setContainer($container);

        if ($this->getApplication()) {
            $mediaClasses = $this->getApplication()->getAutoloader()->glob('Media'.DIRECTORY_SEPARATOR.'*');
            foreach ($mediaClasses as $mediaClass) {
                class_exists($mediaClass);
            }
        }
    }
43933
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        $this->eventDispatcher = $this->container->get('event_dispatcher');
    }
506102
public static function getInstance(AnConfigInterface $config, AnServiceInterface $container)
     {
         if (! $container->has($config->service_identifier)) {

             $person = null;

             if (PHP_SAPI != 'cli') {
                $session = AnService::get('com:sessions');
                $person = $session->has('person') ? $session->get('person') : null;
             }

             $repository = AnService::get('repos:people.person');

             if(isset($person->id)) {
                 $viewer = $repository->find(array('id' => $person->id));
             } else {

                 $viewer = $repository
                 ->getEntity()
                 ->setData(array(
                    'id' => 0,
                    'usertype' => ComPeopleDomainEntityPerson::USERTYPE_GUEST
                 ))->reset();

                 $viewer->getRepository()->extract($viewer);
             }

             $container->set($config->service_identifier, $viewer);
         }

         return $container->get($config->service_identifier);
     }
897054
public function setContainer(\Interne\SeanceBundle\Entity\Container $container = null)
    {
        $this->container = $container;

        return $this;
    }
318400
public static function build($containerClass = Container::class, $config = [], $useAnnotations = true)
    {
        $builder = new \DI\ContainerBuilder($containerClass);

        $builder->useAnnotations($useAnnotations);

        $builder->addDefinitions(static::getDefaultConfig());
        $builder->addDefinitions($config);

        $container = $builder->build();

        $container->set(Request::class, get('request'));
        $container->set(Response::class, get('response'));
        $container->set($containerClass, get(\DI\Container::class));

        return $container;
    }
765868
public function setContainer(Container $container = null)
    {
        $this->container = $container;
        $this->parameters = array();

        return $this;
    }
1138830
public function setContainer(Symfony\Component\DependencyInjection\Container $container) {
        $this->container = $container;

        return $this;
    }