diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 74a1f0c4cfe..55df5382b7f 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -7,6 +7,7 @@ * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2020 Josep Lluís Amador * 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 @@ -580,7 +581,7 @@ if ($type == Categorie::TYPE_PRODUCT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'products'); + print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'products'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -667,7 +668,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -756,7 +757,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -847,7 +848,7 @@ if ($type == Categorie::TYPE_MEMBER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'members'); + print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'members'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -940,7 +941,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'contact'); + print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'contact'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1030,7 +1031,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'bank'); + print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'bank'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1120,7 +1121,7 @@ if ($type == Categorie::TYPE_PROJECT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'project'); + print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'project'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1204,7 +1205,7 @@ if ($type == Categorie::TYPE_USER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'user'); + print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'user'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1275,7 +1276,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'stock'); + print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'stock'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1363,7 +1364,7 @@ if ($type == Categorie::TYPE_TICKET) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'ticket'); + print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'ticket'); accessforbidden("NotEnoughPermissions", 0, 0); } } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1ee52af1ccc..0c6a2f89113 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Florian HENRY * Copyright (C) 2024 MDW * @@ -508,7 +508,7 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda' $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction); } -$num = ''; +$num = 0; print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b0639ec207c..0aa6fc47f66 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,10 +1,10 @@ - * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2015-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 18914beba62..4a89aaf8f6b 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -42,14 +42,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; * @param integer $paymentdateafter Payment after date (must includes hour) * @param integer $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output - * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template + * @param string $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template * @param string $filesuffix Suffix to add into file name of generated PDF * @param string $paymentbankid Only if payment on this bank account id * @param array $thirdpartiesid List of thirdparties id when using filter=excludethirdpartiesid or filter=onlythirdpartiesid * @param string $fileprefix Prefix to add into filename of generated PDF * @return int Error code */ -function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = 0, $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') +function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = '', $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') { $sql = "SELECT DISTINCT f.rowid, f.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4096253a94d..ba3988492e1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1380,14 +1380,14 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ /** * Show linked objects for PDF generation * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param object $object Object * @param Translate $outputlangs Object lang * @param int $posx X * @param int $posy Y * @param float $w Width of cells. If 0, they extend up to the right margin of the page. * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param int $align Align + * @param string $align Align * @param string $default_font_size Font size * @return float The Y PDF position */ diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 520b0a7155a..05c5dec246a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -257,7 +257,7 @@ print ''; print ''; $title = $langs->trans("MenuConfCP"); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, '', '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, 0, '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 587a3bb1337..0d6a134737b 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-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 @@ -632,7 +632,7 @@ if ($action != "create" && $action != "edit") { $massactionbutton = ""; //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendSkilldetRef"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 9ab22172df3..fb13dbb86e0 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -4361,7 +4361,7 @@ if ($module == 'initmodule') { $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj)); $nbOfProperties = count($reflectorpropdefault['fields']); - print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', '', $nbOfProperties, '', 0, $newproperty, '', '', 0, 0, 1); + print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $nbOfProperties, '', 0, $newproperty, '', 0, 0, 0, 1); //var_dump($reflectorpropdefault);exit; print ''."\n"; @@ -4802,7 +4802,7 @@ if ($module == 'initmodule') { $newdict = dolGetButtonTitle($langs->trans('NewDictionary'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.urlencode($module).'&tabdic=newdictionary'); - print_barre_liste($langs->trans("ListOfDictionariesEntries"), '', $_SERVER["PHP_SELF"], '', '', '', '', '', '', '', 0, $newdict, '', '', 0, 0, 1); + print_barre_liste($langs->trans("ListOfDictionariesEntries"), '', $_SERVER["PHP_SELF"], '', '', '', '', 0, '', '', 0, $newdict, '', 0, 0, 0, 1); if ($tabdic != 'newdictionary') { print '
'; diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index 6cc94d4d6f3..25bba034e17 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * 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 @@ -29,7 +30,7 @@ /** * Create a redirect form to paybox form * - * @param int $PRICE Price + * @param float $PRICE Price * @param string $CURRENCY Currency * @param string $EMAIL EMail * @param string $urlok Url to go back if payment is OK diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 177c4ae64c0..810ad196576 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -6,6 +6,7 @@ * Copyright (C) 2018-2021 Thibault FOUCART * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Dorian Vabre + * 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 @@ -465,7 +466,7 @@ if ($action == 'dopayment') { dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php'; - print_paybox_redirect($PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); + print_paybox_redirect((float) $PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); session_destroy(); exit; diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 14bc13a2f4f..3ccacf0a371 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -1,12 +1,13 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Florain Henry + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Florain Henry * * 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 @@ -177,7 +178,7 @@ if ($object->id > 0) { $param .= '&limit='.((int) $limit); } - print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', '', '', 0, 1, 1); + print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, '', '', 0, 1, 1); // List of all actions $filters = array(); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 33be2e16802..b4450f1df06 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -62,21 +62,19 @@ parameters: - '#.*phan-var#' - '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#' - '#expects \(callable#' - - '#expects bool#' - - '#expects bool, int given.#' + - '#expects bool\|string#' + - '#expects bool, int#' - '#expects bool, string given.#' - '#expects int\|#' - '#expects int\|#' - '#expects int<-2, 2>, bool given.#' - '#expects int<0, 1>#' - - '#print.* expects int, string#' - '#load.* expects int, string#' - '#ajax.* expects int, string#' - '#measu.* expects int, string#' - '#color.* expects int, string#' - '#imap.* expects int, string#' - '#show.* expects int, string#' - - '#pdf.* expects int, string#' - '#dol.* expects int, string#' - '#get.* expects int, string#' - '#send.* expects int, string#'