From 2e0cf05e5505bff88ab716f53eb9c7e4ad2ef3b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 May 2020 21:20:30 +0200 Subject: [PATCH 1/4] phpcs --- htdocs/core/modules/modExpenseReport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index d7a57f25818..ee6e39c591c 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -34,7 +34,7 @@ class modExpenseReport extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param Database $db Database handler + * @param DoliDb $db Database handler */ public function __construct($db) { From c1b4f7ec288f6d504bd6c114d881dceb88fc76a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 May 2020 21:24:46 +0200 Subject: [PATCH 2/4] Fix phpcs --- htdocs/multicurrency/class/multicurrency.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 513c4537358..5426546e927 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -556,8 +556,6 @@ class MultiCurrency extends CommonObject */ public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture') { - global $db; - $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); if ($multicurrency_tx) @@ -592,10 +590,11 @@ class MultiCurrency extends CommonObject } /** - * With free account we can't set source then recalcul all rates to force another source + * With free account we can't set source then recalcul all rates to force another source. + * This modify the array &$TRate. * * @param stdClass $TRate Object containing all currencies rates - * @return -1 if KO, 0 if nothing, 1 if OK + * @return int -1 if KO, 0 if nothing, 1 if OK */ public static function recalculRates(&$TRate) { From 46a362b7d80bdc32074743eebfc8f01b26d4b544 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 May 2020 21:25:47 +0200 Subject: [PATCH 3/4] doxygen --- htdocs/webservices/server_productorservice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index a98d8b2a6cd..61bdd03c023 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -1015,7 +1015,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) * * @param array $authentication Array of authentication information * @param array $id Category id - * @param $lang $lang Force lang + * @param Translate $lang Force lang * @return array Array result */ function getProductsForCategory($authentication, $id, $lang = '') From 60dfcdba000d50c9565e958df1fa5f9190240751 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 May 2020 21:29:30 +0200 Subject: [PATCH 4/4] Fix var type --- htdocs/variants/class/ProductCombination.class.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index b67f56db935..3bb4f7312ee 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -542,18 +542,10 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1"; } //Final weight impact - $weight_impact = $forced_weightvar; - - if ($forced_weightvar === false) { - $weight_impact = 0; - } + $weight_impact = (float) $forced_weightvar; // If false, return 0 //Final price impact - $price_impact = $forced_pricevar; - - if ($forced_pricevar === false) { - $price_impact = 0; - } + $price_impact = (float) $forced_pricevar; // If false, return 0 $newcomb = new ProductCombination($db); $existingCombination = $newcomb->fetchByProductCombination2ValuePairs($product->id, $combinations);