Skip to content

Commit

Permalink
Qual: Fix phan notices
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Oct 3, 2024
1 parent e384c87 commit fd1514b
Show file tree
Hide file tree
Showing 19 changed files with 171 additions and 100 deletions.
33 changes: 14 additions & 19 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
*/
return [
// # Issue statistics:
// PhanPluginUnknownPropertyType : 1210+ occurrences
// PhanPluginUnknownPropertyType : 1200+ occurrences
// PhanUndeclaredProperty : 840+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 680+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 560+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 550+ occurrences
// PhanUndeclaredGlobalVariable : 430+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 420+ occurrences
// PhanUndeclaredGlobalVariable : 420+ occurrences
// PhanPluginUnknownArrayMethodParamType : 320+ occurrences
// PhanPossiblyUndeclaredVariable : 280+ occurrences
// PhanTypeMismatchProperty : 190+ occurrences
// PhanPluginUnknownArrayMethodParamType : 310+ occurrences
// PhanPossiblyUndeclaredVariable : 270+ occurrences
// PhanTypeMismatchProperty : 180+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 140+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 140+ occurrences
// PhanPluginUnknownObjectMethodCall : 80+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 80+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 75+ occurrences
// PhanPluginUnknownArrayPropertyType : 70+ occurrences
// PhanPluginUnknownObjectMethodCall : 70+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanPluginEmptyStatementIf : 55+ occurrences
// PhanPluginEmptyStatementIf : 50+ occurrences
// PhanRedefineFunction : 50+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
Expand Down Expand Up @@ -628,12 +628,11 @@ return [
'htdocs/hrm/class/evaluationdet.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/job.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/position.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/skill.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/hrm/class/skill.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/skilldet.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/skillrank.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/compare.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/core/tpl/objectline_view.tpl.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/hrm/evaluation_card.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/hrm/evaluation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/hrm/index.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/hrm/job_agenda.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
Expand All @@ -646,9 +645,8 @@ return [
'htdocs/hrm/lib/hrm_skilldet.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_skillrank.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/position_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/hrm/skill_card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/hrm/skill_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/hrm/skill_tab.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/imports/class/import.class.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/imports/import.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
Expand All @@ -661,16 +659,13 @@ return [
'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/install/upgrade2.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/intracommreport/lib/intracommreport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'],
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/loan/class/loan.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/class/loanschedule.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
Expand All @@ -686,7 +681,7 @@ return [
'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/mrp/class/mo.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/mrp/class/mo.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/mrp/lib/mrp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/mrp/lib/mrp_mo.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down Expand Up @@ -972,7 +967,7 @@ return [
'htdocs/webportal/class/controller.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturnNullable'],
'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
Expand Down
3 changes: 3 additions & 0 deletions htdocs/hrm/class/skill.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class Skill extends CommonObject
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 0,),
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 71, 'notnull' => 0, 'visible' => 0,),
);
/**
* @var int
*/
public $rowid;
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/class/skilldet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public function fetchLines()
* @param string $filter Filter as an Universal Search string.
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
* @return array|int int <0 if KO, array of pages if OK
* @return Skilldet[]|int int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/class/skillrank.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function cloneFromCurrentSkill($currentSkill, $fk_user)
* @param string $filter Filter as an Universal Search string.
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
* @return array|int int <0 if KO, array of pages if OK
* @return SkillRank[]|int int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/evaluation_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
// save evaldet lines to user;
$sk = new SkillRank($db);
$SkillrecordsForActiveUser = $sk->fetchAll('ASC', 'fk_skill', 0, 0, "(fk_object:=:".((int) $object->fk_user).") AND (objecttype:=:'".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."')", 'AND');
'@phan-var-force SkillRank[] $skillrecordsForActiveUser';
'@phan-var-force SkillRank[] $SkillrecordsForActiveUser';

