From d5fe4f998a266a38b7c890ea5cec1a9f6ae1cddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 18 Sep 2024 02:45:54 +0200 Subject: [PATCH] fix phpstan (#30989) * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan --- htdocs/adherents/type.php | 2 +- htdocs/admin/taxes.php | 2 +- htdocs/bookmarks/card.php | 3 ++- htdocs/categories/edit.php | 4 ++-- htdocs/comm/mailing/card.php | 6 +++--- htdocs/commande/card.php | 4 ++-- htdocs/compta/bank/card.php | 2 +- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/compta/facture/card-rec.php | 6 +++--- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/paiement_vat.php | 2 +- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/tpl/card_presend.tpl.php | 3 ++- htdocs/core/tpl/massactions_pre.tpl.php | 3 ++- htdocs/cron/card.php | 4 ++-- htdocs/don/card.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/expensereport/payment/payment.php | 2 +- htdocs/fichinter/card-rec.php | 2 +- htdocs/fichinter/card.php | 4 ++-- htdocs/fourn/facture/card-rec.php | 6 +++--- htdocs/fourn/facture/paiement.php | 4 ++-- htdocs/product/canvas/product/tpl/card_create.tpl.php | 3 ++- htdocs/product/canvas/service/tpl/card_create.tpl.php | 3 ++- phpstan.neon.dist | 1 - 27 files changed, 42 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ea47097002e..478402f3018 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -258,7 +258,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); // List of members type if (!$rowid && $action != 'create' && $action != 'edit') { - //print dol_get_fiche_head(''); + //print dol_get_fiche_head([]); $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy, d.duration"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index a333b57d7b1..177402d6036 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -154,7 +154,7 @@ if (isModEnabled('accounting')) { $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('TaxSetup'), $linkback, 'title_setup'); -//print dol_get_fiche_head(null, '', '', -1); +//print dol_get_fiche_head([], '', '', -1); if (empty($mysoc->tva_assuj)) { print $langs->trans("YourCompanyDoesNotUseVAT").'
'; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 85e2fb7daa3..bbe79d12f7a 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2005-2022 Laurent Destailleur * Copyright (C) 2014 Marcos García + * Copyright (C) 2024 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 @@ -166,7 +167,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewBookmark"), '', 'bookmark'); - print dol_get_fiche_head(null, 'bookmark', '', 0, ''); + print dol_get_fiche_head([], 'bookmark', '', 0, ''); print ''; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index b199380b9be..b553728fa1c 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -3,7 +3,7 @@ * Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2024 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 @@ -162,7 +162,7 @@ print ''; print ''; print ''; -print dol_get_fiche_head(''); +print dol_get_fiche_head([]); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 8c5f6af95b7..9bd530507a9 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1231,7 +1231,7 @@ if ($action == 'create') { // aaa print '
'; print load_fiche_titre($langs->trans("TestMailing")); - print dol_get_fiche_head(null, '', '', -1); + print dol_get_fiche_head([], '', '', -1); // Create mail form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -1279,7 +1279,7 @@ if ($action == 'create') { // aaa // Print mail content print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'helpclickable', '', 0, 3, 'emailsubstitionhelp'), 'generic'); - print dol_get_fiche_head('', '', '', -1); + print dol_get_fiche_head([], '', '', -1); print '
'; @@ -1465,7 +1465,7 @@ if ($action == 'create') { // aaa // Print mail content print load_fiche_titre($langs->trans("EMail"), ''.$form->textwithpicto($langs->trans("AvailableVariables").'', $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic'); - print dol_get_fiche_head(null, '', '', -1); + print dol_get_fiche_head([], '', '', -1); print '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8b8e5a8dfb4..36cd50e0b8e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023-2024 Benjamin Falière * Copyright (C) 2024 MDW @@ -1854,7 +1854,7 @@ if ($action == 'create' && $usercancreate) { print ''; } - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); // Call Hook tabContentCreateOrder $parameters = array(); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 89b5718aa8b..3aa8bef3c5a 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -406,7 +406,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print '
'; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 40473b89d92..ac590eba25c 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -410,7 +410,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'object_payment'); - print dol_get_fiche_head('', ''); + print dol_get_fiche_head([], ''); print '
'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 3c83114f5c5..1ad5e3fcc81 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof - * Copyright (C) 2017-2018 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024 MDW * @@ -1008,7 +1008,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(null, '', '', 0); + print dol_get_fiche_head([], '', '', 0); $rowspan = 4; if (isModEnabled('project')) { @@ -1152,7 +1152,7 @@ if ($action == 'create') { print ''.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'

