public function build(): ContainerInterface
    {
        $this->parameters['service_bus.environment'] = (string) $this->environment;
        $this->parameters['service_bus.entry_point'] = $this->entryPointName;

        $containerBuilder = new SymfonyContainerBuilder(new ParameterBag($this->parameters));

        /** @var Extension $extension */
        foreach ($this->extensions as $extension)
        {
            $extension->load($this->parameters, $containerBuilder);
        }

        /** @var CompilerPassInterface $compilerPass */
        foreach ($this->compilerPasses as $compilerPass)
        {
            $containerBuilder->addCompilerPass($compilerPass);
        }

        /** @var ServiceBusModule $module */
        foreach ($this->modules as $module)
        {
            $module->boot($containerBuilder);
        }

        $containerBuilder->compile();

        $this->dumpContainer($containerBuilder);

        return $this->cachedContainer();
    }
public function build(): ContainerInterface
    {
        $this->parameters['service_bus.environment'] = (string) $this->environment;
        $this->parameters['service_bus.entry_point'] = $this->entryPointName;

        $containerBuilder = new SymfonyContainerBuilder(new ParameterBag($this->parameters));

        /** @var Extension $extension */
        foreach ($this->extensions as $extension)
        {
            $extension->load($this->parameters, $containerBuilder);
        }

        /** @var CompilerPassInterface $compilerPass */
        foreach ($this->compilerPasses as $compilerPass)
        {
            $containerBuilder->addCompilerPass($compilerPass);
        }

        /** @var ServiceBusModule $module */
        foreach ($this->modules as $module)
        {
            $module->boot($containerBuilder);
        }

        $containerBuilder->compile();

        $this->dumpContainer($containerBuilder);

        return $this->cachedContainer();
    }
public function build ( ) : ContainerInterface { $ this -> parameters [ 'service_bus.environment' ] = ( string ) $ this -> environment ; $ this -> parameters [ 'service_bus.entry_point' ] = $ this -> entryPointName ; $ containerBuilder = new SymfonyContainerBuilder ( new ParameterBag ( $ this -> parameters ) ) ; /** @var Extension $extension */ foreach ( $ this -> extensions as $ extension ) { $ extension -> load ( $ this -> parameters , $ containerBuilder ) ; } /** @var CompilerPassInterface $compilerPass */ foreach ( $ this -> compilerPasses as $ compilerPass ) { $ containerBuilder -> addCompilerPass ( $ compilerPass ) ; } /** @var ServiceBusModule $module */ foreach ( $ this -> modules as $ module ) { $ module -> boot ( $ containerBuilder ) ; } $ containerBuilder -> compile ( ) ; $ this -> dumpContainer ( $ containerBuilder ) ; return $ this -> cachedContainer ( ) ; }
Build container.

@throws \InvalidArgumentException When provided tag is not defined in this extension
@throws \LogicException Cannot dump an uncompiled container
@throws \RuntimeException When cache file can't be written
@throws \Symfony\Component\DependencyInjection\Exception\EnvParameterException When an env var exists but has
not been dumped
@throws \Throwable Boot module failed

@return ContainerInterface
Build container .