From 704e489270f007aa7b985315103383816b80fe18 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Mon, 10 Feb 2025 18:29:39 +0100 Subject: [PATCH] fix(phpstan): add checks for undefined constant in utils.php A fix has been applied in the src/QUI/TemplateCologne/Utils.php file. A condition has been added to check whether the PRODUCT_FIELD_SHIPPING_TIME constant is defined. If not, the function will return false to prevent any potential errors. --- src/QUI/TemplateCologne/Utils.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/QUI/TemplateCologne/Utils.php b/src/QUI/TemplateCologne/Utils.php index 9f88806..cc49997 100644 --- a/src/QUI/TemplateCologne/Utils.php +++ b/src/QUI/TemplateCologne/Utils.php @@ -611,6 +611,10 @@ public static function getShippingTimeFrontendView(int $productId): bool | QUI\E return false; } + if (!defined('PRODUCT_FIELD_SHIPPING_TIME')) { + return false; + } + try { $ShippingField = $Product->getField(Shipping::PRODUCT_FIELD_SHIPPING_TIME); } catch (\Exception $Exception) { -- GitLab