'; - print dol_get_fiche_head(null, '', '', 0); + print dol_get_fiche_head([], '', '', 0); print '
'; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 2469d164f3f..461fbbdd76f 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -178,7 +178,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head('', ''); + print dol_get_fiche_head([], ''); print '
'; diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 44560649f43..92e98a73744 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -178,7 +178,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head('', ''); + print dol_get_fiche_head([], ''); print '
'; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 19068eba161..64f5b860e09 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -228,7 +228,7 @@ class FormTicket print "\n\n"; if ($withdolfichehead) { - print dol_get_fiche_head(null, 'card', '', 0, ''); + print dol_get_fiche_head([], 'card', '', 0, ''); } print 'param["returnurl"] : $_SERVER['PHP_SELF']).'">'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8de311f1134..7e87be21b99 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2510,7 +2510,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di /** * Show tab header of a card * - * @param array,string>> $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped. + * @param array,string>> $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name (document', 'info', 'ldap', ....) * @param string $title Title * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no sepaaration under tab (to start a tab just after), -3=Add tab header but no footer separation diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 6731ceb67e4..89f1146a3ff 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Maxime Nicolas * Copyright (C) 2023 Benjamin GREMBI + * Copyright (C) 2024 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 @@ -128,7 +129,7 @@ if ($action == 'presend') { print '
'; print load_fiche_titre($langs->trans($titreform)); - print dol_get_fiche_head('', '', '', -1); + print dol_get_fiche_head([], '', '', -1); // Create form for email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 2a540fbe8c8..1b285a13dff 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -213,7 +214,7 @@ if ($massaction == 'presend') { print ''; - print dol_get_fiche_head(null, '', ''); + print dol_get_fiche_head([], '', ''); // Create mail form include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index ff37c535252..32d07e05724 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2016 Laurent Destailleur - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -333,7 +333,7 @@ if (($action == "create") || ($action == "edit")) { if ($action == "edit") { print dol_get_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'cron'); } else { - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); } print '
'; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index a824afafea4..3136a8b8c21 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -387,7 +387,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print '
'; print ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ae7dc521d99..25fa25175ac 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -958,7 +958,7 @@ if ($action == 'create') { print ''; } - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print '
'; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 535c84e216f..22f20668a60 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1434,7 +1434,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print '
'; print ''; diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index df91a49f3f7..561712f0865 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -196,7 +196,7 @@ if ($action == 'create' || empty($action)) { print ''; print ''; - print dol_get_fiche_head(null, '0', '', -1); + print dol_get_fiche_head([], '0', '', -1); $linkback = ''; // $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 66bf2f5a94a..aee48993783 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -474,7 +474,7 @@ if ($action == 'create') { } } elseif ($action == 'selsocforcreatefrommodel') { print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'intervention'); - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print ''; print '
'; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 509d6cf8878..97868f05079 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -972,7 +972,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); print '
'; @@ -1126,7 +1126,7 @@ if ($action == 'create') { print ''; // We go back to create action print ''; - print dol_get_fiche_head(''); + print dol_get_fiche_head([]); if (is_object($objectsrc)) { print ''; diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 5526576b6e7..7759e176ea5 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof - * Copyright (C) 2017-2018 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023-2024 Nick Fragoulis * Copyright (C) 2024 MDW * @@ -908,7 +908,7 @@ if ($action == 'create') { print ''; print ''; - print dol_get_fiche_head(null, '', '', 0); + print dol_get_fiche_head([], '', '', 0); $rowspan = 4; if (isModEnabled('project')) { @@ -1056,7 +1056,7 @@ if ($action == 'create') { print ''.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'

'; - print dol_get_fiche_head(null, '', '', 0); + print dol_get_fiche_head([], '', '', 0); print '
'; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index aa645e7b3b9..d78a0da9dd9 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Charlene Benke * Copyright (C) 2022 Udo Tamm * Copyright (C) 2023 Sylvain Legrand @@ -503,7 +503,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; - print dol_get_fiche_head(null); + print dol_get_fiche_head([]); print '
'; diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index c6802081d3b..9d408437f31 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 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 @@ -31,7 +32,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn trans("NewProduct"), '', 'product'); -print dol_get_fiche_head(''); +print dol_get_fiche_head([]); ?> error) ? '' : $object->error), $object->errors); ?> diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index 65d95524d03..aa41af1d35a 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 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 @@ -31,7 +32,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn trans("NewService"), '', 'service'); -print dol_get_fiche_head(''); +print dol_get_fiche_head([]); ?> control->tpl['error'], $this->control->tpl['errors']); ?> diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e04be7043cd..ebdf5be7c91 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -104,7 +104,6 @@ parameters: - '#expects string, bool\|mysqli_result\|resource given.#' - '#( |::)((multi)?selectarray)\(\) expects array#' - '# (reWriteAllMenus|check_authentication) expects array#' - - '# (dol_get_fiche_head) expects array