From 866753d87ef5ab80937a1f70ce0ddff5b7d1a112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 14 Jan 2024 20:53:22 +0100 Subject: [PATCH 1/5] fix phpstan --- htdocs/core/class/html.formcontract.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f71f1736a33..fc869901f01 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -63,7 +63,7 @@ class FormContract * @param string $morecss More CSS * @return int Nbr of contract if OK, <0 if KO */ - public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0, $morecss = 'minwidth150') + public function select_contract($socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0, $morecss = 'minwidth150') { // phpcs:enable global $user, $conf, $langs; @@ -190,7 +190,7 @@ class FormContract * @param int $noouput 1=Return the output instead of display * @return string|void html string */ - public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) + public function formSelectContract($page, $socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) { global $langs; From 08bc6996c9b442834e7c821bcb26ff940c80ca50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 14 Jan 2024 20:57:26 +0100 Subject: [PATCH 2/5] fix phpstan --- htdocs/core/class/html.formexpensereport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formexpensereport.class.php b/htdocs/core/class/html.formexpensereport.class.php index 4eb12e64d2f..a94e076a3ba 100644 --- a/htdocs/core/class/html.formexpensereport.class.php +++ b/htdocs/core/class/html.formexpensereport.class.php @@ -59,7 +59,7 @@ class FormExpenseReport * @param int $useshortlabel Use short labels * @return string HTML select with status */ - public function selectExpensereportStatus($selected = '', $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0) + public function selectExpensereportStatus($selected = 0, $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0) { global $langs; @@ -74,7 +74,7 @@ class FormExpenseReport $arrayoflabels = $tmpep->labelStatusShort; } foreach ($arrayoflabels as $key => $val) { - if ($selected != '' && $selected == $key) { + if (!empty($selected) && $selected == $key) { $html .= '