diff --git a/ChangeLog b/ChangeLog index 3207490752d..6da016bd2cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10105,7 +10105,7 @@ For developers: WARNING: - A lot of class files (*.class.php) has moved into subdirectories. So If you use or develop non official modules that includes Dolibarr classes, you will have to rename - path to thoose classes into the include function. + path to those classes into the include function. - Also, parameters of the "fetch()" method for class "User" has changed to reflect other fetch methods. - If you build a personalised themes, you must rename the style sheet into style.css.php. diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index dce7bdff144..f6d51c0b68d 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -14,6 +14,7 @@ dolibar->dolibarr dolibarrr->dolibarr dollibar->dolibarr dollibarr->dolibarr +thoose->those # fiche->card mot de passe->password not de passe->password diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index a7880ce1494..1d8a2f6f467 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -171,6 +171,7 @@ $VALID_MODULE_MAPPING = array( 'syslog' => 'Syslog', 'takepos' => 'TakePos', 'tax' => 'Tax', + 'theme_datacolor' => 'array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}}', 'ticket' => 'Ticket', 'user' => 'User', 'variants' => 'Variants', @@ -488,7 +489,7 @@ return [ 'PhanPluginEmptyStatementIf', // 'PhanUndeclaredStaticMethod', // 'PhanPluginDescriptionlessCommentOnPrivateMethod', - 'PhanPluginPrintfIncompatibleArgumentType', + // 'PhanPluginPrintfIncompatibleArgumentType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanRedefineClass', 'PhanRedefineFunction', @@ -505,7 +506,7 @@ return [ // 'PhanRedefinedExtendedClass', 'PhanTypeComparisonFromArray', 'PhanPluginConstantVariableBool', - 'PhanPluginPrintfVariableFormatString', + // 'PhanPluginPrintfVariableFormatString', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeSuspiciousNonTraversableForeach', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 91b2894cd26..739cd972d0a 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -170,6 +170,7 @@ $VALID_MODULE_MAPPING = array( 'syslog' => 'Syslog', 'takepos' => 'TakePos', 'tax' => 'Tax', + 'theme_datacolor' => 'array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}}', 'ticket' => 'Ticket', 'user' => 'User', 'variants' => 'Variants', diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index db8eadee618..f4f77bcaa9d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -308,7 +308,7 @@ class ActionComm extends CommonObject public $icalname; /** - * @var string Ical color + * @var int<0,3> Ical color */ public $icalcolor; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 78c5449ccca..7bd186d812f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1793,7 +1793,7 @@ $db->close(); * @param int $showinfo Add extended information (used by day and week view) * @param int $minheight Minimum height for each event. 60px by default. * @param int $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button" - * @param array $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal + * @param array{}|array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int}} $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal * @return void */ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0, $bookcalcalendarsarray = array()) @@ -1804,6 +1804,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused; global $hookmanager; + '@phan-var-force array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}} $theme_datacolor + @phan-var-force User[] $cacheusers + @phan-var-force array> $colorindexused'; + if ($conf->use_javascript_ajax) { // Enable the "Show more button..." $conf->global->MAIN_JS_SWITCH_AGENDA = 1; } @@ -1954,7 +1958,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } } //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; - // Define color + // Define color // @suppress-next-line PhanPluginPrintfIncompatibleArgumentType $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } $cssclass = $cssclass.' eventday_'.$ymd; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a58cb34a0b5..2cc21fb215d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2136,7 +2136,7 @@ class BonPrelevement extends CommonObject * @param string $row_cc pl.number AS cc, Not used for SEPA * @param string $row_somme pl.amount AS somme, * @param string $row_ref Invoice ref (f.ref) or Salary ref - * @param string $row_idfac p.fk_facture AS idfac or p.fk_facture_fourn or p.fk_salary, + * @param int $row_idfac p.fk_facture AS idfac or p.fk_facture_fourn or p.fk_salary, * @param string $row_iban rib.iban_prefix AS iban, * @param string $row_bic rib.bic AS bic, * @param string $row_datec rib.datec, diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 4cb0e49ff9d..c0e08d06ba5 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic 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 @@ -73,7 +74,7 @@ class box_factures extends ModeleBoxes $text = $langs->trans("BoxTitleLast".(getDolGlobalString('MAIN_LASTBOX_ON_OBJECT_DATE') ? "" : "Modified")."CustomerBills", $max); $this->info_box_head = array( 'text' => $text, - 'limit'=> dol_strlen($text) + 'limit' => dol_strlen($text) ); if ($user->hasRight('facture', 'lire')) { @@ -159,13 +160,14 @@ class box_factures extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', 'text' => $facturestatic->getNomUrl(1), - 'text2'=> $late, + 'text2' => $late, 'asis' => 1, ); @@ -196,7 +198,7 @@ class box_factures extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', - 'text'=> ''.$langs->trans("NoRecordedInvoices").'', + 'text' => ''.$langs->trans("NoRecordedInvoices").'', ); } @@ -204,7 +206,7 @@ class box_factures extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( 'td' => '', - 'maxlength'=>500, + 'maxlength' => 500, 'text' => ($this->db->error().' sql='.$sql), ); } diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index f45d1ca689f..93ce9fab6da 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic 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 @@ -149,13 +150,14 @@ class box_factures_fourn extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', 'text' => $facturestatic->getNomUrl(1), - 'text2'=> $late, + 'text2' => $late, 'asis' => 1, ); @@ -193,7 +195,7 @@ class box_factures_fourn extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', - 'text'=> ''.$langs->trans("NoModifiedSupplierBills").'', + 'text' => ''.$langs->trans("NoModifiedSupplierBills").'', ); } @@ -201,7 +203,7 @@ class box_factures_fourn extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( 'td' => '', - 'maxlength'=>500, + 'maxlength' => 500, 'text' => ($this->db->error().' sql='.$sql), ); } diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index fab76f18fc8..777cea5a2ed 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic 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 @@ -158,6 +159,7 @@ class box_factures_fourn_imp extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } @@ -166,7 +168,7 @@ class box_factures_fourn_imp extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', 'text' => $facturestatic->getNomUrl(1), - 'text2'=> $late, + 'text2' => $late, 'asis' => 1, ); @@ -201,7 +203,7 @@ class box_factures_fourn_imp extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', - 'text'=> ''.$langs->trans("NoUnpaidSupplierBills").'', + 'text' => ''.$langs->trans("NoUnpaidSupplierBills").'', ); } @@ -238,7 +240,7 @@ class box_factures_fourn_imp extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( 'td' => '', - 'maxlength'=>500, + 'maxlength' => 500, 'text' => ($this->db->error().' sql='.$sql), ); } diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index b0b2659fd69..c256dbbcc72 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015-2019 Frederic 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 @@ -75,7 +76,7 @@ class box_factures_imp extends ModeleBoxes $langs->load("bills"); $textHead = $langs->trans("BoxTitleOldestUnpaidCustomerBills"); - $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $this->max), 'limit'=> dol_strlen($textHead)); + $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $this->max), 'limit' => dol_strlen($textHead)); if ($user->hasRight('facture', 'lire')) { $sql1 = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.code_client, s.client"; @@ -171,13 +172,14 @@ class box_factures_imp extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', 'text' => $facturestatic->getNomUrl(1), - 'text2'=> $late, + 'text2' => $late, 'asis' => 1, ); @@ -212,7 +214,7 @@ class box_factures_imp extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', - 'text'=> ''.$langs->trans("NoUnpaidCustomerBills").'' + 'text' => ''.$langs->trans("NoUnpaidCustomerBills").'' ); } @@ -249,7 +251,7 @@ class box_factures_imp extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( 'td' => '', - 'maxlength'=>500, + 'maxlength' => 500, 'text' => ($this->db->error().' sql='.$sql), ); } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 96daa0479f8..92b32d2f257 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -701,6 +701,7 @@ class Translate if (strpos($key, 'Format') !== 0) { try { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $str = sprintf($str, $param1, $param2, $param3, $param4); // Replace %s and %d except for FormatXXX strings. } catch (Exception $e) { // No exception managed @@ -786,6 +787,7 @@ class Translate if (!preg_match('/^Format/', $key)) { //print $str; + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $str = sprintf($str, $param1, $param2, $param3, $param4, $param5); // Replace %s and %d except for FormatXXX strings. } @@ -810,7 +812,7 @@ class Translate */ public function transcountry($str, $countrycode) { - $strLocaleKey=$str.$countrycode; + $strLocaleKey = $str.$countrycode; if (!empty($this->tab_translate[$strLocaleKey])) { return $this->trans($strLocaleKey); } else { @@ -829,7 +831,7 @@ class Translate */ public function transcountrynoentities($str, $countrycode) { - $strLocaleKey=$str.$countrycode; + $strLocaleKey = $str.$countrycode; if (!empty($this->tab_translate[$strLocaleKey])) { return $this->transnoentities($strLocaleKey); } else { diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 9239d78cee3..8a08ef4141e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -35,31 +35,31 @@ function get_tz_array() { $tzarray = array( - -11=>"Pacific/Midway", - -10=>"Pacific/Fakaofo", - -9=>"America/Anchorage", - -8=>"America/Los_Angeles", - -7=>"America/Dawson_Creek", - -6=>"America/Chicago", - -5=>"America/Bogota", - -4=>"America/Anguilla", - -3=>"America/Araguaina", - -2=>"America/Noronha", - -1=>"Atlantic/Azores", - 0=>"Africa/Abidjan", - 1=>"Europe/Paris", - 2=>"Europe/Helsinki", - 3=>"Europe/Moscow", - 4=>"Asia/Dubai", - 5=>"Asia/Karachi", - 6=>"Indian/Chagos", - 7=>"Asia/Jakarta", - 8=>"Asia/Hong_Kong", - 9=>"Asia/Tokyo", - 10=>"Australia/Sydney", - 11=>"Pacific/Noumea", - 12=>"Pacific/Auckland", - 13=>"Pacific/Enderbury" + -11 => "Pacific/Midway", + -10 => "Pacific/Fakaofo", + -9 => "America/Anchorage", + -8 => "America/Los_Angeles", + -7 => "America/Dawson_Creek", + -6 => "America/Chicago", + -5 => "America/Bogota", + -4 => "America/Anguilla", + -3 => "America/Araguaina", + -2 => "America/Noronha", + -1 => "Atlantic/Azores", + 0 => "Africa/Abidjan", + 1 => "Europe/Paris", + 2 => "Europe/Helsinki", + 3 => "Europe/Moscow", + 4 => "Asia/Dubai", + 5 => "Asia/Karachi", + 6 => "Indian/Chagos", + 7 => "Asia/Jakarta", + 8 => "Asia/Hong_Kong", + 9 => "Asia/Tokyo", + 10 => "Australia/Sydney", + 11 => "Pacific/Noumea", + 12 => "Pacific/Auckland", + 13 => "Pacific/Enderbury" ); return $tzarray; } @@ -296,11 +296,11 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l $sTime .= dol_print_date($iSecond, 'hourduration', true); } } elseif ($format == 'allhourminsec') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond / 3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); } elseif ($format == 'allhourmin') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600)/60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond / 3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))); } elseif ($format == 'allhour') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond / 3600))); } } elseif ($format == 'hour') { // only hour part $sTime = dol_print_date($iSecond, '%H', true); @@ -431,12 +431,12 @@ function dol_stringtotime($string, $gm = 1) dol_syslog("dol_stringtotime call to function with deprecated parameter format", LOG_WARNING); // Date est au format 'DD/MM/YY' ou 'DD/MM/YY HH:MM:SS' // Date est au format 'DD/MM/YYYY' ou 'DD/MM/YYYY HH:MM:SS' - $sday = $reg[1]; - $smonth = $reg[2]; - $syear = $reg[3]; - $shour = $reg[4]; - $smin = $reg[5]; - $ssec = $reg[6]; + $sday = (int) $reg[1]; + $smonth = (int) $reg[2]; + $syear = (int) $reg[3]; + $shour = (int) $reg[4]; + $smin = (int) $reg[5]; + $ssec = (int) $reg[6]; if ($syear < 50) { $syear += 1900; } @@ -448,12 +448,12 @@ function dol_stringtotime($string, $gm = 1) || preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i', $string, $reg) // Convert date with format YYYY-MM-DD HH:MM:SS || preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i', $string, $reg) // Convert date with format YYYYMMDDTHHMMSSZ ) { - $syear = $reg[1]; - $smonth = $reg[2]; - $sday = $reg[3]; - $shour = $reg[4]; - $smin = $reg[5]; - $ssec = $reg[6]; + $syear = (int) $reg[1]; + $smonth = (int) $reg[2]; + $sday = (int) $reg[3]; + $shour = (int) $reg[4]; + $smin = (int) $reg[5]; + $ssec = (int) $reg[6]; $string = sprintf("%04d%02d%02d%02d%02d%02d", $syear, $smonth, $sday, $shour, $smin, $ssec); } @@ -950,7 +950,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $jour_1sunsept = date("d", $date_1sunsept); $mois_1sunsept = date("m", $date_1sunsept); if ($jour_1sunsept == $jour && $mois_1sunsept == $mois) { - $ferie=true; + $ferie = true; } // Geneva fast in Switzerland } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 652d7eab355..2f8f3266009 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3149,7 +3149,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $dtts = new DateTime(); $dtts->setTimestamp($timetouse); $dtts->setTimezone($tzo); - $month = $dtts->format("m"); + $month = (int) $dtts->format("m"); $month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. if ($encodetooutput) { $monthtext = $outputlangs->transnoentities('Month'.$month); @@ -3946,7 +3946,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli $newphoneastart = $newphoneaend = ''; if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) if ($addlink == 'tel' || $conf->browser->layout == 'phone' || (isModEnabled('clicktodial') && getDolGlobalString('CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS'))) { // If phone or option for, we use link of phone - $newphoneastart = ''; + $newphoneastart = ''; $newphoneaend .= ''; } elseif (isModEnabled('clicktodial') && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url if (empty($user->clicktodial_loaded)) { @@ -3962,9 +3962,9 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli $clicktodial_poste = (!empty($user->clicktodial_poste) ? urlencode($user->clicktodial_poste) : ''); $clicktodial_login = (!empty($user->clicktodial_login) ? urlencode($user->clicktodial_login) : ''); $clicktodial_password = (!empty($user->clicktodial_password) ? urlencode($user->clicktodial_password) : ''); - // This line is for backward compatibility + // This line is for backward compatibility @phan-suppress-next-line PhanPluginPrintfVariableFormatString $url = sprintf($urlmask, urlencode($phone), $clicktodial_poste, $clicktodial_login, $clicktodial_password); - // Thoose lines are for substitution + // Those lines are for substitution $substitarray = array('__PHONEFROM__' => $clicktodial_poste, '__PHONETO__' => urlencode($phone), '__LOGIN__' => $clicktodial_login, diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 943c2e57956..ca90c123829 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 William Mead + * 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 @@ -463,6 +464,7 @@ class DataPolicyCron foreach ($arrayofparameters as $key => $params) { if (getDolGlobalInt($key) > 0) { + // @phan-suppress-next-line PhanPluginPrintfVariableFormatString $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 4f9ef208d88..90da7555450 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2193,14 +2193,14 @@ class Expedition extends CommonObject if (!empty($tracking) && !empty($value)) { $url = str_replace('{TRACKID}', $value, $tracking); - $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); + $this->tracking_url = sprintf('%s', $url, ($value ? $value : 'url')); } else { $this->tracking_url = $value; } } /** - * Classify the shipping as closed (this record also the stock movement) + * Classify the shipping as closed (this records also the stock movement) * * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2f35855ff10..a18fb425c37 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2332,8 +2332,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } $text .= ''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 67e29c85fc1..c895740b60a 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1588,14 +1588,14 @@ class Reception extends CommonObject if (!empty($tracking) && !empty($value)) { $url = str_replace('{TRACKID}', $value, $tracking); - $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); + $this->tracking_url = sprintf('%s', $url, ($value ? $value : 'url')); } else { $this->tracking_url = $value; } } /** - * Classify the reception as closed (this record also the stock movement) + * Classify the reception as closed (this records also the stock movement) * * @return int Return integer <0 if KO, >0 if OK */