From b02fd54610af2ae5314d93ca1b7d008a3b9b8b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 13:45:14 +0100 Subject: [PATCH 01/13] use phpstan latest version --- .github/workflows/phpstan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index ddc3c6ccc4e..616b7756b5e 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -43,7 +43,7 @@ jobs: with: php-version: ${{ matrix.php-version }} coverage: none # disable xdebug, pcov - tools: phpstan:2.0, cs2pr + tools: phpstan, cs2pr extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, mysql, pgsql, sqlite3, ldap, xml, mcrypt From 32b85ca843698a63b76538f7056fc0484f9ee4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 13:48:53 +0100 Subject: [PATCH 02/13] use phpstan latest version --- .github/workflows/phpstan_baseline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan_baseline.yml b/.github/workflows/phpstan_baseline.yml index 9cea77150dd..0b2a46dc65e 100644 --- a/.github/workflows/phpstan_baseline.yml +++ b/.github/workflows/phpstan_baseline.yml @@ -37,7 +37,7 @@ jobs: with: php-version: ${{ env.PHP_VERSION }} coverage: none # disable xdebug, pcov - tools: phpstan:2.0, cs2pr + tools: phpstan, cs2pr extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, mysql, pgsql, sqlite3, ldap, xml, mcrypt env: From 4809aa258562dc5458e8f50d330bbddec61e5b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 14:15:23 +0100 Subject: [PATCH 03/13] use phpstan latest version --- htdocs/accountancy/bookkeeping/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 7dff65c8697..7ccdfc2354d 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Progiseize * Copyright (C) 2024 MDW * @@ -81,7 +81,7 @@ $search_date_export_start = GETPOSTDATE('search_date_export_start', 'getpost'); $search_date_export_end = GETPOSTDATE('search_date_export_end', 'getpostend'); $search_date_validation_start = GETPOSTDATE('search_date_validation_start', 'getpost'); -$search_date_validation_start = GETPOSTDATE('search_date_validation_end', 'getpostend'); +$search_date_validation_end = GETPOSTDATE('search_date_validation_end', 'getpostend'); // Due date start $search_date_due_start_day = GETPOSTINT('search_date_due_start_day'); From 4d604fff55350549076d4804bc3213f0d639224a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 17:53:51 +0100 Subject: [PATCH 04/13] fix --- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/journal/bankjournal.php | 26 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 2439ca577dd..fe2952917f4 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2013-2025 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2025 Frédéric France diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index b133e0399e4..d4489d08187 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy - * Copyright (C) 2017-2024 Frédéric France + * Copyright (C) 2017-2025 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018-2024 Eric Seigne * Copyright (C) 2021 Gauthier VERDOL @@ -771,7 +771,7 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b if (!empty($val['lib'])) { $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " / " : ""); } - if ($tabtype[$key] == 'banktransfert') { + if ($tabtype[$key] === 'banktransfert') { $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); } else { $reflabel .= dol_string_nohtmltag($val['soclib']); @@ -794,24 +794,24 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_creation = $now; - if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice + if ($tabtype[$key] === 'payment') { // If payment is payment of customer invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountcustomer->label; - } elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice + } elseif ($tabtype[$key] === 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountsupplier->label; - } elseif ($tabtype[$key] == 'payment_expensereport') { + } elseif ($tabtype[$key] === 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'); $bookkeeping->label_compte = $accountingaccountexpensereport->label; - } elseif ($tabtype[$key] == 'payment_salary') { + } elseif ($tabtype[$key] === 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $tabuser[$key]['accountancy_code_general']; @@ -822,44 +822,44 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'payment_vat') { + } elseif ($tabtype[$key] === 'payment_vat') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'payment_donation') { + } elseif ($tabtype[$key] === 'payment_donation') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'member') { + } elseif ($tabtype[$key] === 'member') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'payment_loan') { + } elseif ($tabtype[$key] === 'payment_loan') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'payment_various') { + } elseif ($tabtype[$key] === 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] == 'banktransfert') { + } elseif ($tabtype[$key] === 'banktransfert') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; } else { - if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. + if ($tabtype[$key] === 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. // Temporary account $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; From 89918c58e5210734e3a9a1a4c2aaed85701c5b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 18:12:17 +0100 Subject: [PATCH 05/13] fix --- htdocs/accountancy/journal/bankjournal.php | 24 +++++++++++----------- htdocs/compta/bank/class/account.class.php | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d4489d08187..54b6c227ed4 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -771,7 +771,7 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b if (!empty($val['lib'])) { $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " / " : ""); } - if ($tabtype[$key] === 'banktransfert') { + if ($tabtype[$key] == 'banktransfert') { $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); } else { $reflabel .= dol_string_nohtmltag($val['soclib']); @@ -794,24 +794,24 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_creation = $now; - if ($tabtype[$key] === 'payment') { // If payment is payment of customer invoice, we get ref of invoice + if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountcustomer->label; - } elseif ($tabtype[$key] === 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice + } elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountsupplier->label; - } elseif ($tabtype[$key] === 'payment_expensereport') { + } elseif ($tabtype[$key] == 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'); $bookkeeping->label_compte = $accountingaccountexpensereport->label; - } elseif ($tabtype[$key] === 'payment_salary') { + } elseif ($tabtype[$key] == 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $tabuser[$key]['accountancy_code_general']; @@ -822,44 +822,44 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_vat') { + } elseif ($tabtype[$key] == 'payment_vat') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_donation') { + } elseif ($tabtype[$key] == 'payment_donation') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'member') { + } elseif ($tabtype[$key] == 'member') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_loan') { + } elseif ($tabtype[$key] == 'payment_loan') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_various') { + } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'banktransfert') { + } elseif ($tabtype[$key] == 'banktransfert') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; } else { - if ($tabtype[$key] === 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. + if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. // Temporary account $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 994a47ccd73..66b558fb005 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto - * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2022-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -535,7 +535,7 @@ class Account extends CommonObject * @param int $fk_bank To search using bank transaction id * @param int $url_id To search using link to * @param string $type To search using type - * @return int<-1,-1>|array Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error + * @return int<-1,-1>|array Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ public function get_url($fk_bank = 0, $url_id = 0, $type = '') { From 4d405cdda30e9e966f6cf99e461bb82404324b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 18:33:25 +0100 Subject: [PATCH 06/13] fix --- htdocs/adherents/stats/geo.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 207f7f97f3f..103d36e9d13 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -2,7 +2,7 @@ /* Copyright (c) 2004-2011 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Alexandre Spangaro - * 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 @@ -185,8 +185,8 @@ if ($mode) { if ($mode == 'memberbycountry') { $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'code' => $obj->code, - 'nb' => $obj->nb, + 'code' => (string) $obj->code, + 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), 'lastsubscriptiondate' => $db->jdate($obj->lastsubscriptiondate) ); @@ -196,7 +196,7 @@ if ($mode) { 'label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), - 'nb' => $obj->nb, + 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), 'lastsubscriptiondate' => $db->jdate($obj->lastsubscriptiondate) ); @@ -205,7 +205,7 @@ if ($mode) { $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), - 'nb' => $obj->nb, + 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), 'lastsubscriptiondate' => $db->jdate($obj->lastsubscriptiondate) ); @@ -214,7 +214,7 @@ if ($mode) { $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), - 'nb' => $obj->nb, + 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), 'lastsubscriptiondate' => $db->jdate($obj->lastsubscriptiondate) ); From 084caaaf017c972704f0686b18b651391cd4e6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 18:55:35 +0100 Subject: [PATCH 07/13] fix --- htdocs/adherents/stats/geo.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 103d36e9d13..16f58a9e843 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -183,8 +183,9 @@ if ($mode) { while ($i < $num) { $obj = $db->fetch_object($resql); if ($mode == 'memberbycountry') { - $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + $data[] = array( + 'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'code' => (string) $obj->code, 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), @@ -193,8 +194,8 @@ if ($mode) { } if ($mode == 'memberbyregion') { //+ $data[] = array( - 'label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), @@ -202,8 +203,9 @@ if ($mode) { ); } if ($mode == 'memberbystate') { - $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + $data[] = array( + 'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), @@ -211,9 +213,10 @@ if ($mode) { ); } if ($mode == 'memberbytown') { - $data[] = array('label' => (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'label_en' => (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), - 'label2' => ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), + $data[] = array( + 'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label2' => (string) ($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), 'nb' => (int) $obj->nb, 'lastdate' => $db->jdate($obj->lastdate), 'lastsubscriptiondate' => $db->jdate($obj->lastsubscriptiondate) @@ -291,7 +294,7 @@ if (getDolGlobalString("GOOGLE_SHOW_COUNTRY_GRAPH") && $mode == 'memberbycountry foreach ($data as $val) { $valcountry = strtoupper($val['code']); // Should be ISO-3166 code (faster) //$valcountry=ucfirst($val['label_en']); - if ($valcountry == 'Great Britain') { + if ($valcountry === 'Great Britain') { $valcountry = 'United Kingdom'; } // fix case of uk (when we use labels) print "\tdata.setValue(".$i.", 0, \"".$valcountry."\");\n"; From a84f1e3a34021e601c9ab86119533f25c48b799b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 19:06:27 +0100 Subject: [PATCH 08/13] fix --- htdocs/adherents/stats/geo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 16f58a9e843..e64831600ce 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -293,10 +293,10 @@ if (getDolGlobalString("GOOGLE_SHOW_COUNTRY_GRAPH") && $mode == 'memberbycountry $i = 0; foreach ($data as $val) { $valcountry = strtoupper($val['code']); // Should be ISO-3166 code (faster) - //$valcountry=ucfirst($val['label_en']); - if ($valcountry === 'Great Britain') { - $valcountry = 'United Kingdom'; - } // fix case of uk (when we use labels) + // $valcountry = ucfirst($val['label_en']); + // if ($valcountry == 'Great Britain') { + // $valcountry = 'United Kingdom'; + // } // fix case of uk (when we use labels) print "\tdata.setValue(".$i.", 0, \"".$valcountry."\");\n"; print "\tdata.setValue(".$i.", 1, ".$val['nb'].");\n"; // Google's Geomap only supports up to 400 entries From f4739288f617e1518f39c082ace000f1a32b88fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Feb 2025 19:51:46 +0100 Subject: [PATCH 09/13] fix --- htdocs/admin/accountant.php | 6 ++---- htdocs/admin/clicktodial.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 174e71a7516..aa60a5f7def 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,6 +1,6 @@ - * 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 @@ -149,9 +149,7 @@ print ''; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id'); -if ($user->admin) { - print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); -} +print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''."\n"; // State diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index ba4836f815c..1d1b6224841 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent - * 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 @@ -55,7 +55,7 @@ if (!isModEnabled('clicktodial')) { * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue'/* && $user->admin */) { $result1 = dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity); $result2 = dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity); $result3 = dolibarr_set_const($db, "CLICKTODIAL_KEY_FOR_CIDLOOKUP", GETPOST("CLICKTODIAL_KEY_FOR_CIDLOOKUP"), 'chaine', 0, '', $conf->entity); From 16917827a60a12e724b7cb6e029e41c1ba7f0574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 19 Feb 2025 20:09:01 +0100 Subject: [PATCH 10/13] fix by baseline update --- dev/build/phpstan/phpstan-baseline.neon | 840 ++++++++++++++++++------ htdocs/admin/company.php | 6 +- htdocs/admin/const.php | 5 +- 3 files changed, 629 insertions(+), 222 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index f227902c745..cc255af32f0 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -463,7 +463,7 @@ parameters: path: ../../../htdocs/accountancy/class/accountingaccount.class.php - - message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\\}\>, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#' + message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#' identifier: function.impossibleType count: 1 path: ../../../htdocs/accountancy/class/accountingjournal.class.php @@ -765,13 +765,13 @@ parameters: - message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#' identifier: function.alreadyNarrowedType - count: 1 + count: 4 path: ../../../htdocs/accountancy/journal/bankjournal.php - - message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 3 + message: '#^Loose comparison using \=\= between ''unknown'' and ''unknown'' will always evaluate to true\.$#' + identifier: equal.alwaysTrue + count: 1 path: ../../../htdocs/accountancy/journal/bankjournal.php - @@ -897,13 +897,7 @@ parameters: - message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/adherents/class/adherent.class.php - - - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 + count: 2 path: ../../../htdocs/adherents/class/adherent.class.php - @@ -1164,6 +1158,12 @@ parameters: count: 1 path: ../../../htdocs/admin/dict.php + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 1 + path: ../../../htdocs/admin/dict.php + - message: '#^Loose comparison using \!\= between ''create'' and ''edit'' will always evaluate to true\.$#' identifier: notEqual.alwaysTrue @@ -1206,6 +1206,18 @@ parameters: count: 1 path: ../../../htdocs/admin/eventorganization.php + - + message: '#^Loose comparison using \=\= between ''category\:customer''\|''emailtemplate…''\|''product''\|''securekey''\|''thirdparty_type\:'' and ''html'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/admin/eventorganization.php + + - + message: '#^Loose comparison using \=\= between ''category\:customer''\|''emailtemplate…''\|''product''\|''securekey''\|''thirdparty_type\:'' and ''yesno'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/admin/eventorganization.php + - message: '#^Loose comparison using \=\= between 1 and 1 will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -1230,6 +1242,24 @@ parameters: count: 1 path: ../../../htdocs/admin/events.php + - + message: '#^Loose comparison using \=\= between ''DETAILS''\|''MAIL''\|''MAILING''\|''NOTE_PRIVATE''\|''NOTE_PUBLIC''\|''SOCIETE''\|''TICKET''\|''USERSIGN'' and ''PRODUCTDESC'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/admin/fckeditor.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: ../../../htdocs/admin/fckeditor.php + + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 1 + path: ../../../htdocs/admin/fediverse.php + - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined @@ -1248,6 +1278,30 @@ parameters: count: 2 path: ../../../htdocs/admin/hrm.php + - + message: '#^Loose comparison using \=\= between ''integer''\|''varchar'' and ''html'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/admin/hrm.php + + - + message: '#^Loose comparison using \=\= between ''integer''\|''varchar'' and ''product'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/admin/hrm.php + + - + message: '#^Loose comparison using \=\= between ''integer''\|''varchar'' and ''textarea'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/admin/hrm.php + + - + message: '#^Loose comparison using \=\= between ''integer''\|''varchar'' and ''yesno'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/admin/hrm.php + - message: '#^Loose comparison using \=\= between ''varchar'' and ''html'' will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -1344,6 +1398,42 @@ parameters: count: 1 path: ../../../htdocs/admin/knowledgemanagement.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap_contacts.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap_groups.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap_members.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap_members_types.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/ldap_users.php + - message: '#^Parameter \#12 \$localtaxes_array of function calcul_price_total expects array\{string, int\|string, string, int\|string, string, string\}\|array\{string, int\|string, string, string\}, array\{\} given\.$#' identifier: argument.type @@ -1362,12 +1452,24 @@ parameters: count: 1 path: ../../../htdocs/admin/mails.php + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 7 + path: ../../../htdocs/admin/mails.php + - message: '#^Variable \$text in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 4 path: ../../../htdocs/admin/mails.php + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 7 + path: ../../../htdocs/admin/mails_emailing.php + - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -1380,6 +1482,12 @@ parameters: count: 2 path: ../../../htdocs/admin/mails_emailing.php + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 7 + path: ../../../htdocs/admin/mails_passwordreset.php + - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -1431,9 +1539,15 @@ parameters: - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue - count: 1 + count: 2 path: ../../../htdocs/admin/mails_templates.php + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 7 + path: ../../../htdocs/admin/mails_ticket.php + - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -1458,12 +1572,24 @@ parameters: count: 2 path: ../../../htdocs/admin/menus/edit.php + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 1 + path: ../../../htdocs/admin/menus/index.php + - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 2 path: ../../../htdocs/admin/modules.php + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 1 + path: ../../../htdocs/admin/modules.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -1476,6 +1602,12 @@ parameters: count: 1 path: ../../../htdocs/admin/modules.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 5 + path: ../../../htdocs/admin/modules.php + - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -1500,6 +1632,12 @@ parameters: count: 1 path: ../../../htdocs/admin/notification.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 3 + path: ../../../htdocs/admin/notification.php + - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -1530,6 +1668,12 @@ parameters: count: 1 path: ../../../htdocs/admin/oauthlogintokens.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 6 + path: ../../../htdocs/admin/oauthlogintokens.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -1548,6 +1692,18 @@ parameters: count: 2 path: ../../../htdocs/admin/perms.php + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 3 + path: ../../../htdocs/admin/perms.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 11 + path: ../../../htdocs/admin/receiptprinter.php + - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -1590,12 +1746,24 @@ parameters: count: 1 path: ../../../htdocs/admin/system/constall.php + - + message: '#^Loose comparison using \=\= between 0\|1 and 2 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/admin/system/database.php + - message: '#^Variable \$row might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/admin/system/dbtable.php + - + message: '#^Loose comparison using \!\= between '',''\|''\.'' and '' '' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/admin/system/dolibarr.php + - message: '#^Variable \$conffiletoshowshort might not be defined\.$#' identifier: variable.undefined @@ -1680,6 +1848,12 @@ parameters: count: 1 path: ../../../htdocs/admin/system/security.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/system/security.php + - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' identifier: variable.undefined @@ -1752,6 +1926,24 @@ parameters: count: 1 path: ../../../htdocs/admin/tools/export.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/admin/tools/listevents.php + + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 3 + path: ../../../htdocs/admin/tools/listsessions.php + + - + message: '#^Left side of && is always true\.$#' + identifier: booleanAnd.leftAlwaysTrue + count: 1 + path: ../../../htdocs/admin/tools/purge.php + - message: '#^Method Documentation\:\:displayMenu\(\) has parameter \$menu with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -1926,6 +2118,12 @@ parameters: count: 2 path: ../../../htdocs/api/class/api_documents.class.php + - + message: '#^Loose comparison using \!\= between ''adherent''\|''agenda''\|''commande''\|''contact''\|''contrat''\|''expensereport''\|''facture''\|''fichinter''\|''mrp''\|''product''\|''produit''\|''produit\|service''\|''project''\|''project_task''\|''projet''\|''propale''\|''service''\|''supplier_invoice''\|''supplier_order'' and ''ecm'' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/api/class/api_documents.class.php + - message: '#^Method Documents\:\:builddoc\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -2238,6 +2436,42 @@ parameters: count: 1 path: ../../../htdocs/asset/admin/setup.php + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''accountancy_code'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/asset/admin/setup.php + + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''html'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/asset/admin/setup.php + + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''product'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/asset/admin/setup.php + + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''securekey'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/asset/admin/setup.php + + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''textarea'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/asset/admin/setup.php + + - + message: '#^Loose comparison using \=\= between ''accountancy_category''\|''string'' and ''yesno'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/asset/admin/setup.php + - message: '#^Loose comparison using \=\= between 1 and 1 will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -3525,7 +3759,7 @@ parameters: - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue - count: 1 + count: 2 path: ../../../htdocs/comm/action/class/cactioncomm.class.php - @@ -3630,6 +3864,12 @@ parameters: count: 1 path: ../../../htdocs/comm/action/list.php + - + message: '#^Loose comparison using \!\= between ''event\-current''\|''event\-future''\|''event\-past'' and '''' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/comm/action/list.php + - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -3690,12 +3930,36 @@ parameters: count: 1 path: ../../../htdocs/comm/action/pertype.php + - + message: '#^Loose comparison using \=\= between ''show_day''\|''show_month''\|''show_pertype''\|''show_week'' and ''show_year'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/action/pertype.php + + - + message: '#^Loose comparison using \=\= between ''show_month''\|''show_pertype'' and ''show_week'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/action/pertype.php + + - + message: '#^Loose comparison using \=\= between ''show_month''\|''show_pertype''\|''show_week'' and ''show_day'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/action/pertype.php + - message: '#^Loose comparison using \=\= between int\<2, max\> and 1 will always evaluate to false\.$#' identifier: equal.alwaysFalse count: 2 path: ../../../htdocs/comm/action/pertype.php + - + message: '#^Parameter \#1 \$string of function urlencode expects string, int\<0, 23\> given\.$#' + identifier: argument.type + count: 1 + path: ../../../htdocs/comm/action/pertype.php + - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse @@ -3756,6 +4020,12 @@ parameters: count: 1 path: ../../../htdocs/comm/action/peruser.php + - + message: '#^Loose comparison using \=\= between ''show_peruser''\|''show_week'' and ''show_day'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/action/peruser.php + - message: '#^Loose comparison using \=\= between int\<2, max\> and 1 will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -3858,6 +4128,18 @@ parameters: count: 1 path: ../../../htdocs/comm/mailing/card.php + - + message: '#^Loose comparison using \=\= between ''setevenunsubscribe''\|''setreplyto'' and ''setfrom'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/mailing/card.php + + - + message: '#^Loose comparison using \=\= between ''setevenunsubscribe''\|''setreplyto'' and ''settitle'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/mailing/card.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -3870,6 +4152,12 @@ parameters: count: 1 path: ../../../htdocs/comm/mailing/card.php + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 2 + path: ../../../htdocs/comm/mailing/card.php + - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -3972,12 +4260,24 @@ parameters: count: 1 path: ../../../htdocs/comm/propal/card.php + - + message: '#^Loose comparison using \=\= between ''HT''\|null and ''TTC'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/comm/propal/card.php + - message: '#^Property CommonObject\:\:\$fk_project \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../../htdocs/comm/propal/card.php + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: ../../../htdocs/comm/propal/card.php + - message: '#^Variable \$classname might not be defined\.$#' identifier: variable.undefined @@ -4788,12 +5088,24 @@ parameters: count: 1 path: ../../../htdocs/compta/bank/bankentries_list.php + - + message: '#^Loose comparison using \=\= between numeric\-string and '''' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/compta/bank/bankentries_list.php + - message: '#^Negated boolean expression is always false\.$#' identifier: booleanNot.alwaysFalse count: 1 path: ../../../htdocs/compta/bank/bankentries_list.php + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: ../../../htdocs/compta/bank/bankentries_list.php + - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -5004,6 +5316,12 @@ parameters: count: 1 path: ../../../htdocs/compta/bank/line.php + - + message: '#^Ternary operator condition is always true\.$#' + identifier: ternary.alwaysTrue + count: 1 + path: ../../../htdocs/compta/bank/line.php + - message: '#^Variable \$filepath might not be defined\.$#' identifier: variable.undefined @@ -5994,6 +6312,12 @@ parameters: count: 2 path: ../../../htdocs/compta/localtax/class/localtax.class.php + - + message: '#^Loose comparison using \=\= between non\-falsy\-string and 0 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 5 + path: ../../../htdocs/compta/localtax/clients.php + - message: '#^Variable \$arrayofselected might not be defined\.$#' identifier: variable.undefined @@ -6252,6 +6576,12 @@ parameters: count: 2 path: ../../../htdocs/compta/paiement_vat.php + - + message: '#^Ternary operator condition is always true\.$#' + identifier: ternary.alwaysTrue + count: 2 + path: ../../../htdocs/compta/prelevement/card.php + - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -7212,6 +7542,12 @@ parameters: count: 3 path: ../../../htdocs/contact/list.php + - + message: '#^Loose comparison using \!\= between int and '''' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/contact/list.php + - message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -7674,6 +8010,18 @@ parameters: count: 4 path: ../../../htdocs/core/actions_addupdatedelete.inc.php + - + message: '#^Comparison operation "\>" between false and 0 is always false\.$#' + identifier: greater.alwaysFalse + count: 1 + path: ../../../htdocs/core/actions_builddoc.inc.php + + - + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse + count: 1 + path: ../../../htdocs/core/actions_builddoc.inc.php + - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -8034,6 +8382,12 @@ parameters: count: 1 path: ../../../htdocs/core/ajax/editinline.php + - + message: '#^Variable \$upload_dir in empty\(\) always exists and is not falsy\.$#' + identifier: empty.variable + count: 1 + path: ../../../htdocs/core/ajax/flowjs-server.php + - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -8778,6 +9132,12 @@ parameters: count: 1 path: ../../../htdocs/core/class/comment.class.php + - + message: '#^Loose comparison using \!\= between non\-falsy\-string and '''' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/core/class/commondocgenerator.class.php + - message: '#^Property CommonObject\:\:\$element \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -9018,12 +9378,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/commonobject.class.php - - - message: '#^Variable \$newProperty in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 1 - path: ../../../htdocs/core/class/commonobject.class.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -9456,6 +9810,12 @@ parameters: count: 1 path: ../../../htdocs/core/class/dolgraph.class.php + - + message: '#^Loose comparison using \!\= between ''bar''\|''line'' and ''horizontalBar'' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/core/class/dolgraph.class.php + - message: '#^Loose comparison using \=\= between ''line'' and ''horizontalBar'' will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -9702,6 +10062,18 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.form.class.php + - + message: '#^Loose comparison using \=\= between ''formai''\|''formaiforlines''\|''formaiwithlines'' and ''formforlines'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formai.class.php + + - + message: '#^Loose comparison using \=\= between ''formai''\|''formaiforlines''\|''formaiwithlines'' and ''formwithlines'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formai.class.php + - message: '#^Variable \$select_encoder might not be defined\.$#' identifier: variable.undefined @@ -9780,12 +10152,30 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formfile.class.php + - + message: '#^Loose comparison using \=\= between 0\|2\|3\|6 and 1 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formfile.class.php + + - + message: '#^Loose comparison using \=\= between 0\|2\|3\|6 and 5 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formfile.class.php + - message: '#^Property CommonObject\:\:\$id \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../../htdocs/core/class/html.formfile.class.php + - + message: '#^Result of \|\| is always false\.$#' + identifier: booleanOr.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formfile.class.php + - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -9810,6 +10200,18 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formmail.class.php + - + message: '#^Loose comparison using \=\= between ''formemail''\|''formemailforlines''\|''formemailwithlines'' and ''formforlines'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formmail.class.php + + - + message: '#^Loose comparison using \=\= between ''formemail''\|''formemailforlines''\|''formemailwithlines'' and ''formwithlines'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/core/class/html.formmail.class.php + - message: '#^Property FormMail\:\:\$ckeditortoolbar \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -9889,7 +10291,7 @@ parameters: path: ../../../htdocs/core/class/html.formticket.class.php - - message: '#^Call to function is_array\(\) with list\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with list will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 2 path: ../../../htdocs/core/class/html.formticket.class.php @@ -10905,7 +11307,7 @@ parameters: - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue - count: 2 + count: 3 path: ../../../htdocs/core/lib/functions.lib.php - @@ -10926,6 +11328,12 @@ parameters: count: 1 path: ../../../htdocs/core/lib/functions.lib.php + - + message: '#^Loose comparison using \=\= between 1\|2 and 4 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/core/lib/functions.lib.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -11142,6 +11550,12 @@ parameters: count: 1 path: ../../../htdocs/core/lib/order.lib.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 11 + path: ../../../htdocs/core/lib/pdf.lib.php + - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -11370,36 +11784,12 @@ parameters: count: 1 path: ../../../htdocs/core/menus/standard/auguria.lib.php - - - message: '#^Offset ''level'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 1 - path: ../../../htdocs/core/menus/standard/auguria.lib.php - - - - message: '#^Offset ''mainmenu'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 2 - path: ../../../htdocs/core/menus/standard/auguria.lib.php - - - - message: '#^Offset ''prefix'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 2 - path: ../../../htdocs/core/menus/standard/auguria.lib.php - - message: '#^Parameter \#8 \$menuval of function print_text_menu_entry_auguria expects array\{\}\|array\{rowid\: string, fk_menu\: string, langs\: string, enabled\: int\<0, 2\>, type\: string, fk_mainmenu\: string, fk_leftmenu\: string, url\: string, \.\.\.\}, array\{url\: string, titre\: string, enabled\: int\<0, 2\>, target\: string, mainmenu\: string, leftmenu\: string, position\: int, level\?\: int, \.\.\.\} given\.$#' identifier: argument.type count: 1 path: ../../../htdocs/core/menus/standard/auguria.lib.php - - - message: '#^Result of && is always false\.$#' - identifier: booleanAnd.alwaysFalse - count: 1 - path: ../../../htdocs/core/menus/standard/auguria.lib.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -11430,36 +11820,12 @@ parameters: count: 4 path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - message: '#^Offset ''level'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Offset ''mainmenu'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 2 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Offset ''prefix'' on array\{url\: mixed\} in empty\(\) does not exist\.$#' - identifier: empty.offset - count: 2 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - message: '#^Parameter \#8 \$menuval of function print_text_menu_entry expects array\{\}\|array\{rowid\: string, fk_menu\: string, langs\: string, enabled\: int\<0, 2\>, type\: string, fk_mainmenu\: string, fk_leftmenu\: string, url\: string, \.\.\.\}, array\{url\: string, titre\: string, enabled\: int\<0, 2\>, target\: string, mainmenu\: string, leftmenu\: string, position\: int, level\?\: int, \.\.\.\} given\.$#' identifier: argument.type count: 1 path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - message: '#^Result of && is always false\.$#' - identifier: booleanAnd.alwaysFalse - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -11934,6 +12300,24 @@ parameters: count: 2 path: ../../../htdocs/core/modules/dons/html_cerfafr.modules.php + - + message: '#^Loose comparison using \!\= between int\\|int\<1, max\> and '''' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 6 + path: ../../../htdocs/core/modules/dons/html_cerfafr.modules.php + + - + message: '#^Loose comparison using \=\= between int and '''' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/core/modules/dons/html_cerfafr.modules.php + + - + message: '#^Loose comparison using \=\= between int\\|int\<1, max\> and '''' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 4 + path: ../../../htdocs/core/modules/dons/html_cerfafr.modules.php + - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -15639,7 +16023,7 @@ parameters: - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue - count: 1 + count: 5 path: ../../../htdocs/expedition/card.php - @@ -15936,6 +16320,18 @@ parameters: count: 1 path: ../../../htdocs/expedition/dispatch.php + - + message: '#^Loose comparison using \=\= between ''commande''\|null and ''propal'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/expedition/dispatch.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 4 + path: ../../../htdocs/expedition/dispatch.php + - message: '#^Variable \$objectsrc might not be defined\.$#' identifier: variable.undefined @@ -17484,6 +17880,12 @@ parameters: count: 1 path: ../../../htdocs/fourn/commande/document.php + - + message: '#^Loose comparison using \=\= between 0\|1\|2\|3\|4\|5\|9 and 7 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/fourn/commande/index.php + - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -18744,6 +19146,12 @@ parameters: count: 12 path: ../../../htdocs/imports/import.php + - + message: '#^Loose comparison using \=\= between ''guess''\|''session'' and ''orderoftargets'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/imports/import.php + - message: '#^Loose comparison using \=\= between ''session'' and ''session'' will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -19416,6 +19824,12 @@ parameters: count: 1 path: ../../../htdocs/main.inc.php + - + message: '#^Loose comparison using \=\= between ''''\|''0'' and 1 will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/main.inc.php + - message: '#^Negated boolean expression is always false\.$#' identifier: booleanNot.alwaysFalse @@ -19686,6 +20100,12 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/template/admin/myobject_extrafields.php + - + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse + count: 1 + path: ../../../htdocs/modulebuilder/template/admin/setup.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -20274,6 +20694,12 @@ parameters: count: 1 path: ../../../htdocs/mrp/class/moline.class.php + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 1 + path: ../../../htdocs/mrp/index.php + - message: '#^Variable \$badgeStatus0 might not be defined\.$#' identifier: variable.undefined @@ -20487,13 +20913,7 @@ parameters: - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue - count: 3 - path: ../../../htdocs/multicurrency/multicurrency_rate.php - - - - message: '#^Variable \$arrayofmassactions might not be defined\.$#' - identifier: variable.undefined - count: 1 + count: 4 path: ../../../htdocs/multicurrency/multicurrency_rate.php - @@ -20826,6 +21246,12 @@ parameters: count: 2 path: ../../../htdocs/partnership/partnership_list.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/paybox/admin/paybox.php + - message: '#^Variable \$IBS_DEVISE in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -20844,6 +21270,12 @@ parameters: count: 1 path: ../../../htdocs/paybox/lib/paybox.lib.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/paypal/admin/paypal.php + - message: '#^Comparison operation "\<" between \-1 and 0 is always true\.$#' identifier: smaller.alwaysTrue @@ -20868,6 +21300,12 @@ parameters: count: 1 path: ../../../htdocs/paypal/lib/paypal.lib.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 6 + path: ../../../htdocs/printing/admin/printing.php + - message: '#^Variable \$classfile might not be defined\.$#' identifier: variable.undefined @@ -21726,12 +22164,42 @@ parameters: count: 1 path: ../../../htdocs/product/stats/bom.php + - + message: '#^Loose comparison using \=\= between ''contracts''\|''invoices''\|''invoicessuppliers''\|''mrp''\|''orders''\|''orderssuppliers''\|''propal''\|''proposalssuppliers'' and ''invoices_suppliers'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/product/stats/card.php + + - + message: '#^Loose comparison using \=\= between ''contracts''\|''invoices''\|''invoicessuppliers''\|''mrp''\|''orders''\|''orderssuppliers''\|''propal''\|''proposalssuppliers'' and ''order'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/product/stats/card.php + + - + message: '#^Loose comparison using \=\= between ''contracts''\|''invoices''\|''invoicessuppliers''\|''mrp''\|''orders''\|''orderssuppliers''\|''propal''\|''proposalssuppliers'' and ''orders_suppliers'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/product/stats/card.php + + - + message: '#^Loose comparison using \=\= between ''contracts''\|''invoices''\|''invoicessuppliers''\|''mrp''\|''orders''\|''orderssuppliers''\|''propal''\|''proposalssuppliers'' and ''proposals_suppliers'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/product/stats/card.php + - message: '#^Negated boolean expression is always false\.$#' identifier: booleanNot.alwaysFalse count: 2 path: ../../../htdocs/product/stats/card.php + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 4 + path: ../../../htdocs/product/stats/card.php + - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -22662,6 +23130,12 @@ parameters: count: 1 path: ../../../htdocs/projet/card.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/projet/card.php + - message: '#^Variable \$morecss might not be defined\.$#' identifier: variable.undefined @@ -23268,6 +23742,12 @@ parameters: count: 5 path: ../../../htdocs/projet/tasks/list.php + - + message: '#^Loose comparison using \=\= between ''0''\|array\{\} and '''' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/projet/tasks/list.php + - message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -24510,12 +24990,30 @@ parameters: count: 2 path: ../../../htdocs/reception/card.php + - + message: '#^Loose comparison using \=\= between ''''\|''CommandeFournisseur'' and ''commande'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/reception/card.php + + - + message: '#^Loose comparison using \=\= between ''''\|''CommandeFournisseur'' and ''propal'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 2 + path: ../../../htdocs/reception/card.php + - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue count: 1 path: ../../../htdocs/reception/card.php + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 8 + path: ../../../htdocs/reception/card.php + - message: '#^Variable \$extrafields in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -24762,6 +25260,24 @@ parameters: count: 1 path: ../../../htdocs/reception/dispatch.php + - + message: '#^Loose comparison using \=\= between ''''\|''CommandeFournisseur'' and ''commande'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/reception/dispatch.php + + - + message: '#^Loose comparison using \=\= between ''''\|''CommandeFournisseur'' and ''propal'' will always evaluate to false\.$#' + identifier: equal.alwaysFalse + count: 1 + path: ../../../htdocs/reception/dispatch.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 4 + path: ../../../htdocs/reception/dispatch.php + - message: '#^Variable \$objectsrc might not be defined\.$#' identifier: variable.undefined @@ -25074,6 +25590,12 @@ parameters: count: 1 path: ../../../htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 2 + path: ../../../htdocs/recruitment/index.php + - message: '#^Variable \$badgeStatus0 might not be defined\.$#' identifier: variable.undefined @@ -26016,6 +26538,12 @@ parameters: count: 1 path: ../../../htdocs/societe/class/societe.class.php + - + message: '#^Loose comparison using \!\= between ''email''\|''mobile'' and ''poste'' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 2 + path: ../../../htdocs/societe/class/societe.class.php + - message: '#^Method Societe\:\:getContacts\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -26088,6 +26616,12 @@ parameters: count: 1 path: ../../../htdocs/societe/class/societe.class.php + - + message: '#^Ternary operator condition is always true\.$#' + identifier: ternary.alwaysTrue + count: 1 + path: ../../../htdocs/societe/class/societe.class.php + - message: '#^Loose comparison using \=\= between 0 and 1 will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -26256,6 +26790,12 @@ parameters: count: 4 path: ../../../htdocs/societe/website.php + - + message: '#^Right side of && is always true\.$#' + identifier: booleanAnd.rightAlwaysTrue + count: 1 + path: ../../../htdocs/stripe/admin/stripe.php + - message: '#^Call to function is_object\(\) with Facture will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -26700,6 +27240,12 @@ parameters: count: 1 path: ../../../htdocs/takepos/printbox.php + - + message: '#^Loose comparison using \!\= between mixed and '''' will always evaluate to true\.$#' + identifier: notEqual.alwaysTrue + count: 1 + path: ../../../htdocs/takepos/receipt.php + - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -26724,54 +27270,6 @@ parameters: count: 3 path: ../../../htdocs/theme/eldy/btn.inc.php - - - message: '#^Variable \$nbtopmenuentries might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/theme/eldy/btn.inc.php - - - - message: '#^Variable \$colorbackhmenu1 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$colorbacklinepair1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$colortextbackhmenu might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$colortextlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$disableimages might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$left might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - - - message: '#^Variable \$right might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/dropdown.inc.php - - message: '#^Variable \$theme might not be defined\.$#' identifier: variable.undefined @@ -26790,48 +27288,12 @@ parameters: count: 1 path: ../../../htdocs/theme/eldy/info-box.inc.php - - - message: '#^Variable \$topMenuFontSize might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/main_menu_fa_icons.inc.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue count: 1 path: ../../../htdocs/theme/eldy/manifest.json.php - - - message: '#^Variable \$badgeDanger might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/theme/eldy/progress.inc.php - - - - message: '#^Variable \$badgeSuccess might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/progress.inc.php - - - - message: '#^Variable \$badgeWarning might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/progress.inc.php - - - - message: '#^Variable \$colorblind_deuteranopes_badgeDanger might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/progress.inc.php - - - - message: '#^Variable \$colorblind_deuteranopes_badgeSuccess might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/eldy/progress.inc.php - - message: '#^Variable \$menumanager might not be defined\.$#' identifier: variable.undefined @@ -26868,54 +27330,6 @@ parameters: count: 1 path: ../../../htdocs/theme/md/btn.inc.php - - - message: '#^Variable \$colorbackhmenu1 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$colorbacklinepair1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$colortextbackhmenu might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$colortextlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$disableimages might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$left might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$right might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/theme/md/dropdown.inc.php - - - - message: '#^Variable \$path might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/flags-sprite.inc.php - - message: '#^Variable \$left might not be defined\.$#' identifier: variable.undefined @@ -26934,12 +27348,6 @@ parameters: count: 1 path: ../../../htdocs/theme/md/manifest.json.php - - - message: '#^Variable \$path might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/theme/md/progress.inc.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 68856768f08..1e2757154a5 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -7,7 +7,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -467,9 +467,7 @@ print ''."\n"; print ''; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country($mysoc->country_id, 'country_id', '', 0); -if ($user->admin) { - print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); -} +print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''."\n"; // Address diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index ab10c0d39ea..cc29686228d 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent - * 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 @@ -260,7 +260,8 @@ $sql .= ", tms"; $sql .= ", entity"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".$conf->entity).")"; -if ((empty($user->entity) || $user->admin) && $debug) { +if ((empty($user->entity)/* || $user->admin */) && $debug) { + // empty } elseif (!GETPOST('visible') || GETPOST('visible') != 'all') { // to force for superadmin to debug $sql .= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits From b3df1bb62de70b981f5ae33af05761bb6fdf2051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 19 Feb 2025 20:21:30 +0100 Subject: [PATCH 11/13] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/admin/dict.php | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index cc255af32f0..b03cca30ae6 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -1158,12 +1158,6 @@ parameters: count: 1 path: ../../../htdocs/admin/dict.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../htdocs/admin/dict.php - - message: '#^Loose comparison using \!\= between ''create'' and ''edit'' will always evaluate to true\.$#' identifier: notEqual.alwaysTrue diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index cd052b7dde0..6200addb6c1 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2418,7 +2418,7 @@ if ($id > 0) { $valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->$value); } elseif (!empty($obj->code_iso) && $value == 'label' && $tabname[$id] == 'c_currencies') { $key = $langs->trans("Currency".strtoupper($obj->code_iso)); - $valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->$value); + $valuetoshow = (/* $obj->code_iso && */ $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->$value); } elseif ($value == 'libelle' && $tabname[$id] == 'c_typent') { $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value); From 3b47fa900bd05af2122e114cae72a0c7f12b5d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 19 Feb 2025 20:25:03 +0100 Subject: [PATCH 12/13] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/admin/mails_emailing.php | 16 ++++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index b03cca30ae6..d15ee623d3f 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -1458,12 +1458,6 @@ parameters: count: 4 path: ../../../htdocs/admin/mails.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 7 - path: ../../../htdocs/admin/mails_emailing.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index e91f1058b3d..df3946e1bf7 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -3,7 +3,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2016 Jonathan TISSEAU - * 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 @@ -362,7 +362,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; @@ -395,7 +395,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { print ''; print ''; print '' . $langs->trans("SeeLocalSendMailSetup") . ''; @@ -427,7 +427,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { print ''; print ''; print '' . $langs->trans("SeeLocalSendMailSetup") . ''; @@ -444,7 +444,7 @@ if ($action == 'edit') { if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING'; - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { // Note: Default value for MAIN_MAIL_SMTPS_AUTH_TYPE if not defined is 'LOGIN' (but login/pass may be empty and they won't be provided in such a case) print ' '; print ''; @@ -473,7 +473,7 @@ if ($action == 'edit') { $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_ID") . ''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -488,7 +488,7 @@ if ($action == 'edit') { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_PW") . ''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -503,7 +503,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only - if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || (/* $user->admin && */ !$user->entity)) { // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')); } else { From bdb648e6cf64f45a97aafd12e46ef1caff31aefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 19 Feb 2025 20:28:18 +0100 Subject: [PATCH 13/13] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 36 ------------------------- htdocs/admin/ldap.php | 4 +-- htdocs/admin/ldap_contacts.php | 4 +-- htdocs/admin/ldap_groups.php | 4 +-- htdocs/admin/ldap_members.php | 4 +-- htdocs/admin/ldap_members_types.php | 4 +-- htdocs/admin/ldap_users.php | 4 +-- 7 files changed, 12 insertions(+), 48 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index d15ee623d3f..33207211b2b 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -1392,42 +1392,6 @@ parameters: count: 1 path: ../../../htdocs/admin/knowledgemanagement.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap_contacts.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap_groups.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap_members.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap_members_types.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 1 - path: ../../../htdocs/admin/ldap_users.php - - message: '#^Parameter \#12 \$localtaxes_array of function calcul_price_total expects array\{string, int\|string, string, int\|string, string, string\}\|array\{string, int\|string, string, string\}, array\{\} given\.$#' identifier: argument.type diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 2fb95d6e572..7493ce50b23 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2021 Regis Houssin * Copyright (C) 2006-2020 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent - * 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 @@ -66,7 +66,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($action == 'setvalue' && $user->admin) { + if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin(); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index ddb19e167eb..2a73add4446 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent - * 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 @@ -55,7 +55,7 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin(); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index ac189dafe47..397f3e9997d 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -6,7 +6,7 @@ * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent * 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 @@ -58,7 +58,7 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin(); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 12d6039ed96..8d0c2002815 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006-2008 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent - * 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 @@ -56,7 +56,7 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin(); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index ebf2a10548b..f2872e743fd 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent - * 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 @@ -57,7 +57,7 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin(); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index af24762a8a9..d59654a0469 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -7,7 +7,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2019 Abbes Bahfir * 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 @@ -58,7 +58,7 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'setvalue' && $user->admin) { +if ($action == 'setvalue' /* && $user->admin */) { $error = 0; $db->begin();