$errors = 0;
// we go through the evaldets of the eval
Expand Down
11 changes: 7 additions & 4 deletions htdocs/hrm/skill_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (C) 2021 Jean-Pascal BOUDET <[email protected]>
* Copyright (C) 2021 Grégory BLEMAND <[email protected]>
* Copyright (C) 2023-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -139,6 +140,7 @@
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
if ($action == 'add' && $permissiontoadd) {
$arraySkill = $object->fetchLines();
'@phan-var-force Skilldet[] $arraySkill';
$index = 0;
foreach ($arraySkill as $skilldet) {
if (isset($skilldetArray[$index])) {
Expand Down Expand Up @@ -184,7 +186,7 @@
include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';

if ($action == 'set_thirdparty' && $permissiontoadd) {
$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname);
$object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
}
if ($action == 'classin' && $permissiontoadd) {
$object->setProject(GETPOSTINT('projectid'));
Expand Down Expand Up @@ -306,6 +308,7 @@

// SKILLDET
$SkilldetRecords = $object->fetchLines();
'@phan-var-force Skilldet[] $SkilldetRecords';

if (is_array($SkilldetRecords) && count($SkilldetRecords) == 0) {
$object->createSkills(1);
Expand Down Expand Up @@ -364,7 +367,7 @@
if (empty($skilldetArray)) {
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key;
} else {
$value=$skilldetArray[$sk->id];
$value = $skilldetArray[$sk->id];
}
//
// } elseif ($val['type'] == 'price') {
Expand Down Expand Up @@ -457,7 +460,7 @@


$morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label;
$morehtmlref .= $object->label;
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);

Expand All @@ -467,7 +470,7 @@
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">' . "\n";

$object->fields['label']['visible']=0; // Already in banner
$object->fields['label']['visible'] = 0; // Already in banner
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';

// Other attributes. Fields from hook formObjectOptions and Extrafields.
Expand Down
9 changes: 7 additions & 2 deletions htdocs/hrm/skill_tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Copyright (C) 2021 Grégory BLEMAND <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -143,11 +144,13 @@
$error++;
}
if (!$error) {
$ret = -1;
foreach ($TSkillsToAdd as $k => $v) {
$skillAdded = new SkillRank($db);
$skillAdded->fk_skill = $v;
$skillAdded->fk_object = $id;
$skillAdded->objecttype = $objecttype;
// TODO: ensure handling of $ret is ok, now only fails when last is KO.
$ret = $skillAdded->create($user);
if ($ret < 0) {
setEventMessages($skillAdded->error, null, 'errors');
Expand All @@ -162,6 +165,7 @@
if (!empty($TNote)) {
foreach ($TNote as $skillId => $rank) {
$TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, '(fk_object:=:'.((int) $id).") AND (objecttype:=:'".$db->escape($objecttype)."') AND (fk_skill:=:".((int) $skillId).')');
'@phan-var-force SkillRank[] $tSkills';
if (is_array($TSkills) && !empty($TSkills)) {
foreach ($TSkills as $tmpObj) {
$tmpObj->rankorder = $rank;
Expand Down Expand Up @@ -196,6 +200,7 @@
$help_url = '';
llxHeader('', $title, $help_url);

$listLink = '';
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$res = $object->fetch_optionals();
Expand Down Expand Up @@ -251,7 +256,7 @@
$morehtmlref .= '</div>';

dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
} else {
} elseif ($listLink !== null) {
$linkback = '<a href="' . $listLink . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';

$morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">';
Expand Down Expand Up @@ -479,7 +484,7 @@
$sqlEval = "SELECT rowid FROM ".MAIN_DB_PREFIX."hrm_evaluation as e";
$sqlEval .= " WHERE e.fk_user = ".((int) $id);
$rslt = $db->query($sqlEval);
$numEval = $db->num_rows($sqlEval);
$numEval = $db->num_rows($rslt);

$page = 0;
print_barre_liste($langs->trans("Evaluations"), $page, $_SERVER["PHP_SELF"], '', '', '', '', $numEval, $numEval, $evaltmp->picto, 0);
Expand Down
36 changes: 21 additions & 15 deletions htdocs/install/upgrade2.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@
}
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;

$versiontoarray = array();
$versionranarray = array();

if (!$error) {
if (count($listofentities) > 1) {
print '<tr><td colspan="4">*** '.$langs->trans("Entity").' '.$entity.'</td></tr>'."\n";
Expand Down Expand Up @@ -354,9 +357,9 @@
// Script for 3.0
$afterversionarray = explode('.', '2.9.9');
$beforeversionarray = explode('.', '3.0.9');
if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
// No particular code
}
//if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
// No particular code
//}

// Script for 3.1
$afterversionarray = explode('.', '3.0.9');
Expand Down Expand Up @@ -398,9 +401,9 @@
// Scripts for 3.9
$afterversionarray = explode('.', '3.7.9');
$beforeversionarray = explode('.', '3.8.9');
if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
// No particular code
}
//if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
// No particular code
//}

// Scripts for 4.0
$afterversionarray = explode('.', '3.9.9');
Expand Down Expand Up @@ -458,9 +461,9 @@
// Scripts for 9.0
$afterversionarray = explode('.', '8.0.9');
$beforeversionarray = explode('.', '9.0.9');
if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
//migrate_user_photospath();
}
//if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
//migrate_user_photospath();
//}

// Scripts for 11.0
$afterversionarray = explode('.', '10.0.9');
Expand Down Expand Up @@ -768,11 +771,12 @@ function migrate_paiements($db, $langs, $conf)
$sql .= " WHERE p.fk_facture > 0";

$resql = $db->query($sql);
$row = array();
$num = 0;

dolibarr_install_syslog("upgrade2::migrate_paiements");
if ($resql) {
$i = 0;
$row = array();
$num = $db->num_rows($resql);

while ($i < $num) {
Expand All @@ -788,8 +792,8 @@ function migrate_paiements($db, $langs, $conf)

if ($num) {
print $langs->trans('MigrationPaymentsNumberToUpdate', $num)."<br>\n";
$res = 0;
if ($db->begin()) {
$res = 0;
$num = count($row);
for ($i = 0; $i < $num; $i++) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
Expand All @@ -805,7 +809,7 @@ function migrate_paiements($db, $langs, $conf)
}
}

if ($res == (2 * count($row))) {
if (is_array($row) && $res == (2 * count($row))) {
$db->commit();
print $langs->trans('MigrationSuccessfullUpdate')."<br>";
} else {
Expand Down Expand Up @@ -4199,9 +4203,9 @@ function migrate_delete_old_dir($db, $langs, $conf)
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param array $listofmodule List of modules, like array('MODULE_KEY_NAME'=>$reloadmode, ...)
* @param int $force 1=Reload module even if not already loaded
* @return int Return integer <0 if KO, >0 if OK
* @param array<string,'noboxes'|'newboxdefonly'|'forceactivate'> $listofmodule List of modules, like array('MODULE_KEY_NAME'=>$reloadmode, ...)
* @param int<0,1> $force 1=Reload module even if not already loaded
* @return int Return integer <0 if KO, >0 if OK
*/
function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $force = 0)
{
Expand Down Expand Up @@ -4292,6 +4296,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
if ($res) {
$classname = 'mod'.$moduletoreloadshort;
$mod = new $classname($db);
'@phan-var-force DolibarrModules $mod';

//$mod->remove('noboxes');
$mod->delete_menus(); // We must delete to be sure it is inserted with new values
Expand All @@ -4303,6 +4308,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
if ($res) {
$classname = 'mod'.$moduletoreloadshort;
$mod = new $classname($db);
'@phan-var-force DolibarrModules $mod';
$mod->init($reloadmode);
} else {
dolibarr_install_syslog('Failed to include '.strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php', LOG_ERR);
Expand Down
Loading

0 comments on commit fd1514b

Please sign in to comment.