vendor/pec-platform/notification-bundle/src/PecNotificationBundle.php line 26

Open in your IDE?
  1. <?php
  2. /*
  3.  *
  4.  * This file is part of the PEC Platform NotificationBundle.
  5.  *
  6.  * (c) PEC project engineers & consultants
  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 Pec\Bundle\NotificationBundle;
  12. use Pec\Bundle\NotificationBundle\Service\Channel\ChannelInterface;
  13. use Pec\Bundle\NotificationBundle\Service\Channels\ChannelCompiler;
  14. use Pec\Bundle\NotificationBundle\Service\Generator\GeneratorCompiler;
  15. use Pec\Bundle\NotificationBundle\Service\Group\GroupInterface;
  16. use Pec\Bundle\PlatformBundle\PecPlatformBundle;
  17. use Symfony\Component\DependencyInjection\ContainerBuilder;
  18. use Symfony\Component\HttpKernel\Bundle\Bundle;
  19. /**
  20.  * The Notification Bundle allows to notify users about actions being performed on objects via different channels.
  21.  */
  22. class PecNotificationBundle extends Bundle {
  23.     /**
  24.      *
  25.      * {@inheritDoc}
  26.      *
  27.      * @see \Symfony\Component\HttpKernel\Bundle\Bundle::build()
  28.      */
  29.     public function build(ContainerBuilder $container): void {
  30.         $container->addCompilerPass(new ChannelCompiler());
  31.         $container->addCompilerPass(new GeneratorCompiler());
  32.         $container->registerForAutoconfiguration(GroupInterface::class)->addTag(GroupInterface::SERVICE_TAG);
  33.         $container->registerForAutoconfiguration(ChannelInterface::class)->addTag(ChannelInterface::SERVICE_TAG);
  34.     }
  35.     public static function getRequiredBundles(string $env, array &$requiredBundles = []): array {
  36.         if (isset($requiredBundles['PecNotificationBundle'])) {
  37.             return $requiredBundles;
  38.         }
  39.         $requiredBundles['PecNotificationBundle'] = '\Pec\Bundle\NotificationBundle\PecNotificationBundle';
  40.         PecPlatformBundle::getRequiredBundles($env$requiredBundles);
  41.         return $requiredBundles;
  42.     }
  43. }