From 41fccbaac5c8ea0b3ff603438f076fc48ede7b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 16 Mar 2024 08:49:50 +0100 Subject: [PATCH] fix phpstan warnings --- .../compta/sociales/class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/tva/card.php | 4 ++-- htdocs/core/modules/barcode/mod_barcode_product_standard.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 6713da39db7..6d552f245f9 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -186,7 +186,7 @@ class PaymentSocialContribution extends CommonObject $this->fk_charge = (int) $this->fk_charge; } if (isset($this->amount)) { - $this->amount = trim($this->amount); + $this->amount = (float) $this->amount; } if (isset($this->fk_typepaiement)) { $this->fk_typepaiement = (int) $this->fk_typepaiement; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index d3f0886eae9..863eb956f33 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015-2023 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -179,7 +179,7 @@ if (empty($reshook)) { $object->datev = $datev; $object->datep = $datep; - $amount = price2num(GETPOST("amount", 'alpha')); + $amount = (float) price2num(GETPOST("amount", 'alpha')); if ($refund == 1) { $amount = price2num(-1 * $amount); } diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index cb5b273577b..82402b1b9c6 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -161,7 +161,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * * @param ?CommonObject $objproduct Object product (not used) * @param string $type Type of barcode (EAN, ISBN, ...) - * @return string Value if OK, '' if module not configured, <0 if KO + * @return string|int Value if OK, '' if module not configured, <0 if KO */ public function getNextValue($objproduct = null, $type = '') {