From 1e7a66d08a174136bf24f678756ea1704767fe70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Fri, 5 Dec 2025 12:54:51 +0100 Subject: [PATCH] Add $feed to getContextList() --- src/FeedContext/Google/Shopping/ProductItemContext.php | 3 ++- src/Message/Handler/GenerateBatchHandler.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FeedContext/Google/Shopping/ProductItemContext.php b/src/FeedContext/Google/Shopping/ProductItemContext.php index 3f2d7b6..5944330 100644 --- a/src/FeedContext/Google/Shopping/ProductItemContext.php +++ b/src/FeedContext/Google/Shopping/ProductItemContext.php @@ -16,6 +16,7 @@ use Setono\SyliusFeedPlugin\Model\BrandAwareInterface; use Setono\SyliusFeedPlugin\Model\ColorAwareInterface; use Setono\SyliusFeedPlugin\Model\ConditionAwareInterface; +use Setono\SyliusFeedPlugin\Model\FeedInterface; use Setono\SyliusFeedPlugin\Model\GtinAwareInterface; use Setono\SyliusFeedPlugin\Model\LocalizedBrandAwareInterface; use Setono\SyliusFeedPlugin\Model\LocalizedColorAwareInterface; @@ -49,7 +50,7 @@ public function __construct( ) { } - public function getContextList(object $product, ChannelInterface $channel, LocaleInterface $locale): ContextListInterface + public function getContextList(object $product, ChannelInterface $channel, LocaleInterface $locale, FeedInterface $feed = null): ContextListInterface { if (!$product instanceof ProductInterface) { throw new InvalidArgumentException(sprintf( diff --git a/src/Message/Handler/GenerateBatchHandler.php b/src/Message/Handler/GenerateBatchHandler.php index 3275e3d..8799f45 100644 --- a/src/Message/Handler/GenerateBatchHandler.php +++ b/src/Message/Handler/GenerateBatchHandler.php @@ -116,7 +116,8 @@ public function __invoke(GenerateBatch $message): void foreach ($items as $item) { try { - $contextList = $itemContext->getContextList($item, $channel, $locale); + /** @phpstan-ignore arguments.count */ + $contextList = $itemContext->getContextList($item, $channel, $locale, $feed); /** @var array|object $context */ foreach ($contextList as $context) {