vendor/php-flasher/flasher-symfony/FlasherSymfonyBundle.php line 21

  1. <?php
  2. /*
  3.  * This file is part of the PHPFlasher package.
  4.  * (c) Younes KHOUBZA <younes.khoubza@gmail.com>
  5.  */
  6. namespace Flasher\Symfony;
  7. use Flasher\Prime\Container\FlasherContainer;
  8. use Flasher\Prime\Plugin\FlasherPlugin;
  9. use Flasher\Symfony\Container\SymfonyContainer;
  10. use Flasher\Symfony\DependencyInjection\Compiler\EventSubscriberCompilerPass;
  11. use Flasher\Symfony\DependencyInjection\Compiler\FactoryCompilerPass;
  12. use Flasher\Symfony\DependencyInjection\Compiler\FlasherAwareCompilerPass;
  13. use Flasher\Symfony\DependencyInjection\Compiler\PresenterCompilerPass;
  14. use Flasher\Symfony\DependencyInjection\FlasherExtension;
  15. use Flasher\Symfony\Support\Bundle;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. class FlasherSymfonyBundle extends Bundle // Symfony\Component\HttpKernel\Bundle\Bundle
  18. {
  19.     /**
  20.      * {@inheritdoc}
  21.      */
  22.     protected function flasherBuild(ContainerBuilder $container)
  23.     {
  24.         $container->addCompilerPass(new FactoryCompilerPass());
  25.         $container->addCompilerPass(new EventSubscriberCompilerPass());
  26.         $container->addCompilerPass(new PresenterCompilerPass());
  27.         $container->addCompilerPass(new FlasherAwareCompilerPass());
  28.     }
  29.     /**
  30.      * {@inheritdoc}
  31.      */
  32.     public function boot()
  33.     {
  34.         FlasherContainer::init(new SymfonyContainer($this->container));
  35.     }
  36.     /**
  37.      * {@inheritdoc}
  38.      */
  39.     protected function getFlasherContainerExtension()
  40.     {
  41.         return new FlasherExtension();
  42.     }
  43.     /**
  44.      * {@inheritDoc}
  45.      */
  46.     public function createPlugin()
  47.     {
  48.         return new FlasherPlugin();
  49.     }
  50. }