Adds the constructor for a frozen container.

@return string
357695
private function addFrozenConstructor()
    {
        $targetDirs = $this->exportTargetDirs();

        $code = <<<EOF

    /*{$this->docStar}
     * Constructor.
     */
    public function __construct()
    {{$targetDirs}
EOF;

        if ($this->container->getParameterBag()->all()) {
            $code .= "\n        \$this->parameters = \$this->getDefaultParameters();\n";
        }

        $code .= "\n        \$this->services = array();\n";
        $code .= $this->addMethodMap();
        $code .= $this->addAliases();

        $code .= <<<'EOF'
    }

EOF;

        return $code;
    }
1297457
protected function getContainerBuilder(): ContainerBuilder
    {
        $container = new ContainerBuilder();
        $container->getParameterBag()->add($this->getKernelParameters());

        if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator')) {
            $container->setProxyInstantiator(new RuntimeInstantiator());
        }

        return $container;
    }
83048
protected function _construct()
    {
        $this->_objectId = 'id';
        $this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
        $this->_controller = 'adminhtml_thesaurus';

        parent::_construct();

        $this->buttonList->update('save', 'label', __('Create Thesaurus'));
    }
982336
protected function buildContainer()
    {
        $container = new ContainerBuilder($this->parameters);
        $container->addCompilerPass(new ConfigurationServiceRegistrationCompilerPass());
        $container->addCompilerPass(new AwarenessCompilerPass());

        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/Resources'));
        $loader->load('services.yml');

        return $container;
    }
951246
protected function binder()
    {
        if (! $this->bindingRegistrar) {
            $this->bindingRegistrar = Container::getInstance()->bound(BindingRegistrar::class)
                        ? Container::getInstance()->make(BindingRegistrar::class) : null;
        }

        return $this->bindingRegistrar;
    }
183103
public function compileContainerCode()
    {
        $builder = new ContainerBuilder($this->configTree);
        foreach ($this->plugins as $name => $plugin) {
            $plugin->setContainerBuilder($builder);
        }
        $containerNode = $builder->build();
        $buffer = new Buffer();
        $buffer->write('<?php')->eol();
        $containerNode->compile($buffer);
        $buffer->writeln('return $z;');
        $code = $buffer->getResult();
        return $code;
    }
667929
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Catalog::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Catalog::class
        );
    }
1318565
protected function initContainer()
    {
        $initNode = $this->getResolver()->getSectionId('', 'init');

        if ($this->getResolver()->has($initNode)) {
            $this->getFactory()->executeMethodBatch(
                $this->getResolver()->get($initNode)
            );
        }
        return $this;
    }
681128
public function construct()
	{
		if ($this->arguments->getOpt(4))
		{
				$extension = $this->arguments->getOpt(4);
				$this->addReplacement('plugin_name', $extension);
				$this->addReplacement('extension', $extension);
		}
		else
		{
			$this->output->error("Error: must specify a hubtype.");
		}

		// Determine our base path
		$base       = $this->arguments->getOpt('app') ? PATH_APP : PATH_CORE;
		$installDir = trim($this->arguments->getOpt('install-dir'));
		if ($installDir && strlen($installDir) > 0)
		{
			if (substr($installDir, 0, 1) == DS)
			{
				$base = rtrim($installDir, DS);
			}
			else
			{
				$base .= DS . trim($installDir, DS);
			}
		}

		// Install directory is migrations folder within base
		$installDir = $base . DS . 'plugins' . DS . 'search';

		// Editor
		$editor = null;
		if ($this->arguments->getOpt('editor'))
		{
			$editor = $this->arguments->getOpt('editor');
		}
		else
		{
			$editor = (getenv('EDITOR')) ? getenv('EDITOR') : 'vi';
		}

		// @TODO detect previous file, warn about override

		// Make plugin file
		$classname   = 'plgSearch' . ucfirst($extension);
		$destination = $installDir . DS . $extension . DS .  $extension. '.php';

		// Make directory
		if (!is_dir($installDir. DS . $extension))
		{
			App::get('filesystem')->makeDirectory($installDir . DS . $extension);
		}

		$this->addTemplateFile("{$this->getType()}.tmpl", $destination)
			 ->addReplacement('class_name', $classname)
			 ->make();
	}
