From 2bc320bdaa73efe67a85073724fe738899c6f327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 15 Aug 2024 16:57:15 +0200 Subject: [PATCH] fix ignored phpstan (#30643) * fix ignored phpstan * fix ignored phpstan --------- Co-authored-by: Laurent Destailleur --- htdocs/product/class/product.class.php | 4 ++-- phpstan.neon.dist | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c94575fd048..e71d97c7079 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1337,11 +1337,11 @@ class Product extends CommonObject // Automated compute surface and volume if not filled if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { $this->surface = (float) $this->length * (float) $this->width; - $this->surface_units = measuring_units_squared($this->length_units); + $this->surface_units = measuring_units_squared((int) $this->length_units); } if (empty($this->volume) && !empty($this->surface) && !empty($this->height) && $this->length_units == $this->height_units) { $this->volume = $this->surface * (float) $this->height; - $this->volume_units = measuring_units_cubed($this->height_units); + $this->volume_units = measuring_units_cubed((int) $this->height_units); } if (empty($this->tva_tx)) { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f7eb1d9ef33..4b1b01edc45 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -72,7 +72,6 @@ parameters: - '#expects int\|null#' - '#expects int<-2, 2>, bool given.#' - '#expects int<0, 1>#' - - '#measu.* expects int, string#' - '#color.* expects int, string#' - '#imap.* expects int, string#' - '#dol.* expects int, string#'