Create the DI container instance.

@param ScopeLoader $scopes
@return ContainerInterface
546361
protected function createContainer(ContainerModuleLoader $loader, ScopeLoader $scopes)
	{
		$contextCachePath = $this->cacheDirectory . DIRECTORY_SEPARATOR . $this->contextName;
		$cacheFile = $contextCachePath . DIRECTORY_SEPARATOR . 'container.php';
		
		$containerTypeName = __NAMESPACE__ . '\\CompiledContainer';
		$proxyPath = Filesystem::createDirectory($contextCachePath . DIRECTORY_SEPARATOR . 'scoped');
		
		$scopedProxies = [];
		
		foreach($scopes as $scope)
		{
			foreach($scope->getProxyTypeNames() as $typeName)
			{
				$scopedProxies[] = $typeName;
			}
		}
		
		if(!is_file($cacheFile) || $this->cache->isModified())
		{
			$builder = $this->createContainerBuilder();
			
			foreach($this->komponents as $komponent)
			{
				$komponent->build($builder);
			}
			
			foreach($loader as $module)
			{
				$module->build($builder);
			}
			
			$this->build($builder);
			
			if($this->isInstrumentationEnabled())
			{
				$manager = $this->getManifest();
			}
			else
			{
				$manager = new ReflectionTypeInfoManager();
			}
			
			$compiler = new ContainerCompiler($manager, $containerTypeName);
			$code = $compiler->compile($builder, $proxyPath, $scopedProxies);
				
			Filesystem::writeFile($cacheFile, $code);
		}
		
		require_once $cacheFile;
		
		return new $containerTypeName($this->getContainerParams());
	}
875876
public function addScope($scope)
    {
        if (!in_array($scope, $this->scopes)) {
            $this->scopes[] = $scope;
        }

        return $this;
    }
444153
public function build(ContainerInterface $container): object
    {
        return new Application(
            $container->get(RequestHandlerInterface::class),
            $container->get(EmitterInterface::class)
        );
    }
255834
protected function createRequest($client, $userId, $request, array $scopes)
    {
        return (new ServerRequest)->withParsedBody(
            ['grant_type' => 'password',
            'client_id' => $client->id,
            'client_secret' => $client->secret,
            'username' => $request->get('email'),
            'password' => $request->get('password'),
            'user_id' => $userId,
            'scope' => implode(' ', $scopes)]
        );
    }
727654
public function createContainer()
  {
    # Create the container
    $container = new Container;

    # If we have auto-wire option on ...
    if (($this->options['autowire'] ?? false)) {
      # Add reflection delegate, so auto-wiring is possible
      $container->delegate( new ReflectionContainer );
    }

    \logger()->debug('Created PSR-11 Container (The Leauge Container)');

    return $container;
  }
1023653
public function setScopes(array $scopes = null)
    {
        ValidationUtility::ensureNullOrArrayOfString('$scopes', $scopes);

        $this->scopes = $scopes;

        return $this;
    }
297960
public function createToken($name, array $scopes = [])
    {
        return Container::getInstance()->make(PersonalAccessTokenFactory::class)->make(
            $this->getKey(), $name, $scopes
        );
    }
844500
public static function getDI(array $paths, array $options): ?ContainerInterface
    {
        $class = $options['class'] ?? '';
        if (!$class) {
            return null;
        }

        $cacheDisabled = getenv(static::ENV_CACHE_DISABLED);
        if ($cacheDisabled) {
            return self::buildContainer($paths, $class, $options);
        }

        return self::getCachedContainer($class);
    }
340977
private function addDockerFacade(DependencyContainerInterface $container): DependencyContainerInterface
    {
        $container[self::DOCKER_FACADE] = function(DependencyContainerInterface $container) {
            return $container->getLocator()->dockerClient()->facade();
        };

        return $container;
    }
687556
public function createService(ServiceLocatorInterface $container)
    {
        // Retrieve the parent container when under zend-servicemanager v2
        if (method_exists($container, 'getServiceLocator')) {
            $container = $container->getServiceLocator() ?: $container;
        }

        return $this($container, ModuleOptions::class);
    }
1063775
public static function getBootstrapContainer(): ContainerInterface
    {
        $symfonyContainer = new ContainerBuilder();
        $symfonyContainer->addCompilerPass(new RegisterListenersPass(EventDispatcherInterface::class));
        $loader = new YamlFileLoader($symfonyContainer, new \Symfony\Component\Config\FileLocator(__DIR__));
        $loader->load('..' . DIRECTORY_SEPARATOR . 'services.yaml');
        $symfonyContainer->compile();
        return $symfonyContainer;
    }
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);
    }
