. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Zapoyok\CQRSBundle\Event; use Symfony\Component\Messenger\MessageBusInterface; use Zapoyok\CQRSBundle\DomainModel\DomainEventInterface; final class MessengerEventBus implements EventBusInterface { public function __construct(private MessageBusInterface $eventBus) { } public function notify(DomainEventInterface $event): void { $this->eventBus->dispatch($event); } public function notifyAll(array $domainEvents): void { foreach ($domainEvents as $element) { $this->notify($element); } } }