<?php
declare(strict_types=1);
namespace Hitso\Bundle\ContentBundle;
use Hitso\Bundle\ContentBundle\DependencyInjection\CompilerPass\DoctrineExtensionsPass;
use Hitso\Bundle\ContentBundle\DependencyInjection\CompilerPass\SymfonyCmfPass;
use Hitso\Bundle\ContentBundle\DependencyInjection\ConfigExtensions\ContentSectionExtension;
use Hitso\Bundle\SectionBundle\DependencyInjection\HitsoSectionExtension;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class HitsoContentBundle
*
* @package Hitso\Bundle\ContentBundle
*/
class HitsoContentBundle extends Bundle
{
/**
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container): void
{
parent::build($container);
if ($container->hasExtension('hitso_section')) {
/** @var $extension HitsoSectionExtension */
$extension = $container->getExtension('hitso_section');
$extension->addConfigExtension(new ContentSectionExtension());
}
$container->addCompilerPass(new DoctrineExtensionsPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 256);
$container->addCompilerPass(new SymfonyCmfPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 256);
}
}