Clean code - Fix phpstan warning

This commit is contained in:
Laurent Destailleur
2024-08-03 13:44:38 +02:00
parent 49808847b9
commit d1f1c0aa57
9 changed files with 5 additions and 40 deletions

View File

@@ -237,13 +237,8 @@ $myTmpObjects = array();
$myTmpObjects[$moduledir] = array('includerefgeneration' => 1, 'includedocgeneration' => 1, 'class' => 'StockTransfer'); $myTmpObjects[$moduledir] = array('includerefgeneration' => 1, 'includedocgeneration' => 1, 'class' => 'StockTransfer');
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
/* // Orders Numbering model
* Orders Numbering model
*/
$setupnotempty++; $setupnotempty++;
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', ''); print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
@@ -349,9 +344,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
} }
if ($myTmpObjectArray['includedocgeneration']) { if ($myTmpObjectArray['includedocgeneration']) {
/* // Document templates generators
* Document templates generators
*/
$setupnotempty++; $setupnotempty++;
$type = strtolower($myTmpObjectKey); $type = strtolower($myTmpObjectKey);

View File

@@ -227,13 +227,8 @@ if ($action == 'edit') {
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
/* // Orders Numbering model
* Orders Numbering model
*/
$setupnotempty++; $setupnotempty++;
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', ''); print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
@@ -340,9 +335,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
} }
if ($myTmpObjectArray['includedocgeneration']) { if ($myTmpObjectArray['includedocgeneration']) {
/* // Document templates generators
* Document templates generators
*/
$setupnotempty++; $setupnotempty++;
$type = strtolower($myTmpObjectKey); $type = strtolower($myTmpObjectKey);

View File

@@ -379,9 +379,6 @@ class modAi extends DolibarrModules
$myTmpObjects['Availabilities'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); $myTmpObjects['Availabilities'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);
// foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// if ($myTmpObjectKey == 'Availabilities') {
// continue;
// }
// if ($myTmpObjectArray['includerefgeneration']) { // if ($myTmpObjectArray['includerefgeneration']) {
// $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_availabilitiess.odt'; // $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_availabilitiess.odt';
// $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; // $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;

View File

@@ -445,9 +445,6 @@ class modEventOrganization extends DolibarrModules
$myTmpObjects['ConferenceOrBooth'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); $myTmpObjects['ConferenceOrBooth'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'ConferenceOrBooth') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/eventorganization/template_conferenceorbooths.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/eventorganization/template_conferenceorbooths.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/eventorganization'; $dirodt = DOL_DATA_ROOT.'/doctemplates/eventorganization';

View File

@@ -447,9 +447,6 @@ class modKnowledgeManagement extends DolibarrModules
$myTmpObjects['KnowledgeRecord'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); $myTmpObjects['KnowledgeRecord'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'KnowledgeRecord') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/knowledgemanagement/template_knowledgerecords.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/knowledgemanagement/template_knowledgerecords.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/knowledgemanagement'; $dirodt = DOL_DATA_ROOT.'/doctemplates/knowledgemanagement';

View File

@@ -463,9 +463,6 @@ class modPartnership extends DolibarrModules
$myTmpObjects['Partnership'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); $myTmpObjects['Partnership'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'Partnership') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_partnerships.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_partnerships.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;

View File

@@ -417,9 +417,6 @@ class modRecruitment extends DolibarrModules
$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration' => 1, 'includedocgeneration' => 1); $myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration' => 1, 'includedocgeneration' => 1);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
continue;
}
if ($myTmpObjectArray['includedocgeneration']) { if ($myTmpObjectArray['includedocgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_recruitmentjobposition.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_recruitmentjobposition.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;

View File

@@ -394,9 +394,6 @@ class modWorkstation extends DolibarrModules
$myTmpObjects['Workstation'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); $myTmpObjects['Workstation'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'Workstation') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/workstation/template_workstations.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/workstation/template_workstations.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/workstation'; $dirodt = DOL_DATA_ROOT.'/doctemplates/workstation';

View File

@@ -41,7 +41,7 @@ class modMyModule extends DolibarrModules
*/ */
public function __construct($db) public function __construct($db)
{ {
global $langs, $conf; global $conf;
$this->db = $db; $this->db = $db;
@@ -492,9 +492,6 @@ class modMyModule extends DolibarrModules
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); $myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) { if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;