fix phpstan

This commit is contained in:
Frédéric France 2025-01-11 09:04:55 +01:00
parent 546bc6ffb9
commit a355dbb660
No known key found for this signature in database
GPG key ID: CE25B0B7B53B9177
3 changed files with 26 additions and 42 deletions

View file

@ -13848,24 +13848,6 @@ parameters:
count: 1
path: ../../../htdocs/core/modules/modPrelevement.class.php
-
message: '#^Property DolibarrModules\:\:\$const \(array\<array\{0\: string, 1\: string, 2\: int\|string, 3\: string, 4\?\: int\<0, 1\>, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\<array\{''PRODUCT_CODEPRODUCT…'', ''chaine''\}\|array\{0\: string, 1\: string, 2\: int\|string, 3\: string, 4\?\: int\<0, 1\>, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/core/modules/modProduct.class.php
-
message: '#^Property DolibarrModules\:\:\$const \(array\<array\{0\: string, 1\: string, 2\: int\|string, 3\: string, 4\?\: int\<0, 1\>, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\<array\{''PRODUCT_PRICE_UNIQ'', ''chaine''\}\|array\{0\: string, 1\: string, 2\: int\|string, 3\: string, 4\?\: int\<0, 1\>, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/core/modules/modProduct.class.php
-
message: '#^Property DolibarrModules\:\:\$const \(array\<array\{0\: string, 1\: string, 2\: int\|string, 3\: string, 4\?\: int\<0, 1\>, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\<array\{0\: string, 1\: string, 2\: int\|string, 3\?\: string, 4\?\: int\<0, 1\>, 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\<array\<array\{rule\: string, file\: string, class\: string, method\: string\}\>\>\) does not accept non\-empty\-array\<array\<array\{rule\: ''accountingaccount''\}\|array\{rule\: ''fetchidfromcodeid'', classfile\: ''/core/class…'', class\: ''Ccountry'', method\: ''fetch'', dict\: ''DictionaryCountry''\}\|array\{rule\: ''fetchidfromcodeorla…'', classfile\: ''/core/class/cunits…'', class\: ''CUnits'', method\: ''fetch'', dict\: ''DictionaryUnits''\}\|array\{rule\: ''fetchidfromcodeorla…'', classfile\: ''/core/class…'', class\: ''CProductNature'', method\: ''fetch'', dict\: ''DictionaryProductNa…''\}\|array\{rule\: ''fetchidfromref'', classfile\: ''/product/stock…'', class\: ''Entrepot'', method\: ''fetch'', element\: ''Warehouse''\}\|array\{rule\: ''fetchscalefromcodeu…'', classfile\: ''/core/class/cunits…'', class\: ''CUnits'', method\: ''fetch'', units\: ''size''\|''surface''\|''volume''\|''weight'', dict\: ''DictionaryMeasuring…''\}\|array\{rule\: string, file\: string, class\: string, method\: string\}\>\>\.$#'
identifier: assign.propertyType

View file

@ -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'],

View file

@ -8,7 +8,8 @@
* Copyright (C) 2014 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2020-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
*
* 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(