src/Core/Subscriber/NomsSequence/NomsSequenceSubscriber.php line 25

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Bodymed\Webshop\Core\Subscriber\NomsSequence;
  4. use Bodymed\Webshop\Event\NomsSequence\NomsSequenceMinimumThresholdUndercut;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. use Symfony\Component\Messenger\MessageBusInterface;
  7. class NomsSequenceSubscriber implements EventSubscriberInterface
  8. {
  9.     public function __construct(
  10.         private MessageBusInterface $messageBus
  11.     ) {
  12.     }
  13.     public static function getSubscribedEvents(): array
  14.     {
  15.         return [
  16.             NomsSequenceMinimumThresholdUndercut::class => 'onThresholdUndercut',
  17.         ];
  18.     }
  19.     public function onThresholdUndercut(NomsSequenceMinimumThresholdUndercut $event): void
  20.     {
  21.         $this->messageBus->dispatch($event);
  22.     }
  23. }