private static function getContainerBuilder(Configuration $configuration): DIContainerBuilder
    {
        $containerBuilder = new DIContainerBuilder($configuration->getContainerClass());

        $containerBuilder->useAutowiring($configuration->doesUseAutowiring());
        $containerBuilder->useAnnotations($configuration->doesUseAnnotations());
        $containerBuilder->ignorePhpDocErrors($configuration->doesIgnorePhpDocErrors());

        if ($configuration->doesUseDefinitionCache()) {
            $containerBuilder->enableDefinitionCache();
        }

        if ($configuration->getWrapContainer() !== null) {
            $containerBuilder->wrapContainer($configuration->getWrapContainer());
        }

        if ($configuration->getProxiesPath() !== null) {
            $containerBuilder->writeProxiesToFile(true, $configuration->getProxiesPath());
        }

        if (!empty($configuration->getCompilationPath())) {
            $containerBuilder->enableCompilation(
                $configuration->getCompilationPath(),
                'CompiledContainer',
                $configuration->getCompiledContainerClass()
            );
        }

        return $containerBuilder;
    }