From fa703b643eae72a087e5f8097584bb71a507a432 Mon Sep 17 00:00:00 2001 From: Nathaniel Hammond Date: Tue, 17 Oct 2023 14:18:27 +0100 Subject: [PATCH] Readable code --- src/jobs/UpdateProductVariants.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jobs/UpdateProductVariants.php b/src/jobs/UpdateProductVariants.php index 8f1d969..75cd125 100644 --- a/src/jobs/UpdateProductVariants.php +++ b/src/jobs/UpdateProductVariants.php @@ -24,7 +24,9 @@ public function execute($queue): void $api = Plugin::getInstance()->getApi(); /** @var Product|null $product */ - if ($product = Product::find()->shopifyId($this->shopifyProductId)->one()) { + $product = Product::find()->shopifyId($this->shopifyProductId)->one(); + + if ($product) { $variants = $api->getVariantsByProductId($this->shopifyProductId); $product->setVariants($variants); /** @var ProductDataRecord $productData */