From 7fe4ac0d3b87b057a91e7b6520d310444ec3e02d Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Sun, 29 Jun 2025 16:19:54 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20remplacement=20du=20gestionnaire=20?= =?UTF-8?q?de=20commandes=20SymfonySetMangaPreferredSourcesHandler=20par?= =?UTF-8?q?=20SetMangaPreferredSourcesHandler=20pour=20simplifier=20le=20t?= =?UTF-8?q?raitement=20des=20sources=20pr=C3=A9f=C3=A9r=C3=A9es=20des=20ma?= =?UTF-8?q?ngas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...SetMangaPreferredSourcesStateProcessor.php | 6 +++--- ...SymfonySetMangaPreferredSourcesHandler.php | 21 ------------------- 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php index c0a64f2..e584e3a 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/SetMangaPreferredSourcesStateProcessor.php @@ -5,13 +5,13 @@ namespace App\Domain\Scraping\Infrastructure\ApiPlatform\State\Processor; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use App\Domain\Scraping\Application\Command\SetMangaPreferredSources; +use App\Domain\Scraping\Application\CommandHandler\SetMangaPreferredSourcesHandler; use App\Domain\Scraping\Infrastructure\ApiPlatform\Resource\SetMangaPreferredSourcesResource; -use Symfony\Component\Messenger\MessageBusInterface; final class SetMangaPreferredSourcesStateProcessor implements ProcessorInterface { public function __construct( - private readonly MessageBusInterface $commandBus + private readonly SetMangaPreferredSourcesHandler $handler ) { } @@ -26,7 +26,7 @@ final class SetMangaPreferredSourcesStateProcessor implements ProcessorInterface throw new \InvalidArgumentException('Manga ID is required'); } - $this->commandBus->dispatch( + $this->handler->handle( new SetMangaPreferredSources( (string) $mangaId, $data->sourceIds diff --git a/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php b/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php deleted file mode 100644 index c8d93a3..0000000 --- a/src/Domain/Scraping/Infrastructure/CommandHandler/SymfonySetMangaPreferredSourcesHandler.php +++ /dev/null @@ -1,21 +0,0 @@ -handler->handle($command); - } -}