Skip to content

Commit cdb7a23

Browse files
committed
Let the StartCatalogPromotionUpdate message implement the AsyncCommandInterface
1 parent 6e147e0 commit cdb7a23

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Message/Command/StartCatalogPromotionUpdate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* This is the message you should dispatch when you want to update catalog promotions
1212
*/
13-
final class StartCatalogPromotionUpdate
13+
final class StartCatalogPromotionUpdate implements AsyncCommandInterface
1414
{
1515
/**
1616
* A list of catalog promotion codes to process. If empty, all catalog promotions will be processed

src/Message/CommandHandler/StartCatalogPromotionUpdateHandler.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Setono\SyliusCatalogPromotionPlugin\Factory\CatalogPromotionUpdateFactoryInterface;
1010
use Setono\SyliusCatalogPromotionPlugin\Message\Command\ProcessCatalogPromotionUpdate;
1111
use Setono\SyliusCatalogPromotionPlugin\Message\Command\StartCatalogPromotionUpdate;
12-
use Setono\SyliusCatalogPromotionPlugin\Model\CatalogPromotionUpdateInterface;
1312
use Setono\SyliusCatalogPromotionPlugin\Repository\CatalogPromotionRepositoryInterface;
1413
use Symfony\Component\Messenger\MessageBusInterface;
1514

@@ -26,7 +25,7 @@ public function __construct(
2625
$this->managerRegistry = $managerRegistry;
2726
}
2827

29-
public function __invoke(StartCatalogPromotionUpdate $message): CatalogPromotionUpdateInterface
28+
public function __invoke(StartCatalogPromotionUpdate $message): void
3029
{
3130
$catalogPromotionUpdate = $this->catalogPromotionUpdateFactory->createFromMessage($message);
3231

@@ -35,7 +34,5 @@ public function __invoke(StartCatalogPromotionUpdate $message): CatalogPromotion
3534
$manager->flush();
3635

3736
$this->commandBus->dispatch(new ProcessCatalogPromotionUpdate($catalogPromotionUpdate));
38-
39-
return $catalogPromotionUpdate;
4037
}
4138
}

0 commit comments

Comments
 (0)