vendor/sonata-project/notification-bundle/src/SonataNotificationBundle.php line 22

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the Sonata Project package.
  5.  *
  6.  * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Sonata\NotificationBundle;
  12. use Sonata\CoreBundle\Form\FormHelper;
  13. use Sonata\NotificationBundle\DependencyInjection\Compiler\NotificationCompilerPass;
  14. use Sonata\NotificationBundle\Form\Type\MessageSerializationType;
  15. use Symfony\Component\DependencyInjection\ContainerBuilder;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. class SonataNotificationBundle extends Bundle
  18. {
  19.     /**
  20.      * {@inheritdoc}
  21.      */
  22.     public function build(ContainerBuilder $container)
  23.     {
  24.         $container->addCompilerPass(new NotificationCompilerPass());
  25.         $this->registerFormMapping();
  26.     }
  27.     /**
  28.      * {@inheritdoc}
  29.      */
  30.     public function boot()
  31.     {
  32.         if (!\defined('AMQP_DEBUG')) {
  33.             //            define('AMQP_DEBUG', $this->container->getParameter('kernel.debug'));
  34.             \define('AMQP_DEBUG'false);
  35.         }
  36.         $this->registerFormMapping();
  37.     }
  38.     /**
  39.      * Register form mapping information.
  40.      */
  41.     public function registerFormMapping()
  42.     {
  43.         FormHelper::registerFormTypeMapping([
  44.             'sonata_notification_api_form_message' => MessageSerializationType::class,
  45.         ]);
  46.     }
  47. }