src/Hitso/Bundle/ContentBundle/HitsoContentBundle.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Hitso\Bundle\ContentBundle;
  4. use Hitso\Bundle\ContentBundle\DependencyInjection\CompilerPass\DoctrineExtensionsPass;
  5. use Hitso\Bundle\ContentBundle\DependencyInjection\CompilerPass\SymfonyCmfPass;
  6. use Hitso\Bundle\ContentBundle\DependencyInjection\ConfigExtensions\ContentSectionExtension;
  7. use Hitso\Bundle\SectionBundle\DependencyInjection\HitsoSectionExtension;
  8. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  9. use Symfony\Component\DependencyInjection\ContainerBuilder;
  10. use Symfony\Component\HttpKernel\Bundle\Bundle;
  11. /**
  12.  * Class HitsoContentBundle
  13.  *
  14.  * @package Hitso\Bundle\ContentBundle
  15.  */
  16. class HitsoContentBundle extends Bundle
  17. {
  18.     /**
  19.      * @param ContainerBuilder $container
  20.      */
  21.     public function build(ContainerBuilder $container): void
  22.     {
  23.         parent::build($container);
  24.         if ($container->hasExtension('hitso_section')) {
  25.             /** @var $extension HitsoSectionExtension */
  26.             $extension $container->getExtension('hitso_section');
  27.             $extension->addConfigExtension(new ContentSectionExtension());
  28.         }
  29.         $container->addCompilerPass(new DoctrineExtensionsPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION256);
  30.         $container->addCompilerPass(new SymfonyCmfPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION256);
  31.     }
  32. }