src/Aqarmap/Bundle/NotificationBundle/EventListener/NotificationSubscriber.php line 25

  1. <?php
  2. namespace Aqarmap\Bundle\NotificationBundle\EventListener;
  3. use Aqarmap\Bundle\NotificationBundle\Events\NotificationSent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class NotificationSubscriber implements EventSubscriberInterface
  6. {
  7. /**
  8. * Returns an array of event names this subscriber wants to listen to.
  9. */
  10. public static function getSubScribedEvents(): array
  11. {
  12. return [
  13. 'notification.sent' => 'notificationSent',
  14. ];
  15. }
  16. /**
  17. * When notification sent.
  18. */
  19. public function notificationSent(NotificationSent $notification): void
  20. {
  21. // you may hook here
  22. }
  23. }