From 88adb788d1ec96522abeb1aa7d960b40d4db7f92 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Wed, 11 Sep 2024 18:34:48 +0200 Subject: [PATCH] #19 [CompetitorPrice] fix: missing check null value --- class/competitorprice.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/class/competitorprice.class.php b/class/competitorprice.class.php index 652126c..33addf2 100644 --- a/class/competitorprice.class.php +++ b/class/competitorprice.class.php @@ -560,10 +560,10 @@ public function info(int $id): void /** * Return average of amount_ht * - * @param int $fkProductID ID of product - * @return float $average Average of amount_ht + * @param int $fkProductID ID of product + * @return float|null $average Average of amount_ht */ - public function getAverage(int $fkProductID = 0): float + public function getAverage(int $fkProductID = 0): ?float { $sql = 'SELECT AVG(amount_ht) AS moyenne_amount_ht'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';