920635
public function buildContainer(OutputInterface $output, $intSize)
    {
        $this->checkerVisitors[static::BITWISE_SHIFT_VISITOR_ID]['arguments'][] = $intSize;

        $container = new Container();

        $container['lexer'] = function () {
            return new ExtendedLexer(array(
                'usedAttributes' => array(
                    'startLine',
                    'endLine',
                    'startTokenPos',
                    'endTokenPos',
                ),
            ));
        };
        $container['parser'] = function ($c) {
            return new Parser($c['lexer']);
        };

        $this->addVisitors($container);

        $visitors = $this->checkerVisitors;
        $container['traverser'] = function () {
            $traverser = new Traverser(false);
            // Resolve fully qualified name (class, interface, function, etc) to ease some process
            $traverser->addVisitor(new NameResolver());

            return $traverser;
        };

        $container['nodeVisitorResolver'] = function ($c) use ($visitors) {
            $visitorInstances = array();
            foreach (array_keys($visitors) as $visitorServiceName) {
                $visitorInstances[] = $c[$visitorServiceName];
            }

            return new Resolver($visitorInstances);
        };
        $container['nodeAnalyzer.functionAnalyzer'] = function ($c) {
            return new FunctionAnalyzer($c['nodeAnalyzer.reflection.functionLikeCalleeReflector']);
        };
        $container['codePreprocessor.shebangRemover'] = function () {
            return new ShebangRemover();
        };
        $container['contextChecker'] = function ($c) {
            return new ContextChecker(
                $c['parser'],
                $c['lexer'],
                $c['traverser'],
                $c['codePreprocessor.shebangRemover']
            );
        };
        $container['output'] = function () use ($output) {
            return new CLIOutputBridge($output);
        };
        $container['nodePrinter'] = function () {
            return new StandardPrettyPrinter();
        };

        $outputFormat = $this->outputFormat;
        $container['resultPrinter'] = function ($c) use ($outputFormat) {
            switch ($outputFormat) {
                case ResultPrinterInterface::PLAIN_FORMAT:
                    return new CLIResultPrinter($c['output'], $c['nodePrinter'], $c['nodeStatementsRemover']);
                case ResultPrinterInterface::JSON_FORMAT:
                    return new JsonResultPrinter($c['output']);
                default: throw new \InvalidArgumentException('Invalid output format: ' . $outputFormat);
            }
        };

        $container['pathChecker'] = function ($c) {
            return new PathChecker($c['contextChecker'], $c['resultPrinter']);
        };
        $container['nodeStatementsRemover'] = function () {
            return new NodeStatementsRemover();
        };
        $container['pathTraversableFactory'] = function ($c) {
            return new PathTraversableFactory($c['excludedPathCanonicalizer']);
        };
        $container['pathCheckExecutor'] = function ($c) {
            return new PathCheckExecutor($c['pathTraversableFactory'], $c['pathChecker'], $c['traverser'], $c['nodeVisitorResolver']);
        };
        $container['excludedPathCanonicalizer'] = function ($c) {
            return new ExcludedPathCanonicalizer($c['pathHelper']);
        };
        $container['osDetector'] = function () {
            return new OSDetector();
        };
        $container['pathHelperFactory'] = function ($c) {
            return new PathHelperFactory($c['osDetector']);
        };
        $container['pathHelper'] = function ($c) {
            /** @var PathHelperFactory $pathHelperFactory */
            $pathHelperFactory = $c['pathHelperFactory'];

            return $pathHelperFactory->createPathHelper();
        };
        $container['regExpParser'] = function () {
            return new RegExpParser();
        };
        $container['reflection.functionReflector'] = function () {
            return new FunctionReflector();
        };
        $container['reflection.classReflector'] = function () {
            return new ClassReflector();
        };
        $container['nodeAnalyzer.reflection.functionCalleeReflector'] = function ($c) {
            return new FunctionCalleeReflector($c['reflection.functionReflector']);
        };
        $container['nodeAnalyzer.reflection.methodCalleeReflector'] = function ($c) {
            return new MethodCalleeReflector($c['reflection.classReflector']);
        };
        $container['nodeAnalyzer.reflection.functionLikeCalleeReflector'] = function ($c) {
            return new FunctionLikeCalleeReflector(array(
                $c['nodeAnalyzer.reflection.functionCalleeReflector'],
                $c['nodeAnalyzer.reflection.methodCalleeReflector'],
            ));
        };

        return $container;
    }
467157
public function controllerDispatcher()
    {
        if ($this->container->bound(ControllerDispatcherContract::class)) {
            return $this->container->make(ControllerDispatcherContract::class);
        }

        return new ControllerDispatcher($this->container);
    }
853632
public function createToken($owner, $client, array $scopes = []): RefreshToken
    {
        if (empty($scopes)) {
            $scopes = $this->scopeService->getDefaultScopes();
        } else {
            $this->validateTokenScopes($scopes);
        }

        do {
            $token = RefreshToken::createNewRefreshToken(
                $this->serverOptions->getRefreshTokenTtl(),
                $owner,
                $client,
                $scopes
            );
        } while ($this->tokenRepository->tokenExists($token->getToken()));

        return $this->tokenRepository->save($token);
    }
1105962
public function createService(ServiceLocatorInterface $container)
    {
        // Retrieve the parent container when under zend-servicemanager v2
        if (method_exists($container, 'getServiceLocator')) {
            $container = $container->getServiceLocator() ?: $container;
        }

        return $this($container, Extras::class);
    }
1226690
private function createContainer(array $files)
    {
        $containerBuilder = new Container();
        $loader = $this->createLoader($containerBuilder);
        foreach ($files as $file) {
            $loader->load($file);
        }

        return $containerBuilder;
    }