qual: phpstan for htdocs/product/class/product.class.php

htdocs/product/class/product.class.php	2449	Property Product::$price (float) does not accept string.
htdocs/product/class/product.class.php	2450	Property Product::$price_ttc (float) does not accept string.
htdocs/product/class/product.class.php	2909	Property Product::$price_ttc (float) does not accept string.
htdocs/product/class/product.class.php	5077	Method Product::isVariant() should return int but returns false.
htdocs/product/class/product.class.php	5079	Method Product::isVariant() should return int but returns true.
htdocs/product/class/product.class.php	5085	Method Product::isVariant() should return int but returns false.
htdocs/product/class/product.class.php	5608	Method Product::getLibFinished() should return string but returns int.
This commit is contained in:
thibdrev 2024-01-28 17:53:16 +01:00 committed by GitHub
parent 38f897609d
commit 044395bda6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2358,7 +2358,7 @@ class Product extends CommonObject
$price_min_ttc = 0;
}
} else {
$price = price2num($newprice, 'MU');
$price = (float) price2num($newprice, 'MU');
$price_ttc = ($newnpr != 1) ? (float) price2num($newprice) * (1 + ($newvat / 100)) : $price;
$price_ttc = price2num($price_ttc, 'MU');
@ -2905,8 +2905,8 @@ class Product extends CommonObject
if ($price_result >= 0) {
$this->price = $price_result;
// Calculate the VAT
$this->price_ttc = price2num($this->price) * (1 + ($this->tva_tx / 100));
$this->price_ttc = price2num($this->price_ttc, 'MU');
$this->price_ttc = (float) price2num($this->price) * (1 + ($this->tva_tx / 100));
$this->price_ttc = (float) price2num($this->price_ttc, 'MU');
}
}
@ -5062,7 +5062,7 @@ class Product extends CommonObject
/**
* Return if loaded product is a variant
*
* @return int
* @return bool|int Return true if the product is a variant, false if not, -1 if error
*/
public function isVariant()
{
@ -5587,7 +5587,7 @@ class Product extends CommonObject
/**
* Retour label of nature of product
*
* @return string Label
* @return string|int Return label or ''. -1 if error
*/
public function getLibFinished()
{