Get service container.

@return \Berlioz\ServiceContainer\ServiceContainer
@throws \Psr\Container\ContainerExceptionInterface
@throws \Berlioz\Core\Exception\BerliozException
489876
public function getServices(): ServiceContainer
    {
        if (is_null($this->services)) {
            $this->services = new ServiceContainer();
            $this->services->setConstraints(['caching'    => '\Psr\SimpleCache\CacheInterface',
                                             'events'     => '\Psr\EventManager\EventManagerInterface',
                                             'flashbag'   => '\Berlioz\Core\Services\FlashBag',
                                             'logging'    => '\Psr\Log\LoggerInterface',
                                             'routing'    => '\Berlioz\Core\Services\Routing\RouterInterface',
                                             'templating' => '\Berlioz\Core\Services\Template\TemplateInterface']);
            $this->services->registerServices(['events'     => ['class' => '\Berlioz\Core\Services\Events\EventManager'],
                                               'flashbag'   => ['class' => '\Berlioz\Core\Services\FlashBag'],
                                               'logging'    => ['class' => '\Berlioz\Core\Services\Logger'],
                                               'routing'    => ['class' => '\Berlioz\Core\Services\Routing\Router'],
                                               'templating' => ['class' => '\Berlioz\Core\Services\Template\DefaultEngine']]);
            $this->services->registerServices($this->getConfig()->get('app.services'));
            $this->services->register('app', $this);
        }

        return $this->services;
    }
304559
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, Writer\Db::class);
    }
532493
public function getContainer()
    {
        if (! $this->container) {
            $this->container = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
        }

        return $this->container;
    }
581692
protected function getContainer(ServiceLocatorInterface $serviceLocator)
    {
        if ($this->container !== null) {
            return $this->container;
        }

        $this->container = $serviceLocator->get(static::CONTAINER_NAME);

        if ($this->container instanceof ContainerInterface) {
            return $this->container;
        }

        throw new RuntimeException(sprintf(
            'Container "%s" is not a valid DI\\ContainerInterface, "%s" found',
            'DI\\Container',
            is_object($this->container) ? get_class($this->container) : gettype($this->container)
        ));
    }
587039
public static function getContainer() : ?ContainerInterface
    {
        if (is_null(self::$container)) {
            self::setContainer(self::getDefaultContainer());
        }

        return self::$container;
    }
728309
public function getContainer()
    {
        if (is_null($this->_container)) {
            $def = [
                'session' => Definition::factory(
                    ['Slick\Session\Session', 'get']
                )
            ];
            $this->setContainer(ContainerBuilder::buildContainer($def));
        }
        return $this->_container;
    }
465879
public function cachedContainer(): ContainerInterface
    {
        /**
         * @noinspection   PhpIncludeInspection Include generated file
         * @psalm-suppress UnresolvableInclude Include generated file
         */
        include_once $this->getContainerClassPath();

        /** @psalm-var class-string<\Symfony\Component\DependencyInjection\Container> $containerClassName */
        $containerClassName = $this->getContainerClassName();

        /** @var ContainerInterface $container */
        $container = new $containerClassName();

        return $container;
    }
1295790
protected function getLatteService()
    {
        $builder = $this->getContainerBuilder();

        return $builder->hasDefinition('nette.latteFactory')
            ? $builder->getDefinition('nette.latteFactory')
            : $builder->getDefinition('nette.latte');
    }
734038
private function createContainer() {
        $container = new Container();

        $container->setDescription($this->getSentence());
        $container->setTitle($this->getTitle());

        return $container;
    }
1132581
public function getServicePluginManager()
	{
	    if($this->servicePluginManager === null){
	        $this->servicePluginManager = new ServicePluginManager();
	        $that = $this;
	
	        $this->servicePluginManager->addInitializer(function ($instance, $serviceManager) use ($that) {
	             
	            $name     = $serviceManager->getCreationInstanceName();
	            $options  = $serviceManager->getCreationInstanceOptions();
	             
	            /**
	             * Configure service
	            */
	            if($options !== null && sizeof($options) &&
	               $instance instanceof Feature\ConfigurableInterface){
	
	                $instance->setConfig($options);
	            }
	        });
	    }
	     
	    return $this->servicePluginManager;
	}
5972
protected function getCommonService() {
		if ($this->service === null) {
			if ($this->arguments === null) {
				$this->service = $this->initService();
			} else {
				$args = $this->normalizeArgs($this->arguments);
				$args = $this->processArgs($args);
				
				$this->service = $this->initService($args);
			}
		}
		
		return $this->service;
	}
1077579
public function newContainer()
    {
        $refl = new ReflectionClass($this);
        $container = $refl->newInstanceArgs(func_get_args());
        $container->classSet($this->class);
        $container->propertyMapper = $this->propertyMapper;
        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);
    }
125282
public function getContainer(){
        if(null === $this->container){
            $factory    = (new ContainerFactory())
                ->append(\Fratily\Kernel\Container\KernelContainer::class)
            ;

            foreach($this->bundles as $bundle){
                if($bundle instanceof Bundle\ContainerRegisterInterface){
                    $bundle->containerRegister($factory);
                }
            }

            $this->container    = $factory->create([
                "kernel"    => $this,
            ]);
        }

        return $this->container;
    }
447940
protected function getContainer()
    {
        @trigger_error(sprintf('The "%s()" method is deprecated and will be removed in DoctrineBundle 2.0.', __METHOD__), E_USER_DEPRECATED);

        if ($this->container === null) {
            $application = $this->getApplication();
            if ($application === null) {
                throw new LogicException('The container cannot be retrieved as the application instance is not yet set.');
            }

            $this->container = $application->getKernel()->getContainer();
        }

        return $this->container;
    }
35354
public function getContainer($service = null)
    {
        return is_null($service) ? ($this->container ?: app()) : ($this->container[$service] ?: app($service));
    }
652504
protected function getContainer(): ContainerInterface
    {
        if (null === $this->container) {
            $app = $this->getApplication();

            if (!$app instanceof Application) {
                throw new \RuntimeException('Sculpin Application not found!');
            }

            $this->container = $app->getKernel()->getContainer();
        }

        return $this->container;
    }