fix phpstan warnings

This commit is contained in:
Frédéric France 2024-03-16 08:49:50 +01:00
parent a48c3215a1
commit 41fccbaac5
3 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -3,7 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* 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);
}

View file

@ -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 = '')
{