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;
    }
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;
    }
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 ; }
Get service container.

@return \Berlioz\ServiceContainer\ServiceContainer
@throws \Psr\Container\ContainerExceptionInterface
@throws \Berlioz\Core\Exception\BerliozException
Get service container .