mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Merge pull request #36595 from mdeweerd/fix/ci/phan/20251209
Fix(ci/phan): Fix several phan notices
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -9385,8 +9385,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
|
||||
* @return string Translated string for the key
|
||||
*/
|
||||
function ($m) {
|
||||
return '__BRACKETSTART' . $m[1] . 'BRACKETEND__'; },
|
||||
$out);
|
||||
return '__BRACKETSTART' . $m[1] . 'BRACKETEND__';
|
||||
},
|
||||
$out
|
||||
);
|
||||
|
||||
$dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL);
|
||||
|
||||
@@ -9402,8 +9404,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
|
||||
* @return string Translated string for the key
|
||||
*/
|
||||
function ($m) {
|
||||
return '__[' . $m[1] . ']__'; },
|
||||
$out);
|
||||
return '__[' . $m[1] . ']__';
|
||||
},
|
||||
$out
|
||||
);
|
||||
|
||||
// Remove the trick added to solve pb with text in utf8 and text without parent tag
|
||||
//$out = preg_replace('/^'.preg_quote('<?xml encoding="UTF-8">', '/').'/', '', $out);
|
||||
@@ -10970,12 +10974,12 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = n
|
||||
/**
|
||||
* Format output for start and end date
|
||||
*
|
||||
* @param int $date_start Start date
|
||||
* @param int $date_end End date
|
||||
* @param string $format Output date format ('day', 'dayhour', ...)
|
||||
* @param Translate|null $outputlangs Output language
|
||||
* @param integer $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis
|
||||
* @return string String
|
||||
* @param int $date_start Start date
|
||||
* @param int $date_end End date
|
||||
* @param string $format Output date format ('day', 'dayhour', ...)
|
||||
* @param ?Translate $outputlangs Output language
|
||||
* @param int<0,2> $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis
|
||||
* @return string String
|
||||
*/
|
||||
function get_date_range($date_start, $date_end, $format = '', $outputlangs = null, $withparenthesis = 1)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -244,14 +244,12 @@ class MenuManager
|
||||
|
||||
// Start a new ul level 1
|
||||
$level = 1;
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level).'<ul class="ullevel1">'."\n";
|
||||
print str_repeat(' ', $level).'<ul class="ullevel1">'."\n";
|
||||
|
||||
// Do we have to add an extra entry that is not into menu array ?
|
||||
if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools')))
|
||||
|| (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print str_repeat(' ', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print '<a href="'.$relurl.'">';
|
||||
|
||||
if ($val['level'] == 0) {
|
||||
@@ -293,8 +291,7 @@ class MenuManager
|
||||
|
||||
$newlinelevel = ($val2['level'] + 1);
|
||||
if ($newlinelevel > $lastlinelevel) {
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
|
||||
print str_repeat(' ', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
|
||||
}
|
||||
$lastlinelevel = ($val2['level'] + 1);
|
||||
|
||||
@@ -334,7 +331,7 @@ class MenuManager
|
||||
// Show entry li level $val2['level']+1
|
||||
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', ($val2['level'] + 1));
|
||||
print str_repeat(' ', ($val2['level'] + 1));
|
||||
print '<li class="lilevel'.($val2['level'] + 1);
|
||||
if ($val2['level'] == 0) {
|
||||
print ' ui-btn-icon-right ui-btn'; // ui-btn to highlight on clic
|
||||
@@ -362,7 +359,7 @@ class MenuManager
|
||||
if ($val2['level'] == 0 && !empty($val2['prefix'])) {
|
||||
print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright"
|
||||
} else {
|
||||
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level']+1).'"></i>';
|
||||
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level'] + 1).'"></i>';
|
||||
}
|
||||
|
||||
print $val2['titre'];
|
||||
@@ -382,10 +379,8 @@ class MenuManager
|
||||
print '</li>'."\n";
|
||||
$fromcursor = 0;
|
||||
while ($fromcursor < ($currentlevel - $nextlevel)) {
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $currentlevel - $fromcursor).'</ul>'."\n";
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
|
||||
print str_repeat(' ', $currentlevel - $fromcursor).'</ul>'."\n";
|
||||
print str_repeat(' ', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
|
||||
$fromcursor++;
|
||||
}
|
||||
} else {
|
||||
@@ -394,10 +389,8 @@ class MenuManager
|
||||
}
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level).'</ul>'."\n"; // end ul level 1
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level - 1).'</li>'."\n"; // end ul level 1
|
||||
print str_repeat(' ', $level).'</ul>'."\n"; // end ul level 1
|
||||
print str_repeat(' ', $level - 1).'</li>'."\n"; // end ul level 1
|
||||
} elseif ($val['enabled'] == 2) {
|
||||
print '<li class="lilevel0">';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -246,14 +246,12 @@ class MenuManager
|
||||
|
||||
// Start a new ul level 1
|
||||
$level = 1;
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level).'<ul class="ullevel1">'."\n";
|
||||
print str_repeat(' ', $level).'<ul class="ullevel1">'."\n";
|
||||
|
||||
// Do we have to add an extra entry that is not into menu array ?
|
||||
if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools')))
|
||||
|| (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print str_repeat(' ', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print '<a href="'.$relurl.'">';
|
||||
|
||||
if ($val['level'] == 0) {
|
||||
@@ -285,7 +283,7 @@ class MenuManager
|
||||
|
||||
$newlinelevel = ($val2['level'] + 1);
|
||||
if ($newlinelevel > $lastlinelevel) {
|
||||
print str_pad('', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
|
||||
print str_repeat(' ', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
|
||||
}
|
||||
$lastlinelevel = ($val2['level'] + 1);
|
||||
|
||||
@@ -324,7 +322,7 @@ class MenuManager
|
||||
// Show entry li level $val2['level']+1
|
||||
|
||||
// @phan-suppress-next-line PhanParamSuspiciousOrder
|
||||
print str_pad('', ($val2['level'] + 1));
|
||||
print str_repeat(' ', ($val2['level'] + 1));
|
||||
print '<li class="lilevel'.($val2['level'] + 1);
|
||||
if ($val2['level'] == 0) {
|
||||
print ' ui-btn-icon-right ui-btn'; // ui-btn to highlight on clic
|
||||
@@ -353,7 +351,7 @@ class MenuManager
|
||||
if ($val2['level'] == 0 && !empty($val2['prefix'])) {
|
||||
print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright"
|
||||
} else {
|
||||
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level']+1).'"></i>';
|
||||
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level'] + 1).'"></i>';
|
||||
}
|
||||
|
||||
print $val2['titre'];
|
||||
@@ -372,8 +370,8 @@ class MenuManager
|
||||
print '</li>'."\n";
|
||||
$fromcursor = 0;
|
||||
while ($fromcursor < ($currentlevel - $nextlevel)) {
|
||||
print str_pad('', $currentlevel - $fromcursor).'</ul>'."\n";
|
||||
print str_pad('', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
|
||||
print str_repeat(' ', $currentlevel - $fromcursor).'</ul>'."\n";
|
||||
print str_repeat(' ', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
|
||||
$fromcursor++;
|
||||
}
|
||||
} else {
|
||||
@@ -383,8 +381,8 @@ class MenuManager
|
||||
//var_dump($submenu);
|
||||
}
|
||||
|
||||
print str_pad('', $level).'</ul>'."\n"; // end ul level 1
|
||||
print str_pad('', $level - 1).'</li>'."\n"; // end ul level 1
|
||||
print str_repeat(' ', $level).'</ul>'."\n"; // end ul level 1
|
||||
print str_repeat(' ', $level - 1).'</li>'."\n"; // end ul level 1
|
||||
} elseif ($val['enabled'] == 2) {
|
||||
print '<li class="lilevel0">';
|
||||
|
||||
|
||||
@@ -2356,11 +2356,11 @@ class ExpenseReport extends CommonObject
|
||||
* deleteline
|
||||
*
|
||||
* @param int $rowid Row id
|
||||
* @param User|string $fuser User
|
||||
* @param ?User $fuser User
|
||||
* @param int<0,1> $notrigger 1=No trigger
|
||||
* @return int<-1,1> Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function deleteLine($rowid, $fuser = '', $notrigger = 0)
|
||||
public function deleteLine($rowid, $fuser = null, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user