Skip to content

Commit

Permalink
Merge branch 'develop' into sonikf-patch-e-shipment
Browse files Browse the repository at this point in the history
  • Loading branch information
sonikf authored Nov 12, 2024
2 parents 2ec23a0 + 75ce3e8 commit e5a2cd7
Show file tree
Hide file tree
Showing 35 changed files with 167 additions and 217 deletions.
105 changes: 10 additions & 95 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2050,11 +2050,6 @@ parameters:
count: 1
path: ../../htdocs/blockedlog/admin/blockedlog_list.php

-
message: "#^Parameter \\#1 \\$objtoshow of function formatObject expects object, array given\\.$#"
count: 1
path: ../../htdocs/blockedlog/ajax/block-info.php

-
message: "#^Dead catch \\- Exception is never thrown in the try block\\.$#"
count: 1
Expand Down Expand Up @@ -2355,6 +2350,11 @@ parameters:
count: 1
path: ../../htdocs/bookcal/availabilities_document.php

-
message: "#^Empty array passed to foreach\\.$#"
count: 1
path: ../../htdocs/bookcal/availabilities_list.php

-
message: "#^If condition is always false\\.$#"
count: 1
Expand Down Expand Up @@ -2475,6 +2475,11 @@ parameters:
count: 1
path: ../../htdocs/bookcal/calendar_document.php

-
message: "#^Empty array passed to foreach\\.$#"
count: 1
path: ../../htdocs/bookcal/calendar_list.php

-
message: "#^If condition is always false\\.$#"
count: 1
Expand Down Expand Up @@ -3130,11 +3135,6 @@ parameters:
count: 1
path: ../../htdocs/comm/mailing/cibles.php

-
message: "#^Variable \\$mesgs might not be defined\\.$#"
count: 1
path: ../../htdocs/comm/mailing/cibles.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 2
Expand Down Expand Up @@ -3835,36 +3835,16 @@ parameters:
count: 1
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$oldref might not be defined\\.$#"
count: 1
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$permissiontoadd might not be defined\\.$#"
count: 1
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$permissiontoread might not be defined\\.$#"
count: 1
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$searchCategoryProductOperator might not be defined\\.$#"
count: 3
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$search_product_category_array might not be defined\\.$#"
count: 2
path: ../../htdocs/commande/list_det.php

-
message: "#^Variable \\$text_icon might not be defined\\.$#"
count: 1
path: ../../htdocs/commande/list_det.php

-
message: "#^If condition is always false\\.$#"
count: 1
Expand Down Expand Up @@ -3910,16 +3890,6 @@ parameters:
count: 2
path: ../../htdocs/compta/bank/account_statement_document.php

-
message: "#^Variable \\$max might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/annuel.php

-
message: "#^Variable \\$min might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/annuel.php

-
message: "#^If condition is always false\\.$#"
count: 2
Expand All @@ -3945,21 +3915,6 @@ parameters:
count: 1
path: ../../htdocs/compta/bank/bankentries_list.php

-
message: "#^Variable \\$numr might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/bankentries_list.php

-
message: "#^Variable \\$css might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/card.php

-
message: "#^Variable \\$name might not be defined\\.$#"
count: 4
path: ../../htdocs/compta/bank/card.php

-
message: "#^Variable \\$noback in empty\\(\\) always exists and is always falsy\\.$#"
count: 1
Expand Down Expand Up @@ -4080,36 +4035,6 @@ parameters:
count: 3
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$morehtml might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$show1 might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$show2 might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$show3 might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$show4 might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Variable \\$show5 might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/graph.php

-
message: "#^Right side of && is always true\\.$#"
count: 2
Expand Down Expand Up @@ -4170,11 +4095,6 @@ parameters:
count: 1
path: ../../htdocs/compta/bank/releve.php

-
message: "#^Variable \\$total might not be defined\\.$#"
count: 3
path: ../../htdocs/compta/bank/releve.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
Expand Down Expand Up @@ -4215,11 +4135,6 @@ parameters:
count: 1
path: ../../htdocs/compta/bank/various_payment/card.php

-
message: "#^Variable \\$formproject might not be defined\\.$#"
count: 1
path: ../../htdocs/compta/bank/various_payment/card.php

-
message: "#^Variable \\$ref might not be defined\\.$#"
count: 1
Expand Down
57 changes: 15 additions & 42 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
return [
// # Issue statistics:
// PhanUndeclaredProperty : 560+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 310+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 500+ occurrences
// PhanUndeclaredGlobalVariable : 340+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 270+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
// PhanTypeMismatchProperty : 160+ occurrences
// PhanTypeMismatchProperty : 140+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 45+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanPluginEmptyStatementIf : 35+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanPluginEmptyStatementIf : 30+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginUnknownObjectMethodCall : 10+ occurrences
Expand Down Expand Up @@ -62,51 +62,34 @@ return [
'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
'htdocs/asset/depreciation.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/asset/disposal.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/asset/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/model/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/blockedlog/ajax/block-info.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/bom/bom_card.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/calendar_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/photos.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/traduction.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp'],
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/index.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/list.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
Expand All @@ -116,21 +99,13 @@ return [
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/line.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/releve.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/treso.php' => ['PhanTypeMismatchProperty'],
'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
Expand Down Expand Up @@ -374,7 +349,6 @@ return [
'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
Expand Down Expand Up @@ -404,7 +378,7 @@ return [
'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/card-rec.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down Expand Up @@ -637,7 +611,6 @@ return [
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'],
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/phan/config_extended.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
// 'PhanTypeArraySuspiciousNullable', // All fixed.
'PhanTypeArraySuspiciousNullable', // About 400 cases
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
Expand Down
2 changes: 1 addition & 1 deletion htdocs/asset/admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db);
print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1, 'minwidth150 maxwidth300', 1);
} else {
print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
}
Expand Down
3 changes: 3 additions & 0 deletions htdocs/asset/depreciation.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}

/*
if (empty($reshook)) {
}
*/


/*
Expand Down
3 changes: 3 additions & 0 deletions htdocs/asset/disposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2018 Alexandre Spangaro <[email protected]>
* Copyright (C) 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 @@ -86,8 +87,10 @@
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
/*
if (empty($reshook)) {
}
*/


/*
Expand Down
Loading

0 comments on commit e5a2cd7

Please sign in to comment.