vendor/php-amqplib/rabbitmq-bundle/OldSoundRabbitMqBundle.php line 10

Open in your IDE?
  1. <?php
  2. namespace OldSound\RabbitMqBundle;
  3. use OldSound\RabbitMqBundle\DependencyInjection\Compiler\InjectEventDispatcherPass;
  4. use OldSound\RabbitMqBundle\DependencyInjection\Compiler\RegisterPartsPass;
  5. use Symfony\Component\HttpKernel\Bundle\Bundle;
  6. use Symfony\Component\DependencyInjection\ContainerBuilder;
  7. class OldSoundRabbitMqBundle extends Bundle
  8. {
  9.     public function build(ContainerBuilder $container)
  10.     {
  11.         parent::build($container);
  12.         $container->addCompilerPass(new RegisterPartsPass());
  13.         $container->addCompilerPass(new InjectEventDispatcherPass());
  14.     }
  15.     /**
  16.      * {@inheritDoc}
  17.      */
  18.     public function shutdown()
  19.     {
  20.         parent::shutdown();
  21.         if (!$this->container->hasParameter('old_sound_rabbit_mq.base_amqp')) {
  22.             return;
  23.         }
  24.         $connections $this->container->getParameter('old_sound_rabbit_mq.base_amqp');
  25.         foreach ($connections as $connection) {
  26.             if ($this->container->initialized($connection)) {
  27.                 $this->container->get($connection)->close();
  28.             }
  29.         }
  30.     }
  31. }