404185
public function getContainer()
    {
        if (null !== $this->container) {
            throw new ContainerAlreadyExistsException($this->container);
        }

        // Construct container
        $this->container = new Container();
        $this->hydrateContainerWithBootstrapParameters();

        if (false === $this->tryParseContainerDump()) {
            $this->hydrateContainerWithApplicationParameters();
            $this->loadApplicationServices();
        }

        return $this->container;
    }
333849
private function createContainer(): void
    {
        if (!$this->container) {
            $builder = new ContainerBuilder();
            $builder->addDefinitions([
                self::class => $this,
            ]);
            $this->container = $builder->build();
        }
    }
283280
protected function initializeContainer()
    {
        $class = $this->getContainerClass();
        $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
        $fresh = true;
        if (!$cache->isFresh()) {
            $container = $this->buildContainer();
            $container->compile();
            $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());

            $fresh = false;
        }

        require_once $cache->getPath();

        $this->container = new $class();
        $this->container->set('kernel', $this);

        if (!$fresh && $this->container->has('cache_warmer')) {
            $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
        }
    }
931995
public static function createContainer()
    {
        $resolver = new ReferenceResolver();
        
        $builder = new ContainerBuilder($resolver, [self::$appDir]);

        foreach (self::$loaders as $loader) {
            $builder->addLoader($loader);
        }
        $builder->setApplicationRootDirectory(self::$appDir);

        $builder->addConfigFiles(self::$configFiles);

        return $builder->createContainer();
    }
1216573
private function addServices()
    {
        if (!$this->container->getDefinitions()) {
            return '';
        }

        $code = "services:\n";
        foreach ($this->container->getDefinitions() as $id => $definition) {
            $code .= $this->addService($id, $definition);
        }

        $aliases = $this->container->getAliases();
        foreach ($aliases as $alias => $id) {
            while (isset($aliases[(string) $id])) {
                $id = $aliases[(string) $id];
            }
            $code .= $this->addServiceAlias($alias, $id);
        }

        return $code;
    }
821110
public function build() : ContainerInterface
    {
        try{
            // call bootstrap code
            $startup = $this->bootstrap;
            
            $startup($this->container);
        }
        catch(\Throwable $e)
        {
            throw new ContainerBuildingException($e);
        }
        return $this->container;
    }
1319797
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\FailedAuth::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\FailedAuth::class
        );
    }
116672
static function init()
    {
        $dic = new Container();

        $dic['utc_offset'] = 0;

        $dic['datetimenow'] = function () {
            $now = Carbon::now('UTC');

            return $now->toDateTimeString();
        };

        $dic['phpmailer'] = function () {
            $phpmailer = new PHPMailer();
            $phpmailer->isHTML(true);
            $phpmailer->CharSet = 'windows-1251';
            $phpmailer->From = SettingsMail::APP_EMAIL;
            $phpmailer->FromName = iconv('utf-8', 'windows-1251', SettingsGeneral::APP_NAME);

            if (SettingsMail::SMTP) {
                $phpmailer->isSMTP();
                $phpmailer->SMTPDebug = 0;
                $phpmailer->SMTPAuth = true;
                $phpmailer->SMTPSecure = SettingsMail::SMTP_SECURITY;
                $phpmailer->Host = SettingsMail::SMTP_HOST;
                $phpmailer->Port = SettingsMail::SMTP_PORT;
                $phpmailer->Username = SettingsMail::SMTP_USERNAME;
                $phpmailer->Password = SettingsMail::SMTP_PASSWORD;
            }

            return $phpmailer;
        };

        $dic['mailer'] = function ($c) {
            return new Mailer($c);
        };

        $dic['sms'] = function () {
            return new SMS();
        };

        $dic['datachangelog'] = function ($c) {
            return new DataChangeLog($c);
        };

        $dic['log'] = function () {
            return LoggerFactory::create('Main');
        };

        $dic['checker'] = function ($c) {
            return new Checker($c);
        };

        return $dic;
    }