diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 2e8832e5d8e..385915e280d 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -13770,48 +13770,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modDeplacement.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/modDon.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/modDon.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/modDon.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/modDon.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/modDon.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/modDon.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: 6 - path: ../../../htdocs/core/modules/modDon.class.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 48428e3f326..44ea7b05ed3 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro + * 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 @@ -66,49 +67,50 @@ class modDon extends DolibarrModules $this->config_page_url = array("donation.php@don"); // Constants - $this->const = array(); - $r = 0; - - $this->const[$r][0] = "DON_ADDON_MODEL"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "html_cerfafr"; - $this->const[$r][3] = 'Nom du gestionnaire de generation de recu de dons'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "DONATION_ART200"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = 'Option Française - Eligibilité Art200 du CGI'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "DONATION_ART238"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = 'Option Française - Eligibilité Art238 bis du CGI'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "DONATION_ART978"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = 'Option Française - Eligibilité Art978 du CGI'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "DONATION_MESSAGE"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Thank you"; - $this->const[$r][3] = 'Message affiché sur le récépissé de versements ou dons'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "DONATION_ACCOUNTINGACCOUNT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "758"; - $this->const[$r][3] = 'Compte comptable de remise des versements ou dons'; - $this->const[$r][4] = 0; + $this->const = [ + [ + "DON_ADDON_MODEL", + "chaine", + "html_cerfafr", + 'Nom du gestionnaire de generation de recu de dons', + 0, + ], + [ + "DONATION_ART200", + "yesno", + "0", + 'Option Française - Eligibilité Art200 du CGI', + 0, + ], + [ + "DONATION_ART238", + "yesno", + "0", + 'Option Française - Eligibilité Art238 bis du CGI', + 0, + ], + [ + "DONATION_ART978", + "yesno", + "0", + 'Option Française - Eligibilité Art978 du CGI', + 0, + ], + [ + "DONATION_MESSAGE", + "chaine", + "Thank you", + 'Message affiché sur le récépissé de versements ou dons', + 0, + ], + [ + "DONATION_ACCOUNTINGACCOUNT", + "chaine", + "758", + 'Compte comptable de remise des versements ou dons', + 0, + ], + ]; // Boxes $this->boxes = array();