diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index c06023c7b89..358d3b26b80 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -13848,24 +13848,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modPrelevement.class.php - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 2 - path: ../../../htdocs/core/modules/modProduct.class.php - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' identifier: assign.propertyType diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 65d97c5a1e7..598f3de73fe 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -188,7 +188,7 @@ return [ 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index a2de9b27688..86cf51eb430 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -8,7 +8,8 @@ * Copyright (C) 2014 Christophe Battarel * Copyright (C) 2014 Cedric Gross * Copyright (C) 2020-2021 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,29 +79,30 @@ class modProduct extends DolibarrModules $this->langfiles = array("products", "companies", "stocks", "bills"); // Constants - $this->const = array(); - $r = 0; + $this->const = [ + [ + "PRODUCT_CODEPRODUCT_ADDON", + "chaine", + "mod_codeproduct_leopard", + 'Module to control product codes', + 0, + ], + [ - $this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_codeproduct_leopard"; - $this->const[$r][3] = 'Module to control product codes'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "PRODUCT_PRICE_UNIQ"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "1"; - $this->const[$r][3] = 'pricing rule by default'; - $this->const[$r][4] = 0; - $r++; - - /*$this->const[$r][0] = "PRODUCT_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "standard"; - $this->const[$r][3] = 'Default module for document generation'; - $this->const[$r][4] = 0; - $r++;*/ + "PRODUCT_PRICE_UNIQ", + "chaine", + "1", + 'pricing rule by default', + 0, + ], + /*[ + "PRODUCT_ADDON_PDF", + "chaine", + "standard", + 'Default module for document generation', + 0, + ],*/ + ]; // Boxes $this->boxes = array(