feat: refonte de la gestion des événements de création de mangas en remplaçant le MessageBus par un EventDispatcher. Ajout d'un écouteur d'événements MangaCreated pour gérer la récupération des chapitres après la création d'un manga. Implémentation d'un EventDispatcher basé sur Symfony Messenger.

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-07-31 16:11:16 +02:00
parent f1eb97f156
commit bec1572fcb
5 changed files with 53 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Domain\Shared\Domain\Contract;
interface EventDispatcherInterface
{
public function dispatch(object $event): void;
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Domain\Shared\Infrastructure\Messenger;
use App\Domain\Shared\Domain\Contract\EventDispatcherInterface;
use Symfony\Component\Messenger\MessageBusInterface;
class SymfonyMessengerEventDispatcher implements EventDispatcherInterface
{
public function __construct(private MessageBusInterface $bus)
{
}
public function dispatch(object $event): void
{
$this->bus->dispatch($event);
}
}