diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index c8694de6bef1d..9b3a3e36f02de 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -25,6 +25,7 @@ maxwidthonspartphone->maxwidthonsmartphone minwith100->minwidth100 minwith200->minwidth200 mot de passe->password +multicurreny->multicurrency nempty->an empty, empty, not empty, nocellnopadding->nocellnopadd nodrap->nodrag, nodrop, diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 04943d2baff0a..fc17c79fbf0e0 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,22 +9,22 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1330+ occurrences + // PhanPluginUnknownPropertyType : 1200+ occurrences // PhanUndeclaredProperty : 840+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 690+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 630+ occurrences - // PhanUndeclaredGlobalVariable : 440+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 680+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 550+ occurrences + // PhanUndeclaredGlobalVariable : 430+ occurrences // PhanPluginUnknownArrayMethodReturnType : 420+ occurrences - // PhanPluginUnknownArrayMethodParamType : 340+ occurrences - // PhanPossiblyUndeclaredVariable : 280+ occurrences - // PhanTypeMismatchProperty : 190+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 150+ occurrences + // PhanPluginUnknownArrayMethodParamType : 310+ occurrences + // PhanPossiblyUndeclaredVariable : 270+ occurrences + // PhanTypeMismatchProperty : 180+ occurrences // PhanPluginUnknownArrayFunctionParamType : 140+ occurrences - // PhanPluginUnknownObjectMethodCall : 130+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 80+ occurrences - // PhanPluginUndeclaredVariableIsset : 70+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 140+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 75+ occurrences // PhanPluginUnknownArrayPropertyType : 70+ occurrences - // PhanPluginEmptyStatementIf : 55+ occurrences + // PhanPluginUnknownObjectMethodCall : 70+ occurrences + // PhanPluginUndeclaredVariableIsset : 65+ occurrences + // PhanPluginEmptyStatementIf : 50+ occurrences // PhanRedefineFunction : 50+ occurrences // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences @@ -40,8 +40,8 @@ return [ // PhanUndeclaredMethod : 10+ occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences + // PhanParamTooMany : 5 occurrences // PhanTypeExpectedObjectPropAccessButGotNull : 5 occurrences - // PhanParamTooMany : 4 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences @@ -58,12 +58,11 @@ return [ 'htdocs/adherents/stats/index.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], - 'htdocs/api/class/api_documents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], '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/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/asset/class/assetaccountancycodes.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanTypeInvalidDimOffset'], @@ -79,14 +78,14 @@ return [ 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/blockedlog/ajax/block-info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/blockedlog/class/blockedlog.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/bom/bom_card.php' => ['PhanUndeclaredProperty'], 'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/bom/class/bom.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/bom/lib/bom.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/bookcal/availabilities_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/bookcal/availabilities_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookcal/booking_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -117,7 +116,7 @@ return [ 'htdocs/comm/action/peruser.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray'], 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], + 'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/comm/mailing/class/html.formadvtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/comm/mailing/class/mailing.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], @@ -337,7 +336,6 @@ return [ 'htdocs/core/db/sqlite3.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeComparisonFromArray', 'PhanUndeclaredProperty'], 'htdocs/core/extrafieldsinimport.inc.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionParamType', 'PhanTypeInvalidDimOffset'], - 'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/lib/accounting.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/admin.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/lib/agenda.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -354,7 +352,6 @@ return [ 'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/fichinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], @@ -380,19 +377,15 @@ return [ 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/product.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/propal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/receiptprinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/reception.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/report.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/resource.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/supplier_proposal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], @@ -406,7 +399,6 @@ return [ 'htdocs/core/modules/action/modules_action.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/barcode/doc/phpbarcode.modules.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/barcode/modules_barcode.class.php' => ['PhanPluginUnknownPropertyType'], @@ -415,32 +407,26 @@ return [ 'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanUndeclaredMethod'], 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/dons/modules_don.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/mod_facture_mercure.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/core/modules/import/modules_import.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchDimFetch'], - 'htdocs/core/modules/mailings/advthirdparties.modules.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -449,27 +435,21 @@ return [ 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/modules/oauth/stripelive_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/modules/oauth/stripetest_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/modules/printing/modules_printing.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], + 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanParamTooMany'], 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/product_batch/mod_sn_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/project/mod_project_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/propale/mod_propale_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], @@ -479,7 +459,7 @@ return [ 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], @@ -492,18 +472,13 @@ return [ 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanPluginConstantVariableNull', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/takepos/mod_takepos_ref_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/core/modules/ticket/mod_ticket_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/commonfields_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/core/tpl/contacts.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/extrafields_edit.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/core/tpl/extrafields_list_search_title.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -523,9 +498,9 @@ return [ 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_add.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modNotification_Notification.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -535,7 +510,6 @@ return [ 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp'], 'htdocs/cron/class/cronjob.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/datapolicy/class/datapolicy.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/lib/datapolicy.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -551,7 +525,7 @@ return [ 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/document.php' => ['PhanRedefineFunction'], - 'htdocs/don/admin/donation.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], @@ -579,17 +553,17 @@ return [ 'htdocs/emailcollector/class/emailcollectorfilter.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/emailcollector/lib/emailcollector.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/eventorganization/class/conferenceorbooth.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], + 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/expedition/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expedition/class/expedition.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'], 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/expedition/class/expeditionstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expedition/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -613,8 +587,7 @@ return [ 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/fichinter/class/fichinter.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], @@ -625,7 +598,6 @@ return [ 'htdocs/fourn/class/fournisseur.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/fourn/class/fournisseur.facture-rec.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'], 'htdocs/fourn/class/paiementfourn.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/commande/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/fourn/commande/contact.php' => ['PhanUndeclaredGlobalVariable'], @@ -636,12 +608,12 @@ return [ 'htdocs/fourn/commande/note.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/contact.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/fourn/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/fourn/facture/list-rec.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/facture/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], + 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/product/list.php' => ['PhanUndeclaredGlobalVariable'], @@ -652,20 +624,19 @@ return [ 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/hrm/admin/admin_hrm.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/hrm/class/evaluation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/evaluationdet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/job.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/position.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/skill.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/skilldet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/hrm/class/skillrank.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'], + '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' => ['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', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/hrm/evaluation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/hrm/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/hrm/job_agenda.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/hrm/job_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/hrm/job_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/hrm/lib/hrm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/hrm/lib/hrm_job.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -673,11 +644,9 @@ return [ 'htdocs/hrm/lib/hrm_skill.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/hrm/lib/hrm_skilldet.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/hrm/lib/hrm_skillrank.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/hrm/position_card.php' => ['PhanTypeMismatchArgumentProbablyReal'], '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'], @@ -690,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'], @@ -715,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'], @@ -765,7 +731,7 @@ return [ 'htdocs/product/dynamic_price/class/price_global_variable_updater.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], 'htdocs/product/dynamic_price/class/price_parser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/inventory/lib/inventory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -902,9 +868,9 @@ return [ 'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], + 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'], - 'htdocs/resource/element_resource.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/resource/element_resource.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -982,7 +948,6 @@ return [ 'htdocs/user/class/api_users.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/user/class/user.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/user/class/usergroup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/user/group/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/passwordforgotten.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'], @@ -998,16 +963,14 @@ return [ 'htdocs/webhook/lib/webhook_target.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/webhook/target_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/webportal/class/context.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/webportal/class/context.class.php' => ['PhanPluginUnknownArrayMethodParamType'], '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'], - 'htdocs/webportal/class/webPortalTheme.class.php' => ['PhanPluginUnknownPropertyType'], + '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/webportalorder.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webportal/lib/webportal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_category.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], diff --git a/htdocs/comm/propal/class/propaleligne.class.php b/htdocs/comm/propal/class/propaleligne.class.php index 7db29b27bc573..0c1e1ccc2b5a9 100644 --- a/htdocs/comm/propal/class/propaleligne.class.php +++ b/htdocs/comm/propal/class/propaleligne.class.php @@ -257,7 +257,7 @@ class PropaleLigne extends CommonObjectLine /** * Product use lot - * @var string + * @var int */ public $product_tobatch; @@ -445,7 +445,7 @@ public function fetch($rowid) /** * Insert object line propal in database * - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK */ public function insert($notrigger = 0) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 0e3423fd91c60..e613e3dc38699 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -914,7 +914,7 @@ public function get_substitutionarray_shipment($object, $outputlangs, $array_key $array_key.'_tracking_number' => $object->tracking_number, $array_key.'_tracking_url' => $object->tracking_url, $array_key.'_shipping_method' => $object->listmeths[0]['libelle'], - $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units), + $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', (string) $object->weight_units), $array_key.'_width' => $object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units), $array_key.'_height' => $object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units), $array_key.'_depth' => $object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units), diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index d0210edc9c141..0f82d2a5fe480 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -162,7 +162,7 @@ abstract class CommonOrderLine extends CommonObjectLine /** * Product use lot - * @var string + * @var int */ public $product_tobatch; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 43b7dd590c9c3..b5061e091ed3a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9537,8 +9537,8 @@ public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleI * Show block with links "to link to" other objects. * * @param CommonObject $object Object we want to show links to - * @param string[] $restrictlinksto Restrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction. - * @param string[] $excludelinksto Do not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion. + * @param string[]|null $restrictlinksto Restrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction. + * @param string[]|null $excludelinksto Do not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion. * @param int<0,1> $nooutput 1=Return array with content instead of printing it. * @return array{linktoelem:string,htmltoenteralink:string}|string HTML block */ diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 2b5fc8f69d4c4..39cdc266baee3 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This file is a modified version of datepicker.php from phpBSM to fix some * bugs, to add new features and to dramatically increase speed. @@ -111,9 +112,9 @@ $toprightmenu .= '
'; // Login name with photo and tooltip -$mode = -1; +$picto = -1; $toprightmenu .= '
'; $toprightmenu .= '
'."\n"; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 99e354a332ee0..64b91da020677 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -31,7 +31,7 @@ /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param CommonObject $object Object related to tabs * @return array Array of tabs to show */ function fichinter_prepare_head($object) @@ -165,7 +165,7 @@ function fichinter_prepare_head($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array head array with tabs */ function fichinter_admin_prepare_head() { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a130384a93b78..430f6c8c53827 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7614,7 +7614,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, * @param Societe $thirdparty_buyer Thirdparty buyer * @param int $idprod Id product * @param int $idprodfournprice Id supplier price for product - * @return float 0 or 1 + * @return int<0,1> 0 or 1 * @see get_default_tva(), get_default_localtax() */ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0) @@ -13142,7 +13142,7 @@ function getElementProperties($elementType) * @param string $element_ref Element ref (Use this or element_id but not both. If id and ref are empty, object with no fetch is returned) * @param int<0,2> $useCache If you want to store object in cache or get it from cache 0 => no use cache , 1 use cache, 2 force reload cache * @param int $maxCacheByType Number of object in cache for this element type - * @return int<-1,0>|object object || 0 || <0 if error + * @return int<-1,0>|CommonObject object || 0 || <0 if error * @see getElementProperties() */ function fetchObjectByElement($element_id, $element_type, $element_ref = '', $useCache = 0, $maxCacheByType = 10) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index c519060c07e4b..a21389385a7ba 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -903,12 +903,12 @@ function array2table($data, $tableMarkup = 1, $tableoptions = '', $troptions = ' * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for example to filter on invoice types) - * @param Societe|'' $objsoc The company that own the object we need a counter for + * @param null|Societe|'' $objsoc The company that own the object we need a counter for * @param int|'' $date Date to use for the {y},{m},{d} tags. is timestamp or '' to use dol_now() * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) - * @param User $objuser Object user we need data from. - * @param string $forceentity Entity id to force, can be '0' or '1' or '1,2' etc + * @param ?User $objuser Object user we need data from. + * @param ?string $forceentity Entity id to force, can be '0' or '1' or '1,2' etc * @return string New value (numeric) or error message */ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $date = '', $mode = 'next', $bentityon = true, $objuser = null, $forceentity = null) @@ -916,7 +916,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ global $user; if (!is_object($objsoc)) { - $valueforccc = $objsoc; + $valueforccc = (string) $objsoc; } elseif ($table == "commande_fournisseur" || $table == "facture_fourn" || $table == "paiementfourn") { $valueforccc = dol_string_unaccent($objsoc->code_fournisseur); } else { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 9ffeb95e9f4b8..40ac55b3ba7e8 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1008,7 +1008,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param TCPDF $pdf The PDF factory * @param Translate $outputlangs Object lang for output * @param string $paramfreetext Constant name of free text - * @param Societe $fromcompany Object company + * @param ?Societe $fromcompany Object company * @param int $marge_basse Margin bottom we use for the autobreak * @param int $marge_gauche Margin left (no more used) * @param int $page_hauteur Page height @@ -1034,8 +1034,10 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (empty($hidefreetext) && getDolGlobalString($paramfreetext)) { $substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object); // More substitution keys - $substitutionarray['__FROM_NAME__'] = $fromcompany->name; - $substitutionarray['__FROM_EMAIL__'] = $fromcompany->email; + if (is_object($fromcompany)) { + $substitutionarray['__FROM_NAME__'] = $fromcompany->name; + $substitutionarray['__FROM_EMAIL__'] = $fromcompany->email; + } complete_substitutions_array($substitutionarray, $outputlangs, $object); $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray, $outputlangs); @@ -1054,7 +1056,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line3 = ""; $line4 = ""; - if ($showdetails == 1 || $showdetails == 3) { + if (is_object($fromcompany) && in_array($showdetails, array(1, 3))) { // Company name if ($fromcompany->name) { $line1 .= ($line1 ? " - " : "").$outputlangs->transnoentities("RegisteredOffice").": ".$fromcompany->name; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index e0b5e000c330a..153d8e7029259 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -27,7 +27,7 @@ /** * Prepare array with list of tabs * - * @param object $object Object related to tabs + * @param Propal $object Object related to tabs * @return array Array of tabs to show */ function propal_prepare_head($object) @@ -154,7 +154,7 @@ function propal_prepare_head($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array head array with tabs */ function propal_admin_prepare_head() { diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index fbc0baf93cd08..be2a11c4c0221 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -48,12 +48,12 @@ function dol_getwebuser($mode) /** * Return a login if login/pass was successful * - * @param string $usertotest Login value to test - * @param string $passwordtotest Password value to test - * @param string $entitytotest Instance of data we must check - * @param array $authmode Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...) - * @param string $context Context checkLoginPassEntity was created for ('api', 'dav', 'ws', '') - * @return string Login or '' or '--bad-login-validity--' + * @param string $usertotest Login value to test + * @param string $passwordtotest Password value to test + * @param string $entitytotest Instance of data we must check + * @param string[] $authmode Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...) + * @param 'api'|'dav'|'ws'|'' $context Context checkLoginPassEntity was created for ('api', 'dav', 'ws', '') + * @return string Login or '' or '--bad-login-validity--' */ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode, $context = '') { @@ -175,6 +175,7 @@ function dol_loginfunction($langs, $conf, $mysoc) */ // Select templates dir + $template_dir = ''; if (!empty($conf->modules_parts['tpl'])) { // Using this feature slow down application $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl/')); foreach ($dirtpls as $reldir) { @@ -394,6 +395,7 @@ function encodedecode_dbpassconf($level = 0) $lineofpass = 0; $reg = array(); + $mode = ''; if (preg_match('/^[^#]*dolibarr_main_db_encrypted_pass[\s]*=[\s]*(.*)/i', $buffer, $reg)) { // Old way to save encrypted value $val = trim($reg[1]); // This also remove CR/LF $val = preg_replace('/^["\']/', '', $val); @@ -479,8 +481,8 @@ function encodedecode_dbpassconf($level = 0) /** * Return a generated password using default module * - * @param boolean $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module - * @param array $replaceambiguouschars Discard ambiguous characters. For example array('I'). + * @param bool $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module + * @param ?array $replaceambiguouschars Discard ambiguous characters. For example array('I'). * @param int $length Length of random string (Used only if $generic is true) * @return string New value for password * @see dol_hash(), dolJSToSetRandomPassword() @@ -542,6 +544,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len //print DOL_DOCUMENT_ROOT."/core/modules/security/generate/".$nomclass; require_once DOL_DOCUMENT_ROOT."/core/modules/security/generate/".$nomfichier; $genhandler = new $nomclass($db, $conf, $langs, $user); + '@phan-var-force ModeleGenPassword $genhandler'; $generated_password = $genhandler->getNewGeneratedPassword(); unset($genhandler); } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 19fe34df9455a..38148b222a0d8 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -30,7 +30,7 @@ /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param Expedition $object Object related to tabs * @return array Array of tabs to show */ function shipping_prepare_head($object) @@ -320,6 +320,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Define output language if (getDolGlobalInt('MAIN_MULTILANGS') && getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { $object = new $origin($db); + '@phan-var-force CommonObject $object'; $object->fetch($origin_id); $object->fetch_thirdparty(); @@ -356,7 +357,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $text = $product_static->getNomUrl(1); $text .= ' - '.$label; $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); + print $form->textwithtooltip($text, $description, 3, 0, '', $i); // Show range print_date_range($objp->date_start, $objp->date_end); @@ -377,7 +378,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') if (!empty($objp->label)) { $text .= ' '.$objp->label.''; - print $form->textwithtooltip($text, $objp->description, 3, '', '', $i); + print $form->textwithtooltip($text, $objp->description, 3, 0, '', $i); } else { print $text.' '.nl2br($objp->description); } @@ -452,6 +453,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } if (!empty($receiving)) { + '@phan-var-force Delivery $receiving'; // $expedition->fk_elementdet = id of det line of order // $receiving->fk_origin_line = id of det line of order // $receiving->origin may be 'shipping' diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index 6540b0140f79f..3ba952cce74cf 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -20,15 +20,15 @@ */ /** - * \file htdocs/core/lib/propal.lib.php - * \brief Ensemble de functions de base pour le module propal - * \ingroup propal + * \file htdocs/core/lib/supplier_proposal.lib.php + * \brief Ensemble de functions de base pour le module supplier_proposal + * \ingroup supplier_proposal */ /** * Prepare array with list of tabs * - * @param object $object Object related to tabs + * @param SupplierProposal $object Object related to tabs * @return array Array of tabs to show */ function supplier_proposal_prepare_head($object) @@ -108,7 +108,7 @@ function supplier_proposal_prepare_head($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array head array with tabs */ function supplier_proposal_admin_prepare_head() { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 4a14a1778bccd..ac6dd9e175907 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -69,8 +69,17 @@ class pdf_espadon extends ModelePdfExpedition */ public $version = 'dolibarr'; + /** + * @var int|float + */ public $posxweightvol; + /** + * @var int|float + */ public $posxqtytoship; + /** + * @var int|float + */ public $posxqtyordered; @@ -865,7 +874,7 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if (!empty($object->trueWeight)) { - $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); + $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, (int) $object->weight_units, "weight", $outputlangs); } if (!empty($object->trueVolume)) { if ($object->volume_units < 50) { @@ -967,7 +976,7 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ * * @param TCPDF $pdf Object PDF * @param Expedition $object Object to show - * @param int $showaddress 0=no, 1=yes + * @param int<0,1> $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return float|int Return topshift value */ @@ -1066,6 +1075,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) $classname = ucfirst($origin); $linkedobject = new $classname($this->db); + '@phan-var-force Commande|Facture $linkedobject'; $result = $linkedobject->fetch($origin_id); if ($result >= 0) { //$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 703e74ea93b05..aef58954d1034 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -69,8 +69,17 @@ class pdf_rouget extends ModelePdfExpedition */ public $version = 'dolibarr'; + /** + * @var float|int + */ public $posxweightvol; + /** + * @var float|int + */ public $posxqtytoship; + /** + * @var float|int + */ public $posxqtyordered; @@ -757,7 +766,7 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if (!empty($object->trueWeight)) { - $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); + $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, (int) $object->weight_units, "weight", $outputlangs); } if (!empty($object->trueVolume)) { $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); @@ -999,6 +1008,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) $classname = ucfirst($origin); $linkedobject = new $classname($this->db); + '@phan-var-force Commande|Facture $linkedobject'; $result = $linkedobject->fetch($origin_id); if ($result >= 0) { //$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 9afb01fc36145..4a48aba4c93bc 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -318,7 +318,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } // Fetch info for linked propal - $object->fetchObjectLinked('', '', '', ''); + $object->fetchObjectLinked(0, '', null, ''); //print_r($object->linkedObjects['propal']); exit; $propal_object = null; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index a5c2218efec5c..864338b5bca9e 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -98,32 +98,32 @@ class ModeleImports // Array of all drivers /** - * @var string[] + * @var array */ public $driverlabel = array(); /** - * @var string[] + * @var array */ public $driverdesc = array(); /** - * @var string[] + * @var array */ public $driverversion = array(); /** - * @var string[] + * @var array */ public $drivererror = array(); /** - * @var string[] + * @var array */ public $liblabel = array(); /** - * @var string[] + * @var array */ public $libversion = array(); @@ -133,7 +133,7 @@ class ModeleImports public $charset; /** - * @var string picto + * @var array|string picto */ public $picto; @@ -158,7 +158,7 @@ class ModeleImports public $thirdpartyobject; /** - * @var array Element mapping from table name + * @var array Element mapping from table name */ public static $mapTableToElement = MODULE_MAPPING; @@ -256,8 +256,8 @@ public function getLibVersion() * Load into memory list of available import format * * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates + * @param int $maxfilenamelength Max length of value to show + * @return array List of templates */ public function listOfAvailableImportFormat($db, $maxfilenamelength = 0) { @@ -279,17 +279,18 @@ public function listOfAvailableImportFormat($db, $maxfilenamelength = 0) require_once $file; $module = new $classname($db, ''); + '@phan-var-force ModeleImports $module'; // Picto $this->picto[$module->id] = $module->picto; // Driver properties - $this->driverlabel[$module->id] = $module->getDriverLabel(''); - $this->driverdesc[$module->id] = $module->getDriverDesc(''); - $this->driverversion[$module->id] = $module->getDriverVersion(''); + $this->driverlabel[$module->id] = $module->getDriverLabel(); + $this->driverdesc[$module->id] = $module->getDriverDesc(); + $this->driverversion[$module->id] = $module->getDriverVersion(); $this->drivererror[$module->id] = $module->error ? $module->error : ''; // If use an external lib - $this->liblabel[$module->id] = ($module->error ? ''.$module->error.'' : $module->getLibLabel('')); - $this->libversion[$module->id] = $module->getLibVersion(''); + $this->liblabel[$module->id] = ($module->error ? ''.$module->error.'' : $module->getLibLabel()); + $this->libversion[$module->id] = $module->getLibVersion(); } } } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index ab337600a1a5c..9546c9953d476 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -57,9 +57,9 @@ public function __construct($db) * This is the main function that returns the array of emails * * @param int $mailing_id Id of mailing. No need to use it. - * @param array $socid Array of id soc to add + * @param int[] $socid Array of id soc to add * @param int $type_of_target Defined in advtargetemailing.class.php - * @param array $contactid Array of contact id to add + * @param int[] $contactid Array of contact id to add * @return int Return integer <0 if error, number of emails added if ok */ public function add_to_target_spec($mailing_id, $socid, $type_of_target, $contactid) @@ -290,7 +290,7 @@ public function formFilter() * Can include an URL link on each record provided by selector shown on target page. * * @param int $id ID - * @param string $type type + * @param string $type type * @return string Url link */ public function url($id, $type) diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index e3da7ee447c9c..bd592e42a73b8 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -168,6 +168,7 @@ if ($apiService === null) { dol_syslog("No API Service", LOG_ERR); } else { + '@phan-var-force OAuth\OAuth2\Service\AbstractService|OAuth\OAuth1\Service\AbstractService $apiService'; $url = $apiService->getAuthorizationUri(array('state' => GETPOST('state'))); } } else { diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 753ccd10c408d..32338d822eb17 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -1,6 +1,7 @@ * 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 @@ -50,9 +51,12 @@ //$currentUri->setQuery(''); $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripetest_oauthcallback.php'); +$state = null; +$apiService = null; + /** - * Load the credential for the service + * Load the credentials for the service */ /** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */ @@ -128,6 +132,7 @@ // This was a callback request from service, get the token try { + '@phan-var-force OAuth\OAuth2\Service\AbstractService|OAuth\OAuth1\Service\AbstractService $apiService'; //var_dump($state); //var_dump($apiService); // OAuth\OAuth2\Service\Stripe @@ -157,7 +162,12 @@ // This may create record into oauth_state before the header redirect. // Creation of record with state in this tables depend on the Provider used (see its constructor). if (GETPOST('state')) { - $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); + if (is_object($apiService)) { // @phpstan-ignore-line + '@phan-var-force OAuth\OAuth2\Service\AbstractService|OAuth\OAuth1\Service\AbstractService $apiService'; + $url = $apiService->getAuthorizationUri(array('state' => GETPOST('state'))); + } else { + $url = null; + } } else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index 47c35ceb59769..f9def22474bb1 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -47,7 +47,7 @@ class ModelePDFLabels * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates + * @return string[]|int<-1,0> List of templates */ public function liste_modeles($db, $maxfilenamelength = 0) { @@ -68,7 +68,7 @@ public function liste_modeles($db, $maxfilenamelength = 0) * Create a document onto disk according to template module. * * @param DoliDB $db Database handler - * @param array $arrayofrecords Array of records + * @param array{} $arrayofrecords Array of records * @param string $modele Force le modele a utiliser ('' to not force) * @param Translate $outputlangs Object lang a utiliser pour traduction * @param string $outputdir Output directory @@ -143,6 +143,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp require_once $file; $obj = new $classname($db); + '@phan-var-force CommonStickerGenerator $obj'; // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 575cc265eb876..403db12d2d77e 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -31,6 +31,14 @@ * $arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); * $file */ +' +@phan-var-force int<0,1> $diroutput +@phan-var-force string $defaulttopic +@phan-var-force string $defaulttopiclang +@phan-var-force string[] $arrayoffamiliestoexclude +@phan-var-force string $file +@phan-var-force CommonObject $object +'; // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { @@ -46,9 +54,6 @@ $titreform = 'SendMail'; $object->fetch_projet(); - if (!isset($file)) { - $file = null; - } $ref = dol_sanitizeFileName($object->ref); if (!in_array($object->element, array('user', 'member'))) { //$fileparams['fullname'] can be filled from the card @@ -198,22 +203,28 @@ // Define $liste, a list of recipients with email inside <>. $liste = array(); if ($object->element == 'expensereport') { + '@phan-var-force ExpenseReport $object'; $fuser = new User($db); $fuser->fetch($object->fk_user_author); $liste['thirdparty'] = $fuser->getFullName($outputlangs)." <".$fuser->email.">"; } elseif ($object->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { + '@phan-var-force Partnership $object'; $fadherent = new Adherent($db); $fadherent->fetch($object->fk_member); $liste['member'] = $fadherent->getFullName($outputlangs)." <".$fadherent->email.">"; } elseif ($object->element == 'societe') { + '@phan-var-force Societe $object'; foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) { $liste[$key] = $value; } } elseif ($object->element == 'contact') { + '@phan-var-force Contact $object'; $liste['contact'] = $object->getFullName($outputlangs)." <".$object->email.">"; } elseif ($object->element == 'user' || $object->element == 'member') { + '@phan-var-force User|Adherent $object'; $liste['thirdparty'] = $object->getFullName($outputlangs)." <".$object->email.">"; } elseif ($object->element == 'salary') { + '@phan-var-force Salary $object'; $fuser = new User($db); $fuser->fetch($object->fk_user); $liste['thirdparty'] = $fuser->getFullName($outputlangs)." <".$fuser->email.">"; @@ -258,6 +269,7 @@ } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); + $emailsendersignature = null; // Overwrite __SENDEREMAIL_SIGNATURE__ with value select into form if ($formmail->fromtype) { $reg = array(); @@ -282,6 +294,7 @@ $substitutionarray['__CHECK_READ__'] = ""; if (is_object($object) && is_object($object->thirdparty)) { $checkRead = 'fetch($origin_id); $tmpobject = $objectsrc; diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 02b8b01d9ca07..1d7b32c004a10 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -95,6 +95,7 @@ } elseif ($val['type'] == 'price') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key); } elseif ($key == 'lang') { + // @phan-suppress-next-line PhanUndeclaredProperty $value = GETPOSTISSET($key) ? GETPOST($key, 'aZ09') : $object->lang; } else { $value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index df68da385bf78..b7be093a4a75a 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2015-2016 Charlie BENKE * Copyright (C) 2021 Frédéric 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 @@ -30,6 +31,12 @@ exit(1); } + +' +@phan-var-force ?CommonObject $object +@phan-var-force ?CommonObject $objectsrc +@phan-var-force ?string $permission +'; if (empty($preselectedtypeofcontact)) { $preselectedtypeofcontact = 0; } @@ -40,7 +47,7 @@ $module = $object->element; // Special cases -if (isset($permissiontoadd) && ! isset($permission)) { +if (isset($permissiontoadd) && !isset($permission)) { $permission = $permissiontoadd; } // TODO Remove this section. We already got $permissiontoadd. @@ -114,7 +121,7 @@
- select_dolusers($user->id, 'userid', 1, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, 0, '', 0, '', 'minwidth100imp widthcentpercentminusxx maxwidth400 userselectcontact'); + select_dolusers($user->id, 'userid', 1, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, '', '', 0, 56, 0, '', 0, '', 'minwidth100imp widthcentpercentminusxx maxwidth400 userselectcontact'); if (empty($hideaddcontactforgroups) && $module == 'project') { print ' '.$langs->trans("or").' '; echo img_object('', 'group', 'class="pictofixedwidth"').$form->select_dolgroups(0, 'groupid', 1, '', 0, '', array(), '0', false, 'minwidth100imp widthcentpercentminusxx maxwidth400 groupselectcontact'); @@ -164,7 +171,7 @@
socid) ? 0 : $object->socid); - $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp maxwidth400 widthcentpercentminusx'); // This also print the select component?> + $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', array(), 0, '', 'minwidth300imp maxwidth400 widthcentpercentminusx'); // This also print the select component?>
element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) { + '@phan-var-force Commande|Facture $objectsrc'; $tmpobject = $objectsrc; } $formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'typecontact', 'external', 'position', 0, 'minwidth150imp widthcentpercentminusx maxwidth200'); ?> @@ -212,6 +220,7 @@ $list = array(); foreach (array('internal', 'external') as $source) { if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) { + '@phan-var-force Commande|Facture $objectsrc'; $contactlist = $objectsrc->liste_contact(-1, $source); } else { $contactlist = $object->liste_contact(-1, $source); @@ -289,13 +298,13 @@ $list = dol_sort_array($list, $sortfield, $sortorder, 1, 0, 1); $arrayfields = array( - 'rowid' => array('label'=>$langs->trans("Id"), 'checked'=>1), - 'nature' => array('label'=>$langs->trans("NatureOfContact"), 'checked'=>1), - 'thirdparty' => array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), - 'contact' => array('label'=>$langs->trans("Users").' | '.$langs->trans("Contacts"), 'checked'=>1), - 'type' => array('label'=>$langs->trans("ContactType"), 'checked'=>1), - 'status' => array('label'=>$langs->trans("Status"), 'checked'=>1), - 'link' => array('label'=>$langs->trans("Link"), 'checked'=>1), + 'rowid' => array('label' => $langs->trans("Id"), 'checked' => 1), + 'nature' => array('label' => $langs->trans("NatureOfContact"), 'checked' => 1), + 'thirdparty' => array('label' => $langs->trans("ThirdParty"), 'checked' => 1), + 'contact' => array('label' => $langs->trans("Users").' | '.$langs->trans("Contacts"), 'checked' => 1), + 'type' => array('label' => $langs->trans("ContactType"), 'checked' => 1), + 'status' => array('label' => $langs->trans("Status"), 'checked' => 1), + 'link' => array('label' => $langs->trans("Link"), 'checked' => 1), ); $param = 'id='.$object->id.'&mainmenu=home'; diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 3f66edd22d7eb..42ed0f8139de4 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -1,11 +1,20 @@ + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit(1); } +' +@phan-var-force string $element +@phan-var-force int $element_id +@phan-var-force string $resource_type +@phan-var-force array,mandatory:int<0,1>}> $linked_resources +'; + $form = new Form($db); diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 0bebaf04e7271..88850010c05a5 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -135,7 +135,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf if ($action == 'ORDER_CLASSIFY_BILLED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); if (isModEnabled("propal") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL')) { - $object->fetchObjectLinked('', 'propal', $object->id, $object->element); + $object->fetchObjectLinked(0, 'propal', $object->id, $object->element); if (!empty($object->linkedObjects['propal'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['propal'] as $element) { @@ -160,7 +160,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // First classify billed the order to allow the proposal classify process if (isModEnabled('order') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) { - $object->fetchObjectLinked('', 'commande', $object->id, $object->element); + $object->fetchObjectLinked(0, 'commande', $object->id, $object->element); if (!empty($object->linkedObjects['commande'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['commande'] as $element) { @@ -179,7 +179,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Second classify billed the proposal. if (isModEnabled("propal") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL')) { - $object->fetchObjectLinked('', 'propal', $object->id, $object->element); + $object->fetchObjectLinked(0, 'propal', $object->id, $object->element); if (!empty($object->linkedObjects['propal'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['propal'] as $element) { @@ -198,7 +198,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, has been replaced with WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead)) if (isModEnabled("shipping") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) { - $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); + $object->fetchObjectLinked(0, 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects['shipping'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['shipping'] as $element) { @@ -219,7 +219,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf } if (isModEnabled("shipping") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE')) { - $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); + $object->fetchObjectLinked(0, 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects['shipping'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['shipping'] as $element) { @@ -241,7 +241,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // First classify billed the order to allow the proposal classify process if (isModEnabled('order') && isModEnabled('workflow') && getDolGlobalString('WORKFLOW_SUM_INVOICES_AMOUNT_CLASSIFY_BILLED_ORDER')) { - $object->fetchObjectLinked('', 'commande', $object->id, $object->element); + $object->fetchObjectLinked(0, 'commande', $object->id, $object->element); if (!empty($object->linkedObjects['commande']) && count($object->linkedObjects['commande']) == 1) { // If the invoice has only 1 source order $orderLinked = reset($object->linkedObjects['commande']); $orderLinked->fetchObjectLinked($orderLinked->id, '', $orderLinked->element); @@ -279,7 +279,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Firstly, we set to purchase order to "Billed" if WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER is set. // After we will set proposals if ((isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER')) { - $object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element); + $object->fetchObjectLinked(0, 'order_supplier', $object->id, $object->element); if (!empty($object->linkedObjects['order_supplier'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['order_supplier'] as $element) { @@ -301,7 +301,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set. if (isModEnabled('supplier_proposal') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL')) { - $object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element); + $object->fetchObjectLinked(0, 'supplier_proposal', $object->id, $object->element); if (!empty($object->linkedObjects['supplier_proposal'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['supplier_proposal'] as $element) { @@ -347,7 +347,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Then set reception to "Billed" if WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE is set if (isModEnabled("reception") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE')) { - $object->fetchObjectLinked('', 'reception', $object->id, $object->element); + $object->fetchObjectLinked(0, 'reception', $object->id, $object->element); if (!empty($object->linkedObjects['reception'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['reception'] as $element) { @@ -375,7 +375,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); if (isModEnabled('order') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')) { - $object->fetchObjectLinked('', 'commande', $object->id, $object->element); + $object->fetchObjectLinked(0, 'commande', $object->id, $object->element); if (!empty($object->linkedObjects['commande'])) { $totalonlinkedelements = 0; foreach ($object->linkedObjects['commande'] as $element) { @@ -541,7 +541,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $diff_array = array_diff_assoc($qtyordred, $qtyshipped); if (count($diff_array) == 0) { //No diff => mean everything is received - $ret = $order->setStatut(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY, null, null, 'SUPPLIER_ORDER_CLOSE'); + $ret = $order->setStatut(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY, null, '', 'SUPPLIER_ORDER_CLOSE'); if ($ret < 0) { $this->setErrorsFromObject($order); return $ret; diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index bebebda84c113..8421b84c92438 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric 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 @@ -37,6 +38,9 @@ class DataPolicy */ public $db; + /** + * @var string + */ public $error; @@ -165,7 +169,7 @@ public function getAllAdherentsNotInformed() /** * sendMailDataPolicyContact * - * @param mixed $contact Contact + * @param Contact $contact Contact * @return void */ public static function sendMailDataPolicyContact($contact) diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 9f7faf9b6caea..176ea270768f2 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -68,6 +68,7 @@ $classname = (string) $modele; $obj = new $classname($db); + '@phan-var-force ModeleDon $obj'; if ($obj->write_file($don, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html"); @@ -231,6 +232,7 @@ require_once $dir.'/'.$file; $module = new $classname($db); + '@phan-var-force ModeleDon $module'; // Show modules according to features level if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -341,7 +343,7 @@ print ''; print ''; if (isModEnabled('accounting')) { - print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); + print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, array(), 1, 1); } else { print ''; } diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index a03f253f01da4..4d2fa64efcdb2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -398,10 +398,10 @@ public function fetchLines() * @param string $sortfield Sort field * @param int $limit limit * @param int $offset Offset - * @param string|array $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|array $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 ConferenceOrBoothAttendee[]|int<-1,-1> int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -489,9 +489,9 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = /** * Update object into database * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function update(User $user, $notrigger = 0) { @@ -501,9 +501,9 @@ public function update(User $user, $notrigger = 0) /** * Delete object in database * - * @param User $user User that deletes - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function delete(User $user, $notrigger = 0) { @@ -514,10 +514,10 @@ public function delete(User $user, $notrigger = 0) /** * Delete a line of object in database * - * @param User $user User that delete - * @param int $idline Id of line to delete - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int >0 if OK, <0 if KO + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int >0 if OK, <0 if KO */ public function deleteLine(User $user, $idline, $notrigger = 0) { @@ -533,9 +533,9 @@ public function deleteLine(User $user, $idline, $notrigger = 0) /** * Validate object * - * @param User $user User making status change - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO + * @param User $user User making status change + * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO */ public function validate($user, $notrigger = 0) { @@ -1025,7 +1025,7 @@ public function getNextNumRef() * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0696741b37ffa..d2f6b8178a3a6 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -3,6 +3,7 @@ * Copyright (C) 2021 Florian Henry * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric 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 @@ -150,7 +151,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')); @@ -173,7 +174,7 @@ $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBooth"); -$help_url='EN:Module_Event_Organization'; +$help_url = 'EN:Module_Event_Organization'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card'); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index c32f06ee4af5c..90a0c3d2fe150 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -180,7 +181,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')); @@ -205,7 +206,7 @@ $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBoothAttendee"); -$help_url='EN:Module_Event_Organization'; +$help_url = 'EN:Module_Event_Organization'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card'); diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index aab48f79f1f3f..177623d739819 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -43,6 +43,15 @@ exit; } +' +@phan-var-force string $massaction +@phan-var-force string $objectclass +@phan-var-force ?string $diroutputmassaction +@phan-var-force ?string $uploaddir +@phan-var-force string[] $toselect +@phan-var-force array $parameters +'; + // Mass actions. Controls on number of lines checked. $maxformassaction = (!getDolGlobalString('MAIN_LIMIT_FOR_MASS_ACTIONS') ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) { @@ -57,6 +66,7 @@ if (!$error && $massaction == 'confirm_presend_attendees' && !GETPOST('sendmail')) { // If we do not choose button send (for example when we change template or limit), we must not send email, but keep on send email form $massaction = 'presend_attendees'; } + if (!$error && $massaction == 'confirm_presend_attendees') { $resaction = ''; $nbsent = 0; @@ -69,12 +79,13 @@ $listofobjectref = array(); $oneemailperrecipient = (GETPOSTINT('oneemailperrecipient') ? 1 : 0); + $listofselectedid = array(); + $listofselectedref = array(); if (!$error) { require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; $attendee = new ConferenceOrBoothAttendee($db); - $listofselectedid = array(); - $listofselectedref = array(); $objecttmp = new $objectclass($db); + '@phan-var-force CommonObject $objecttmp'; foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); @@ -93,6 +104,7 @@ } } '@phan-var-force CommonObject $objecttmp'; + '@phan-var-force array $listofselectedref'; // Check mandatory parameters if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) { @@ -121,7 +133,7 @@ $massaction = 'presend_attendees'; } - if (!$error) { + if (!$error && !empty($listofselectedid)) { $objecttmp->fetch_thirdparty(); foreach ($listofselectedid as $email => $attendees) { $sendto = ''; @@ -182,6 +194,8 @@ // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object // Make substitution in email content $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $attendees); + $url_link = null; + $html_link = null; if (getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) { $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root)); @@ -269,7 +283,7 @@ } } } - } + } // foreach ($listofselectedid as $email => $attendees) } $resaction .= ($resaction ? '
' : $resaction); $resaction .= '' . $langs->trans("ResultOfMailSending") . ':
' . "\n"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 98c34afed1ce0..469c5ab19f584 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -128,6 +128,10 @@ $permissiondellink = $user->hasRight('expedition', 'delivery', 'creer'); // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->hasRight('expedition', 'creer'); +$editColspan = 0; +$objectsrc = null; +$typeobject = null; + /* * Actions @@ -249,6 +253,7 @@ // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver $classname = ucfirst($object->origin); $objectsrc = new $classname($db); + '@phan-var-force Facture|Commande $objectsrc'; $objectsrc->fetch($object->origin_id); $object->socid = $objectsrc->socid; @@ -909,6 +914,8 @@ $formproduct = new FormProduct($db); if (isModEnabled('project')) { $formproject = new FormProjets($db); +} else { + $formproject = null; } $product_static = new Product($db); @@ -938,6 +945,7 @@ $classname = ucfirst($origin); $object = new $classname($db); + '@phan-var-force Commande|Facture $object'; if ($object->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); $soc->fetch($object->socid); @@ -995,7 +1003,7 @@ print ''; // Project - if (isModEnabled('project')) { + if (isModEnabled('project') && is_object($formproject)) { $projectid = GETPOSTINT('projectid') ? GETPOSTINT('projectid') : 0; if (empty($projectid) && !empty($object->fk_project)) { $projectid = $object->fk_project; @@ -1241,7 +1249,7 @@ $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); $description = ($showdescinproductdesc ? '' : dol_htmlentitiesbr($line->desc)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); + print $form->textwithtooltip($text, $description, 3, 0, '', $i); // Show range print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); @@ -1262,7 +1270,7 @@ if (!empty($line->label)) { $text .= ' '.$line->label.''; - print $form->textwithtooltip($text, $line->desc, 3, '', '', $i); + print $form->textwithtooltip($text, $line->desc, 3, 0, '', $i); } else { print $text.' '.nl2br($line->desc); } @@ -1350,7 +1358,7 @@ if (!getDolGlobalInt('STOCK_ALLOW_NEGATIVE_TRANSFER')) { $stockMin = 0; } - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', '', 1, $stockMin, 'stock DESC, e.ref'); + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref'); if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { //print $stock.' '.$quantityToBeDelivered; @@ -1435,7 +1443,9 @@ $deliverableQty = min($quantityToBeDelivered, $batchStock); } - if ($deliverableQty < 0) $deliverableQty = 0; + if ($deliverableQty < 0) { + $deliverableQty = 0; + } $inputName = 'qtyl'.$indiceAsked.'_'.$subj; if (GETPOSTISSET($inputName)) { @@ -1824,6 +1834,7 @@ } } } elseif ($object->id > 0) { + '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) /* *************************************************************************** */ /* */ /* Edit and view mode */ @@ -2386,7 +2397,7 @@ $text = $product_static->getNomUrl(1); $text .= ' - '.$label; $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); + print $form->textwithtooltip($text, $description, 3, 0, '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : ''); if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; @@ -2402,7 +2413,7 @@ if (!empty($lines[$i]->label)) { $text .= ' '.$lines[$i]->label.''; - print $form->textwithtooltip($text, $lines[$i]->description, 3, '', '', $i); + print $form->textwithtooltip($text, $lines[$i]->description, 3, 0, '', $i); } else { print $text.' '.nl2br($lines[$i]->description); } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 270b0e6e0e238..0ac90b12afbd8 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -100,6 +100,9 @@ class Expedition extends CommonObject */ public $fk_user_author; + /** + * @var int + */ public $socid; /** @@ -128,6 +131,9 @@ class Expedition extends CommonObject * @var string Tracking url */ public $tracking_url; + /** + * @var int<0,1> + */ public $billed; /** @@ -135,32 +141,76 @@ class Expedition extends CommonObject */ public $model_pdf; + /** + * @var int|string + */ public $trueWeight; + /** + * @var int + */ public $weight_units; + /** + * @var int|string + */ public $trueWidth; + /** + * @var string + */ public $width_units; + /** + * @var int|string + */ public $trueHeight; + /** + * @var string + */ public $height_units; + /** + * @var int|string + */ public $trueDepth; + /** + * @var string + */ public $depth_units; - // A denormalized value + /** + * @var string A denormalized value + */ public $trueSize; + /** + * @var int + */ public $livraison_id; /** - * @var double + * @var float */ public $multicurrency_subprice; + /** + * @var int|string + */ public $size_units; + /** + * @var int|string + */ public $sizeH; + /** + * @var int|string + */ public $sizeS; + /** + * @var int|string + */ public $sizeW; + /** + * @var int|string + */ public $weight; /** @@ -169,13 +219,15 @@ class Expedition extends CommonObject public $date_delivery; /** - * @deprecated + * @var int|string + * @deprecated Use $dateshipping * @see $date_shipping */ public $date; /** - * @deprecated + * @var int|string + * @deprecated Use $dateshipping * @see $date_shipping */ public $date_expedition; @@ -191,7 +243,13 @@ class Expedition extends CommonObject */ public $date_valid; + /** + * @var string[] + */ public $meths; + /** + * @var array> + */ public $listmeths; // List of carriers /** @@ -219,9 +277,21 @@ class Expedition extends CommonObject * @var string multicurrency code */ public $multicurrency_code; + /** + * @var float + */ public $multicurrency_tx; + /** + * @var float + */ public $multicurrency_total_ht; + /** + * @var float + */ public $multicurrency_total_tva; + /** + * @var float + */ public $multicurrency_total_ttc; /** @@ -506,7 +576,7 @@ public function create($user, $notrigger = 0) * @param int $origin_line_id Id of source line * @param float $qty Quantity * @param int $rang Rang - * @param array $array_options extrafields array + * @param array $array_options extrafields array * @return int Return integer <0 if KO, line_id if OK */ public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = []) @@ -534,8 +604,8 @@ public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $arr /** * Create the detail of the expedition line. Create 1 record into expeditiondet for each warehouse and n record for each lot in this warehouse into expeditiondet_batch. * - * @param object $line_ext Object with full information of line. $line_ext->detail_batch must be an array of ExpeditionLineBatch - * @param array $array_options extrafields array + * @param ExpeditionLigne $line_ext Object with full information of line. $line_ext->detail_batch must be an array of ExpeditionLineBatch + * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ public function create_line_batch($line_ext, $array_options = []) @@ -912,7 +982,7 @@ public function create_delivery($user) * @param int $entrepot_id Id of warehouse * @param int $id Id of source line (order line) * @param float $qty Quantity - * @param array $array_options extrafields array + * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ public function addline($entrepot_id, $id, $qty, $array_options = []) @@ -995,8 +1065,8 @@ public function addline($entrepot_id, $id, $qty, $array_options = []) /** * Add a shipment line with batch record * - * @param array $dbatch Array of value (key 'detail' -> Array, key 'qty' total quantity for line, key ix_l : original line index) - * @param array $array_options extrafields array + * @param array{detail:array,qty:int|float,ix_l:int} $dbatch Array of value (key 'detail' -> Array, key 'qty' total quantity for line, key ix_l : original line index) + * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ public function addline_batch($dbatch, $array_options = []) @@ -1005,6 +1075,7 @@ public function addline_batch($dbatch, $array_options = []) global $conf, $langs; $num = count($this->lines); + $linebatch = null; if ($dbatch['qty'] > 0 || ($dbatch['qty'] == 0 && getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS'))) { $line = new ExpeditionLigne($this->db); $tab = array(); @@ -1043,7 +1114,9 @@ public function addline_batch($dbatch, $array_options = []) //var_dump($linebatch); } } - $line->entrepot_id = $linebatch->entrepot_id; + if (is_object($linebatch)) { + $line->entrepot_id = $linebatch->entrepot_id; + } $line->origin_line_id = $dbatch['ix_l']; // deprecated $line->fk_elementdet = $dbatch['ix_l']; $line->qty = $dbatch['qty']; @@ -1064,9 +1137,9 @@ public function addline_batch($dbatch, $array_options = []) /** * Update database * - * @param User $user User that modify - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies the record + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function update($user = null, $notrigger = 0) { @@ -1090,7 +1163,8 @@ public function update($user = null, $notrigger = 0) if (isset($this->fk_user_author)) { $this->fk_user_author = (int) $this->fk_user_author; } - if (isset($this->fk_user_valid)) { + if (isset($this->fk_user_valid)) { // @phan-ignore-current-line PhanUndeclaredProperty + // If set, then accept @phan-ignore-next-line PhanUndeclaredProperty $this->fk_user_valid = (int) $this->fk_user_valid; } if (isset($this->fk_delivery_address)) { @@ -1118,7 +1192,7 @@ public function update($user = null, $notrigger = 0) $this->size_units = trim($this->size_units); } if (isset($this->weight_units)) { - $this->weight_units = trim($this->weight_units); + $this->weight_units = (int) $this->weight_units; } if (isset($this->trueWeight)) { $this->weight = trim((string) $this->trueWeight); @@ -1332,12 +1406,14 @@ public function cancel($notrigger = 0, $also_update_stock = false) if ($this->db->query($sql)) { if (!empty($this->origin) && $this->origin_id > 0) { $this->fetch_origin(); - if ($this->origin_object->statut == Commande::STATUS_SHIPMENTONPROCESS) { // If order source of shipment is "shipment in progress" + $origin_object = $this->origin_object; + '@phan-var-force Facture|Commande $origin_object'; + if ($origin_object->statut == Commande::STATUS_SHIPMENTONPROCESS) { // If order source of shipment is "shipment in progress" // Check if there is no more shipment. If not, we can move back status of order to "validated" instead of "shipment in progress" - $this->origin_object->loadExpeditions(); + $origin_object->loadExpeditions(); //var_dump($this->$origin->expeditions);exit; - if (count($this->origin_object->expeditions) <= 0) { - $this->origin_object->setStatut(Commande::STATUS_VALIDATED); + if (count($origin_object->expeditions) <= 0) { + $origin_object->setStatut(Commande::STATUS_VALIDATED); } } } @@ -1533,12 +1609,14 @@ public function delete($user = null, $notrigger = 0, $also_update_stock = false) if ($this->db->query($sql)) { if (!empty($this->origin) && $this->origin_id > 0) { $this->fetch_origin(); - if ($this->origin_object->statut == Commande::STATUS_SHIPMENTONPROCESS) { // If order source of shipment is "shipment in progress" + $origin_object = $this->origin_object; + '@phan-var-force Facture|Commande $origin_object'; + if ($origin_object->statut == Commande::STATUS_SHIPMENTONPROCESS) { // If order source of shipment is "shipment in progress" // Check if there is no more shipment. If not, we can move back status of order to "validated" instead of "shipment in progress" - $this->origin_object->loadExpeditions(); + $origin_object->loadExpeditions(); //var_dump($this->$origin->expeditions);exit; - if (count($this->origin_object->expeditions) <= 0) { - $this->origin_object->setStatut(Commande::STATUS_VALIDATED); + if (count($origin_object->expeditions) <= 0) { + $origin_object->setStatut(Commande::STATUS_VALIDATED); } } } @@ -2586,7 +2664,7 @@ public function reOpen() * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/expedition/class/expeditionligne.class.php b/htdocs/expedition/class/expeditionligne.class.php index 5f7aa83c1411a..888c953f7a318 100644 --- a/htdocs/expedition/class/expeditionligne.class.php +++ b/htdocs/expedition/class/expeditionligne.class.php @@ -133,13 +133,13 @@ class ExpeditionLigne extends CommonObjectLine /** * Detail of lot and qty = array(id in llx_expeditiondet_batch, fk_expeditiondet, batch, qty, fk_origin_stock) * We can use this to know warehouse planned to be used for each lot. - * @var stdClass|array{ExpeditionLineBatch} + * @var stdClass|ExpeditionLineBatch[] */ public $detail_batch; /** detail of warehouses and qty * We can use this to know warehouse when there is no lot. - * @var array{stdClass} + * @var stdClass[] */ public $details_entrepot; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 2703f06ebc0df..1fd1c674ba5d0 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -1577,7 +1577,7 @@ print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1); } else { print $object->trueWeight; - print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; + print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", (string) $object->weight_units) : ''; } print ''; if (!$i) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 4b02ea4fe3208..29a289ab55297 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -5,6 +5,7 @@ * Copyright (C) 2012-2015 Juanjo Menent * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018-2022 Philippe Grand + * 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 @@ -207,7 +208,7 @@ if ($action == 'set_thirdparty' && $permissiontoadd) { $object->fetch($id); - $object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY'); + $object->setValueFrom('fk_soc', $socid, '', null, 'date', '', $user, 'ORDER_MODIFY'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 785f2ae4dd8ea..a6d2229662dcc 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -224,7 +224,7 @@ if ($newfichinterid > 0) { // Now we add line of details foreach ($object->lines as $line) { - $newinter->addline($user, $newfichinterid, $line->desc, $line->datei, $line->duree, ''); + $newinter->addline($user, $newfichinterid, $line->desc, $line->datei, $line->duree, array()); } // on update le nombre d'inter crée à partir du modèle diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 8e82e287e58c0..7a7b0f1fc5406 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -788,13 +788,13 @@ public function getAmount() /** * Create a document onto disk according to template module. * - * @param string $modele Force model to use ('' to not force) - * @param Translate $outputlangs Object langs to use for output - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param string $modele Force model to use ('' to not force) + * @param Translate $outputlangs Object langs to use for output + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { @@ -1384,9 +1384,9 @@ public function createFromClone(User $user, $socid = 0) * @param user $user User that do the action * @param int $fichinterid Id of intervention * @param string $desc Line description - * @param integer $date_intervention Intervention date + * @param int $date_intervention Intervention date * @param int $duration Intervention duration - * @param array $array_options Array option + * @param array $array_options Array option * @return int >0 if ok, <0 if ko */ public function addline($user, $fichinterid, $desc, $date_intervention, $duration, $array_options = []) @@ -1615,6 +1615,7 @@ public function getKanbanView($option = '', $arraydata = null) } if (!empty($arraydata['thirdparty'])) { $tmpthirdparty = $arraydata['thirdparty']; + '@phan-var-force Societe $tmpthirdparty'; $return .= '
'.$tmpthirdparty->getNomUrl(1).''; } if (property_exists($this, 'duration')) { diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index ad3ab2b3cb9cb..27ce3013e196c 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -139,6 +139,9 @@ class ProductFournisseur extends Product */ public $fourn_remise; + /** + * @var ?float + */ public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set /** @@ -146,6 +149,9 @@ class ProductFournisseur extends Product */ public $product_fourn_id; + /** + * @var string + */ public $product_fourn_entity; /** @@ -158,9 +164,21 @@ class ProductFournisseur extends Product */ public $fk_availability; + /** + * @var int|string + */ public $fourn_unitprice; + /** + * @var float|int + */ public $fourn_unitprice_with_discount; // not saved into database + /** + * @var string + */ public $fourn_tva_tx; + /** + * @var int<0,1> + */ public $fourn_tva_npr; /** @@ -178,20 +196,33 @@ class ProductFournisseur extends Product */ public $reputations = array(); - // Multicurreny + // Multicurrency /** * @var int ID of multicurrency */ public $fourn_multicurrency_id; + /** + * @var string + */ public $fourn_multicurrency_code; + /** + * @var int|float|string + */ public $fourn_multicurrency_tx; + /** + * @var int|string + */ public $fourn_multicurrency_price; + /** + * @var int|string + */ public $fourn_multicurrency_unitprice; /** - * @deprecated + * @var string + * @deprecated Use $supplier_barcode * @see $supplier_barcode */ public $fourn_barcode; @@ -202,7 +233,8 @@ class ProductFournisseur extends Product public $supplier_barcode; /** - * @deprecated + * @var int + * @deprecated Use $supplier_fk_barcode_type * @see $supplier_fk_barcode_type */ public $fourn_fk_barcode_type; @@ -212,9 +244,18 @@ class ProductFournisseur extends Product */ public $supplier_fk_barcode_type; + /** + * @var float + */ public $packaging; + /** + * @var array + */ public $labelStatusShort; + /** + * @var array + */ public $labelStatus; const STATUS_OPEN = 1; @@ -332,7 +373,7 @@ public function remove_product_fournisseur_price($rowid) * @param int $newnpr Set NPR or not * @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined. * @param string $supplier_reputation Reputation with this product to the defined supplier (empty, FAVORITE, DONOTORDER) - * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). + * @param array{0:string,1:float|int,2:string,3:float|int}|array{} $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). * @param string $newdefaultvatcode Default vat code * @param float $multicurrency_buyprice Purchase price for the quantity min in currency * @param string $multicurrency_price_base_type HT or TTC in currency @@ -341,7 +382,7 @@ public function remove_product_fournisseur_price($rowid) * @param string $desc_fourn Custom description for product_fourn_price * @param string $barcode Barcode * @param int $fk_barcode_type Barcode type - * @param array $options Extrafields of product fourn price + * @param array $options Extrafields of product fourn price * @return int Return integer <0 if KO, >=0 if OK */ public function update_buyprice( @@ -861,7 +902,8 @@ public function list_product_fournisseur_price($prodid, $sortfield = '', $sortor $price_result = $priceparser->parseProductSupplier($prodfourn); if ($price_result >= 0) { $prodfourn->fourn_price = $price_result; - $prodfourn->fourn_unitprice = null; //force recalculation of unitprice, as probably the price changed... + // Set to null on purpose an will have non-null value before method return @phan-suppress-next-line PhanTypeMismatchPropertyProbablyReal + $prodfourn->fourn_unitprice = null; //force recalculation of unitprice, as probably the price changed... @phpstan-ignore-line } } @@ -1000,6 +1042,7 @@ public function find_min_price_product_fournisseur($prodid, $qty = 0, $socid = 0 $this->fourn_id = $record["fourn_id"]; // thirdparty id $this->fourn_name = $record["supplier_name"]; $this->delivery_time_days = $record["delivery_time_days"]; + // False positive @phan-suppress-next-line PhanTypeMismatchProperty $this->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; $this->fourn_multicurrency_price = $record["multicurrency_price"]; $this->fourn_multicurrency_unitprice = $record["multicurrency_unitprice"]; @@ -1074,12 +1117,12 @@ public function getSocNomUrl($withpicto = 0, $option = 'supplier', $maxlen = 0, /** * Display price of product * - * @param int $showunitprice Show "Unit price" into output string - * @param int $showsuptitle Show "Supplier" into output string - * @param int $maxlen Max length of name - * @param integer $notooltip 1=Disable tooltip - * @param array $productFournList list of ProductFournisseur objects - * to display in table format. + * @param int<0,1> $showunitprice Show "Unit price" into output string + * @param int<0,1> $showsuptitle Show "Supplier" into output string + * @param int $maxlen Max length of name + * @param int<0,1> $notooltip 1=Disable tooltip + * @param ProductFournisseur[] $productFournList list of ProductFournisseur objects + * to display in table format. * @return string String with supplier price */ public function display_price_product_fournisseur($showunitprice = 1, $showsuptitle = 1, $maxlen = 0, $notooltip = 0, $productFournList = array()) @@ -1152,7 +1195,7 @@ public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) * @param string $sortorder Sort order * @param int $limit Limit * @param int $offset Offset - * @return array|int Array of Log prices + * @return array|int<-1,-1> Array of Log prices */ public function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) { @@ -1208,8 +1251,8 @@ public function listProductFournisseurPriceLog($product_fourn_price_id, $sortfie /** * Display log price of product supplier price * - * @param array $productFournLogList list of ProductFournisseur price log objects - * to display in table format. + * @param array|int<-1,-1> $productFournLogList list of ProductFournisseur price log objects + * to display in table format. * @return string HTML String with supplier price */ public function displayPriceProductFournisseurLog($productFournLogList = array()) diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 3c3143caed955..95ab5f22e01ef 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -35,6 +35,10 @@ $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +' +@phan-var-force array $linkedObjectBlock +'; + $langs->load("bills"); @@ -68,6 +72,7 @@ } ?> getLibStatut(3, $objectlink->getSommePaiement()); } else { echo $objectlink->getLibStatut(3); diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index fd66faef31c8c..9c9fad5b2de5f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -111,18 +111,57 @@ class Evaluation extends CommonObject 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'Employee', 'enabled' => 1, 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => 1, 'position' => 505, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), ); + /** + * @var int + */ public $rowid; + /** + * @var string + */ public $ref; + /** + * @var string + */ public $label; + /** + * @var string + */ public $description; + /** + * @var string + */ public $note_public; + /** + * @var string + */ public $note_private; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var string + */ public $import_key; + /** + * @var int + */ public $status; + /** + * @var int + */ public $date_eval; + /** + * @var int + */ public $fk_user; + /** + * @var int + */ public $fk_job; // END MODULEBUILDER PROPERTIES @@ -681,8 +720,8 @@ public function cancel($user, $notrigger = 0) /** * Set back to validated status * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @param User $user Object user that modify + * @param int<0,1> $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK */ public function reopen($user, $notrigger = 0) @@ -813,8 +852,8 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss /** * Return the label of the status * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function getLibStatut($mode = 0) { @@ -825,9 +864,9 @@ public function getLibStatut($mode = 0) /** * Return the status * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status + * @param int $status Id status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function LibStatut($status, $mode = 0) { @@ -901,7 +940,7 @@ public function initAsSpecimen() /** * Create an array of lines * - * @return array|int array of lines if OK, <0 if KO + * @return EvaluationLine[]|int array of lines if OK, <0 if KO */ public function getLinesArray() { @@ -955,6 +994,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -979,10 +1019,10 @@ public function getNextNumRef() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 415b2bdfa3f97..48b85070bd869 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -115,13 +115,37 @@ class EvaluationLine extends CommonObjectLine 'required_rank' => array('type' => 'integer', 'label' => 'requiredRank', 'enabled' => 1, 'position' => 5, 'notnull' => 1, 'visible' => 1,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var int + */ public $fk_skill; + /** + * @var int + */ public $fk_evaluation; + /** + * @var int + */ public $fk_rank; + /** + * @var int + */ public $required_rank; + /** + * @var string + */ public $import_key; // END MODULEBUILDER PROPERTIES @@ -933,6 +957,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -955,13 +980,13 @@ public function getNextNumRef() /** * Create a document onto disk according to template module. * - * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 0786e56be7181..1e39ecae61dbb 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -104,13 +104,33 @@ class Job extends CommonObject 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,), ); + /** + * @var int + */ public $rowid; + /** + * @var string + */ public $ref; + /** + * @var string + */ public $label; + /** + * @var string + */ public $description; - + /** + * @var int<0,1> + */ public $deplacement; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; // END MODULEBUILDER PROPERTIES @@ -963,6 +983,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -985,13 +1006,13 @@ public function getNextNumRef() /** * Create a document onto disk according to template module. * - * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index b65fa9db433a7..af171a8857b96 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -108,18 +108,57 @@ class Position extends CommonObject 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,), ); + /** + * @var int + */ public $rowid; + /** + * @var string + */ public $ref; + /** + * @var string + */ public $description; + /** + * @var int + */ public $fk_contrat; + /** + * @var int + */ public $fk_user; + /** + * @var int + */ public $fk_job; + /** + * @var int|string + */ public $date_start; + /** + * @var int|string + */ public $date_end; + /** + * @var string + */ public $abort_comment; + /** + * @var string + */ public $note_public; + /** + * @var string + */ public $note_private; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; @@ -175,9 +214,9 @@ public function __construct(DoliDB $db) $this->ismultientitymanaged = 0; $this->isextrafieldmanaged = 0; - if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) { - //$this->fields['rowid']['visible'] = 0; - } + //if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) { + //$this->fields['rowid']['visible'] = 0; + //} if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } @@ -879,7 +918,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = * Return HTML string to show a field into a page * Code very similar with showOutputField of extra fields * - * @param array $val Array of properties of field to show + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $val Array of properties of field to show * @param string $key Key of attribute * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $moreparam To add more parameters on html input tag @@ -1002,6 +1041,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -1039,13 +1079,13 @@ public function getForUser($userid) /** * Create a document onto disk according to template module. * - * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 51aa62eb5d8c4..8e5b56d0ce7ab 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -112,14 +112,41 @@ 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 + */ public $label; + /** + * @var string + */ public $description; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var int + */ public $required_level; - public $date_validite; + /** + * @var int|string + */ + public $date_validite; // Note: misspelled! + /** + * @var float + */ public $temps_theorique; + /** + * @var int + */ public $skill_type; // END MODULEBUILDER PROPERTIES @@ -1003,6 +1030,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -1027,10 +1055,10 @@ public function getNextNumRef() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e3cdd24c47387..9beb444b05f9f 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -109,11 +109,29 @@ class Skilldet extends CommonObjectLine 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => 0,), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $fk_skill; + /** + * @var int + */ public $rankorder; + /** + * @var string + */ public $description; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; // END MODULEBUILDER PROPERTIES @@ -354,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') { @@ -901,6 +919,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -925,10 +944,10 @@ public function getNextNumRef() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index f7d4e24821b48..6b84858021da8 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -106,14 +106,38 @@ class SkillRank extends CommonObject 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,), 'objecttype' => array('type' => 'varchar(128)', 'label' => 'objecttype', 'enabled' => 1, 'position' => 6, 'notnull' => 1, 'visible' => 0,), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $fk_skill; + /** + * @var int + */ public $rank; + /** + * @var int + */ public $fk_object; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var string + */ public $objecttype; // END MODULEBUILDER PROPERTIES + /** + * @var int + */ public $rankorder; @@ -394,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') { @@ -966,6 +990,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefEvaluation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -990,10 +1015,10 @@ public function getNextNumRef() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index a20e2eaa1e03b..75746483858f1 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -144,7 +144,7 @@ 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')); @@ -171,6 +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'; $errors = 0; // we go through the evaldets of the eval @@ -182,7 +183,7 @@ if ($resCreate <= 0) { $errors++; - setEventMessage($langs->trans('ErrorCreateUserSkill'), $line->fk_skill); + setEventMessage($langs->trans('ErrorCreateUserSkill', $line->fk_skill)); } } else { //check if the skill is present to use it diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index c70f0c5305c5d..2a436cbc17c62 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -142,7 +143,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')); @@ -375,7 +376,7 @@ $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref = '
'; - $morehtmlref.= $object->label; + $morehtmlref .= $object->label; $morehtmlref .= '
'; @@ -391,7 +392,7 @@ //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $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. diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 2a667f4dad7d9..26e30632889ec 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -164,7 +165,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')); @@ -308,8 +309,8 @@ function displayPositionCard(&$object) //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $object->fields['fk_user']['visible']=0; // Already in banner - $object->fields['fk_job']['visible']=0; // Already in banner + $object->fields['fk_user']['visible'] = 0; // Already in banner + $object->fields['fk_job']['visible'] = 0; // Already in banner include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; // Other attributes. Fields from hook formObjectOptions and Extrafields. diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 257fbca5e3fde..1cd35d8a8cdf4 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2023-2024 Frédéric 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 @@ -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])) { @@ -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')); @@ -306,6 +308,7 @@ // SKILLDET $SkilldetRecords = $object->fetchLines(); + '@phan-var-force Skilldet[] $SkilldetRecords'; if (is_array($SkilldetRecords) && count($SkilldetRecords) == 0) { $object->createSkills(1); @@ -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') { @@ -457,7 +460,7 @@ $morehtmlref = '
'; - $morehtmlref.= $object->label; + $morehtmlref .= $object->label; $morehtmlref .= '
'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); @@ -467,7 +470,7 @@ print '
'; print '' . "\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. diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 66354128fc820..cdfa1ec020426 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -6,6 +6,7 @@ * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -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'); @@ -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; @@ -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(); @@ -251,7 +256,7 @@ $morehtmlref .= ''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); - } else { + } elseif ($listLink !== null) { $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref = ''; @@ -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); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 8ca9a2e5914b5..ee047d046289a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -234,6 +234,9 @@ } $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; + $versiontoarray = array(); + $versionranarray = array(); + if (!$error) { if (count($listofentities) > 1) { print ''."\n"; @@ -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'); @@ -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'); @@ -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'); @@ -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) { @@ -788,8 +792,8 @@ function migrate_paiements($db, $langs, $conf) if ($num) { print $langs->trans('MigrationPaymentsNumberToUpdate', $num)."
\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)"; @@ -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')."
"; } else { @@ -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 $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) { @@ -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 @@ -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); diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index f43a8bce42da1..af64bf6c9cf1c 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -109,14 +109,41 @@ class KnowledgeRecord extends CommonObject 'answer' => array('type' => 'html', 'label' => 'Solution', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 3, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Obsolete'),), ); + /** + * @var int + */ public $rowid; + /** + * @var string + */ public $ref; + /** + * @var int + */ public $entity; + /** + * @var string + */ public $last_main_doc; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var int + */ public $fk_user_valid; + /** + * @var string + */ public $import_key; + /** + * @var string + */ public $model_pdf; /** @@ -128,8 +155,17 @@ class KnowledgeRecord extends CommonObject * @var string answer to question */ public $answer; + /** + * @var string + */ public $url; + /** + * @var int + */ public $status; + /** + * @var string + */ public $lang; // END MODULEBUILDER PROPERTIES @@ -361,9 +397,9 @@ public function fetchLines() * @param string $sortfield Sort field * @param int $limit Limit * @param int $offset Offset - * @param string|array $filter Filter USF. - * @param string $filtermode Filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @param string|array $filter Filter USF. + * @param 'AND'|'OR' $filtermode Filter mode (AND or OR) + * @return self[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -968,7 +1004,7 @@ public function initAsSpecimen() /** * Create an array of lines * - * @return array|int array of lines if OK, <0 if KO + * @return KnowledgeRecordLine[]|int array of lines if OK, <0 if KO */ public function getLinesArray() { @@ -1023,6 +1059,7 @@ public function getNextNumRef() if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefKnowledgeRecord $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -1047,10 +1084,10 @@ public function getNextNumRef() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index 8ff163103894c..d12865c47c01e 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -37,6 +37,9 @@ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + /** + * @var string + */ public $prefix = 'KM'; /** diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 0a06ab4593289..2ec414ecbb590 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -1,5 +1,6 @@ + * 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 @@ -139,7 +140,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')); @@ -425,7 +426,7 @@ print '
*** '.$langs->trans("Entity").' '.$entity.'
'."\n"; // Common attributes - $keyforbreak='fk_c_ticket_category'; // We change column just before this field + $keyforbreak = 'fk_c_ticket_category'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner $object->fields['answer']['enabled'] = 0; diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php index d1de9e5e401e8..d2b6c050d3ebe 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php @@ -1,5 +1,6 @@ * * 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 @@ -24,7 +25,7 @@ /** * Prepare admin pages header * - * @return array + * @return array */ function knowledgemanagementAdminPrepareHead() { diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php index f25521130572b..9b3c22b119497 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Prepare array of tabs for KnowledgeRecord * * @param KnowledgeRecord $object KnowledgeRecord - * @return array Array of tabs + * @return array Array of tabs */ function knowledgerecordPrepareHead($object) { diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index af8e0ba1d6093..2d8b5f89b2f5e 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -3,6 +3,7 @@ * Copyright (C) 2015 Frederic France * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Maxime DEMAREST + * 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 @@ -242,7 +243,7 @@ if ($action == 'setlabel' && $permissiontoadd) { $object->fetch($id); - $result = $object->setValueFrom('label', GETPOST('label'), '', '', 'text', '', $user, 'LOAN_MODIFY'); + $result = $object->setValueFrom('label', GETPOST('label'), '', null, 'text', '', $user, 'LOAN_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 5655d668c20b4..304e0d1acbfea 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -266,7 +266,7 @@ class Mo extends CommonObject public $fk_parent_line; /** - * @var array tpl + @ var array{id:int,label:string,qty_bom:int|float,stock:float,seuil_stock_alerte:float,virtual_stock:float,qty:float,fk_unit:int,qty_frozen:float,disable_stock_change:int<0,1>,efficiency:float} tpl */ public $tpl = array(); @@ -312,8 +312,8 @@ public function __construct(DoliDB $db) /** * Create object into database * - * @param User $user User that creates - * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param User $user User that creates + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <=0 if KO, Id of created object if OK */ public function create(User $user, $notrigger = 0) @@ -512,7 +512,7 @@ public function fetchLines() * @param int $offset Offset * @param string|array $filter Filter USF. * @param string $filtermode Filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @return self[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -596,7 +596,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = * * @param string $role Get lines linked to current line with the selected role ('consumed', 'produced', ...) * @param int $lineid Id of production line to filter children - * @return array Array of lines + * @return array Array of lines */ public function fetchLinesLinked($role, $lineid = 0) { @@ -681,9 +681,9 @@ public function countMovements() /** * Update object into database * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function update(User $user, $notrigger = 0) { @@ -715,9 +715,9 @@ public function update(User $user, $notrigger = 0) /** * Erase and update the line to consume and to produce. * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function createProduction(User $user, $notrigger = 0) { @@ -834,9 +834,9 @@ public function createProduction(User $user, $notrigger = 0) /** * Update quantities in lines to consume and/or lines to produce. * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function updateProduction(User $user, $notrigger = 0) { @@ -887,9 +887,9 @@ public function updateProduction(User $user, $notrigger = 0) /** * Delete object in database * - * @param User $user User that deletes - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @param bool $also_cancel_consumed_and_produced_lines true if the consumed and produced lines will be deleted (and stocks incremented/decremented back) (false by default) + * @param User $user User that deletes + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @param bool $also_cancel_consumed_and_produced_lines true if the consumed and produced lines will be deleted (and stocks incremented/decremented back) (false by default) * @return int Return integer <0 if KO, >0 if OK */ public function delete(User $user, $notrigger = 0, $also_cancel_consumed_and_produced_lines = false) @@ -923,11 +923,11 @@ public function delete(User $user, $notrigger = 0, $also_cancel_consumed_and_pro /** * Delete a line of object in database * - * @param User $user User that delete - * @param int $idline Id of line to delete - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @param int $fk_movement Movement - * @return int Return >0 if OK, <0 if KO + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @param int $fk_movement Movement + * @return int Return >0 if OK, <0 if KO */ public function deleteLine(User $user, $idline, $notrigger = 0, $fk_movement = 0) { @@ -1061,6 +1061,7 @@ public function getNextNumRef($prod) } $obj = new $classname(); + '@phan-var-force ModeleNumRefMos $obj'; $numref = $obj->getNextValue($prod, $this); if ($numref != "") { @@ -1557,8 +1558,8 @@ public function getLibStatut($mode = 0) /** * Return the status * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @param int $status Id status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ public function LibStatut($status, $mode = 0) @@ -1647,7 +1648,7 @@ public function initAsSpecimen() * Create an array of lines * * @param string $rolefilter string lines role filter - * @return array|int array of lines if OK, <0 if KO + * @return MoLine[]|int array of lines if OK, <0 if KO */ public function getLinesArray($rolefilter = '') { @@ -1676,10 +1677,10 @@ public function getLinesArray($rolefilter = '') * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) @@ -1714,8 +1715,8 @@ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hided * If lines are into a template, title must also be into a template * But for the moment we don't know if it's possible, so we keep the method available on overloaded objects. * - * @param string $restrictlist ''=All lines, 'services'=Restrict to services only - * @param array $selectedLines Array of lines id for selected lines + * @param ''|'services' $restrictlist ''=All lines, 'services'=Restrict to services only + * @param int[] $selectedLines Array of lines id for selected lines * @return void */ public function printOriginLinesList($restrictlist = '', $selectedLines = array()) @@ -1831,6 +1832,7 @@ public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir $this->tpl['disable_stock_change'] = $line->disable_stock_change; $this->tpl['efficiency'] = $line->efficiency; + global $conf; // used into template $res = include DOL_DOCUMENT_ROOT.'/mrp/tpl/originproductline.tpl.php'; } @@ -1978,12 +1980,13 @@ public function getMoParent() * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array{string,mixed} $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { global $langs; + '@phan-var-force array{selected?:int<0,1>,bom?:Bom,product?:product} $arraydata'; $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); diff --git a/htdocs/mrp/class/moline.class.php b/htdocs/mrp/class/moline.class.php index 353ca3c62ff09..49339ff7055f2 100644 --- a/htdocs/mrp/class/moline.class.php +++ b/htdocs/mrp/class/moline.class.php @@ -274,9 +274,9 @@ public function fetch($id, $ref = null) * @param string $sortfield Sort field * @param int $limit limit * @param int $offset Offset - * @param string|array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string|array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) * @param string $filtermode Filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @return MoLine[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index a43a794e4f3dd..b2bb5860eb5a7 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -270,7 +271,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')); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f53bbc394ff95..ab0f8a97c400a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -269,7 +269,7 @@ class Product extends CommonObject public $tva_tx; /** - * @var int French VAT NPR is used (0 or 1) + * @var int<0,1> French VAT NPR is used (0 or 1) */ public $tva_npr = 0; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index cf357d047cf85..ecab83d92deef 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -124,7 +124,7 @@ class Dolresource extends CommonObject public $objelement; /** - * @var array Cache of type of resources. TODO Use $conf->cache['type_of_resources'] instead + * @var array Cache of type of resources. TODO Use $conf->cache['type_of_resources'] instead */ public $cache_code_type_resource; @@ -602,7 +602,7 @@ public function delete(User $user, int $notrigger = 0) * @param string $sortfield Sort field * @param int $limit Limit page * @param int $offset Offset page - * @param string|array $filter Filter USF. + * @param string|array $filter Filter USF. * @return int If KO: <0 || if OK number of lines loaded */ public function fetchAll(string $sortorder, string $sortfield, int $limit, int $offset, $filter = '') @@ -793,7 +793,7 @@ public function updateElementResource($user = null, int $notrigger = 0) * @param string $element Element * @param int $element_id Id * @param string $resource_type Type - * @return array Array of resources + * @return array,mandatory:int<0,1>}> Array of resources */ public function getElementResources(string $element, int $element_id, string $resource_type = '') { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index b1c9d9a33d099..3f74defca3cac 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -4,6 +4,7 @@ * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2023 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 @@ -286,7 +287,7 @@ } } -$parameters = array('resource_id'=>$resource_id); +$parameters = array('resource_id' => $resource_id); $reshook = $hookmanager->executeHooks('getElementResources', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -331,6 +332,7 @@ $act = fetchObjectByElement($element_id, $element, $element_ref); if (is_object($act)) { + '@phan-var-force ActionComm $act'; $head = actions_prepare_head($act); print dol_get_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action'); @@ -459,7 +461,7 @@ $listofuserid = array(); if (empty($donotclearsession)) { if ($act->userownerid > 0) { - $listofuserid[$act->userownerid] = array('id'=>$act->userownerid, 'transparency'=>$act->transparency); // Owner first + $listofuserid[$act->userownerid] = array('id' => $act->userownerid, 'transparency' => $act->transparency); // Owner first } if (!empty($act->userassigned)) { // Now concat assigned users // Restore array with key with same value than param 'id' @@ -502,6 +504,7 @@ if (($element_id || $element_ref) && $element == 'societe') { $socstatic = fetchObjectByElement($element_id, $element, $element_ref); if (is_object($socstatic)) { + '@phan-var-force Societe $socstatic'; $savobject = $object; $object = $socstatic; @@ -554,8 +557,8 @@ // Ref customer //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, $user->rights->ficheinter->creer, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$fichinter->thirdparty->getNomUrl(1, 'customer'); // Project @@ -613,7 +616,7 @@ // hook for other elements linked - $parameters = array('element'=>$element, 'element_id'=>$element_id, 'element_ref'=>$element_ref); + $parameters = array('element' => $element, 'element_id' => $element_id, 'element_ref' => $element_ref); $reshook = $hookmanager->executeHooks('printElementTab', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ac2c7332b6622..0d18f8f9f7067 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -804,7 +804,7 @@ function fail($message) $line['fk_fournprice'] = $pf->product_fourn_price_id; $line['pa_ht'] = $pf->fourn_unitprice_with_discount; if (getDolGlobalString('PRODUCT_CHARGES') && $pf->fourn_charges > 0) { - $line['pa_ht'] += $pf->fourn_charges / $pf->fourn_qty; + $line['pa_ht'] += (float) $pf->fourn_charges / $pf->fourn_qty; } } } diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 79cf01b3e4daa..8c2c1c5831588 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -482,6 +482,7 @@ protected function header($context) } $html .= '
'; if ($object->element == 'member') { + '@phan-var-force Adherent $object'; if ($object->morphy == 'mor' && !empty($object->societe)) { $html .= dol_htmlentities($object->societe); $html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''; diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index b297ee7bc451f..f47fd8dcad25a 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -136,7 +136,7 @@ public function inputDate($name, $value = '', $placeholder = '', $id = '', $more * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * * @param string $htmlname Name of html select area. - * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) + * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) * @param string|string[] $id Preselected key or preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record. * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 to show key into label with format "[key] value" @@ -253,7 +253,7 @@ public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, * @param string $filedir Full path to directory to scan * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') * @param string $morecss Add more css to the download picto - * @param int $allfiles 0=Only generated docs, 1=All files + * @param int<0,1> $allfiles 0=Only generated docs, 1=All files * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles */ public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = '', $allfiles = 0) @@ -458,7 +458,7 @@ public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showe * @param int $disabled 1=Html component is disabled * @param string $sortfield Sort field * @param string $filter Add more filter (Universal Search Filter) - * @return string|array Return HTML string + * @return string|array Return HTML string * @see selectForForms() */ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0, $sortfield = '', $filter = '') @@ -626,9 +626,9 @@ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $sh * Return HTML string to put an input field into a page * Code very similar with showInputField for common object * - * @param array|null $val Array of properties for field to show + * @param array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $val Array of properties for field to show * @param string $key Key of attribute - * @param string|array $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) + * @param string|mixed[] $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) @@ -944,7 +944,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $categorytype = $InfoFieldList[5]; if (is_numeric($categorytype)) { - $categorytype = Categorie::$MAP_ID_TO_CODE[$categorytype]; // For backward compatibility + $categorytype = Categorie::$MAP_ID_TO_CODE[(int) $categorytype]; // For backward compatibility } $data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1); $out .= ''; @@ -979,7 +979,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = * Return HTML string to show a field into a page * * @param CommonObject $object Common object - * @param array $val Array of properties of field to show + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $val Array of properties of field to show * @param string $key Key of attribute * @param string|string[] $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $moreparam To add more parameters on html input tag @@ -1103,10 +1103,16 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; if (!is_null($value) && $value !== '') { $value = convertSecondToTime((int) $value, 'allhourmin'); + } else { + // Resulting type must be string + $value = ''; } } elseif ($type == 'double' || $type == 'real') { if (!is_null($value) && $value !== '') { $value = price($value); + } else { + // Resulting type must be string + $value = ''; } } elseif ($type == 'boolean') { $checked = ''; @@ -1125,6 +1131,9 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam } elseif ($type == 'price') { if (!is_null($value) && $value !== '') { $value = price($value, 0, $langs, 0, 0, -1, $conf->currency); + } else { + // Resulting type must be string + $value = ''; } } elseif ($type == 'select') { $value = isset($param['options'][$value]) ? $param['options'][$value] : ''; @@ -1219,7 +1228,7 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); } } elseif ($type == 'radio') { - $value = $param['options'][$value]; + $value = (string) $param['options'][$value]; } elseif ($type == 'checkbox') { $value_arr = explode(',', $value); $value = ''; @@ -1335,15 +1344,16 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam dol_include_once($InfoFieldList[1]); if ($classname && class_exists($classname)) { $object = new $classname($this->db); + '@phan-var-force CommonObject $object'; $result = $object->fetch($value); $value = ''; if ($result > 0) { if (property_exists($object, 'label')) { - $value = $object->label; + $value = $object->label; // @phan-suppress-current-line PhanUndeclaredProperty } elseif (property_exists($object, 'libelle')) { - $value = $object->libelle; + $value = $object->libelle; // @phan-suppress-current-line PhanUndeclaredProperty } elseif (property_exists($object, 'nom')) { - $value = $object->nom; + $value = $object->nom; // @phan-suppress-current-line PhanUndeclaredProperty } } } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3777c4b2d3e02..4ada2b118de4e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -99,7 +99,6 @@ parameters: - '# getCommonSubstitutionArray expects array#' - '# ldap_search expects array\|LDAP#' - '# ajax_combobox expects array#' - - '# Context::setError\(\) expects array, string#' - '# FormWebPortal::selectForForms\(\) expects int, array#' - '# Lettering::getBankLinesFromFkDocAndDocType\(\) expects array#' - '# (Odf) constructor expects #' @@ -112,8 +111,7 @@ parameters: - '# (?:pdf_(?:(?:eagle_proforma::drawTotalTable|muscadet::_tableau_tot)\(\))) expects Facture#' - '# (?:salaries_prepare_head) expects Paiement#' - '# (?:pg_(?:affected_rows|f(?:etch_(?:array|object|row)|ree_result)|num_rows)) expects PgSql\\Result#' - - '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot) expects Societe#' - - '# (?:get_next_value) expects ..\|Societe#' + - '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#' - '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#' - '#colorHexToHsl expects float\|false, true#' internalErrorsCountLimit: 50