From d6aa69a9500a8e27cc2fa39aed8164414044a3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jan 2025 20:02:11 +0100 Subject: [PATCH] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 24 ------------ htdocs/core/modules/modCommande.class.php | 48 +++++++++++------------ 2 files changed, 24 insertions(+), 48 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index a522eeb4f0d..f05ae2b7d59 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -13698,30 +13698,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modCategorie.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/modCommande.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/modCommande.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/modCommande.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: 3 - path: ../../../htdocs/core/modules/modCommande.class.php - - message: '#^Variable \$user in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index bb6d39c9421..bb9575d28a6 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2020 Ahmad Jamaly Rabub * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-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 @@ -76,29 +76,29 @@ class modCommande extends DolibarrModules $this->langfiles = array('orders', 'bills', 'companies', 'products', 'deliveries', 'sendings'); // Constants - $this->const = array(); - $r = 0; - - $this->const[$r][0] = "COMMANDE_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "eratosthene"; - $this->const[$r][3] = 'Name of PDF model of order'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "COMMANDE_ADDON"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_commande_marbre"; - $this->const[$r][3] = 'Name of numbering numerotation rules of order'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders"; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - + $this->const = [ + [ + "COMMANDE_ADDON_PDF", + "chaine", + "eratosthene", + "Name of PDF model of order", + 0, + ], + [ + "COMMANDE_ADDON", + "chaine", + "mod_commande_marbre", + "Name of numbering numerotation rules of order", + 0, + ], + [ + "COMMANDE_ADDON_PDF_ODT_PATH", + "chaine", + "DOL_DATA_ROOT/doctemplates/orders", + "", + 0, + ], + ]; /*$r++; $this->const[$r][0] = "COMMANDE_DRAFT_WATERMARK"; $this->const[$r][1] = "chaine";