From 4625a6eaaa86c88cb2d475d1012df46226b88a8d Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 19 Mar 2024 22:40:43 +0100 Subject: [PATCH] Fix arg type for trim with cast --- htdocs/variants/class/ProductCombination.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 4e40c36a553..11c9f1db2e5 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -719,14 +719,14 @@ class ProductCombination * * @param User $user Object user * @param Product $product Parent product - * @param array $combinations Attribute and value combinations. + * @param array> $combinations Attribute and value combinations. * @param array $variations Price and weight variations * @param bool|array $price_var_percent Is the price variation a relative variation? * @param bool|float $forced_pricevar If the price variation is forced * @param bool|float $forced_weightvar If the weight variation is forced * @param bool|string $forced_refvar If the reference is forced * @param string $ref_ext External reference - * @return int Return integer <0 KO, >0 OK + * @return int<-1,1> Return integer <0 KO, >0 OK */ public function createProductCombination(User $user, Product $product, array $combinations, array $variations, $price_var_percent = false, $forced_pricevar = false, $forced_weightvar = false, $forced_refvar = false, $ref_ext = '') { @@ -739,7 +739,7 @@ class ProductCombination $price_impact = array(1 => 0); // init level price impact - $forced_refvar = trim($forced_refvar); + $forced_refvar = trim((string) $forced_refvar); if (!empty($forced_refvar) && $forced_refvar != $product->ref) { $existingProduct = new Product($this->db);