From 53cfbc35be7c2c107f643b974ffc0986c23f5760 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 14 Oct 2024 01:59:44 +0200 Subject: [PATCH] Qual: Fix several phan & stan notices (#31308) * Qual: Fix several phan & stan notices # Qual: Fix several phan & stan notices Several fixes in files while fixing UnknownClass notices * Qual: Update prepare_head PHPDoc return types # Qual: Update prepare_head PHPDoc return types Provide detailed array return types for prepare_head functions. * Fix new phan notice * Better loadLangs typing and fix call to loadLangs * Fix new issues (stats) * Other fixes of new issues * Qual: update phan baseline --- dev/tools/phan/baseline.txt | 147 +++-------- .../class/accountingjournal.class.php | 2 +- .../accountancy/journal/purchasesjournal.php | 4 +- .../adherents/class/adherentstats.class.php | 2 +- htdocs/bom/lib/bom.lib.php | 5 +- htdocs/bookcal/lib/bookcal.lib.php | 3 +- .../lib/bookcal_availabilities.lib.php | 3 +- htdocs/bookcal/lib/bookcal_calendar.lib.php | 3 +- htdocs/categories/class/categorie.class.php | 36 +-- .../comm/propal/class/propalestats.class.php | 10 +- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/class/commandestats.class.php | 13 +- htdocs/commande/stats/index.php | 8 +- .../class/deplacementstats.class.php | 28 ++- htdocs/compta/deplacement/stats/index.php | 3 +- .../facture/class/facturestats.class.php | 4 +- htdocs/core/class/stats.class.php | 2 +- htdocs/core/class/translate.class.php | 18 +- htdocs/core/lib/admin.lib.php | 4 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/asset.lib.php | 3 +- htdocs/core/lib/company.lib.php | 6 +- htdocs/core/lib/contract.lib.php | 2 +- htdocs/core/lib/cron.lib.php | 5 +- htdocs/core/lib/ecm.lib.php | 2 +- htdocs/core/lib/eventorganization.lib.php | 3 +- htdocs/core/lib/expedition.lib.php | 2 +- htdocs/core/lib/expensereport.lib.php | 4 +- htdocs/core/lib/fourn.lib.php | 2 +- htdocs/core/lib/holiday.lib.php | 5 +- htdocs/core/lib/hrm.lib.php | 2 +- htdocs/core/lib/import.lib.php | 3 +- htdocs/core/lib/invoice.lib.php | 10 +- htdocs/core/lib/ldap.lib.php | 2 +- htdocs/core/lib/mailmanspip.lib.php | 3 +- htdocs/core/lib/multicurrency.lib.php | 2 +- htdocs/core/lib/oauth.lib.php | 3 +- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/payments.lib.php | 7 +- htdocs/core/lib/prelevement.lib.php | 2 +- htdocs/core/lib/product.lib.php | 11 +- htdocs/core/lib/receiptprinter.lib.php | 3 +- htdocs/core/lib/resource.lib.php | 5 +- htdocs/core/lib/salaries.lib.php | 5 +- htdocs/core/lib/socialnetwork.lib.php | 3 +- htdocs/core/lib/stock.lib.php | 2 +- htdocs/core/lib/takepos.lib.php | 3 +- htdocs/core/lib/ticket.lib.php | 16 +- htdocs/core/lib/website.lib.php | 20 +- .../doc/pdf_aurore.modules.php | 7 +- .../doc/pdf_zenith.modules.php | 4 +- htdocs/don/class/donstats.class.php | 17 +- htdocs/don/stats/index.php | 6 +- .../emailcollector/lib/emailcollector.lib.php | 2 +- .../class/conferenceorbooth.class.php | 46 +++- ...ventorganization_conferenceorbooth.lib.php | 6 +- .../class/expeditionstats.class.php | 11 +- htdocs/expedition/stats/index.php | 2 +- .../class/expensereportstats.class.php | 11 +- htdocs/expensereport/stats/index.php | 6 +- .../fichinter/class/fichinterstats.class.php | 10 +- htdocs/fichinter/stats/index.php | 3 +- htdocs/hrm/lib/hrm.lib.php | 3 +- htdocs/hrm/lib/hrm_job.lib.php | 3 +- htdocs/hrm/lib/hrm_position.lib.php | 3 +- htdocs/hrm/lib/hrm_skill.lib.php | 3 +- htdocs/hrm/lib/hrm_skilldet.lib.php | 3 +- htdocs/hrm/lib/hrm_skillrank.lib.php | 5 +- .../lib/intracommreport.lib.php | 5 +- htdocs/margin/lib/margins.lib.php | 4 +- htdocs/mrp/lib/mrp.lib.php | 3 +- htdocs/mrp/lib/mrp_mo.lib.php | 3 +- htdocs/opensurvey/lib/opensurvey.lib.php | 2 +- htdocs/partnership/lib/partnership.lib.php | 5 +- htdocs/paypal/lib/paypal.lib.php | 2 +- htdocs/printing/lib/printing.lib.php | 3 +- .../product/inventory/lib/inventory.lib.php | 7 +- .../stocktransfer/lib/stocktransfer.lib.php | 3 +- htdocs/projet/class/projectstats.class.php | 12 +- htdocs/projet/class/taskstats.class.php | 7 +- htdocs/projet/stats/index.php | 3 +- htdocs/projet/tasks/stats/index.php | 3 +- htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- .../reception/class/receptionstats.class.php | 4 +- htdocs/resource/element_resource.php | 11 +- htdocs/salaries/class/paymentsalary.class.php | 9 +- htdocs/salaries/class/salariesstats.class.php | 13 +- htdocs/salaries/class/salary.class.php | 37 ++- htdocs/salaries/paiement_salary.php | 5 +- htdocs/salaries/stats/index.php | 2 +- htdocs/salaries/virement_request.php | 2 +- htdocs/societe/card.php | 28 +-- htdocs/stripe/lib/stripe.lib.php | 3 +- htdocs/supplier_proposal/card.php | 2 +- .../class/supplier_proposal.class.php | 228 ++++++++++++++---- htdocs/takepos/admin/terminal.php | 2 + htdocs/ticket/class/ticketstats.class.php | 15 +- htdocs/ticket/stats/index.php | 3 +- htdocs/viewimage.php | 1 + htdocs/webhook/class/target.class.php | 50 +++- htdocs/webhook/lib/webhook.lib.php | 3 +- htdocs/webhook/lib/webhook_target.lib.php | 3 +- .../class/html.formwebportal.class.php | 1 + htdocs/webportal/lib/webportal.lib.php | 3 +- htdocs/webservices/server_category.php | 2 +- htdocs/website/class/websitepage.class.php | 66 ++--- htdocs/website/index.php | 34 +-- htdocs/website/lib/websiteaccount.lib.php | 3 +- .../workstation/class/workstation.class.php | 15 +- htdocs/workstation/lib/workstation.lib.php | 3 +- .../lib/workstation_workstation.lib.php | 3 +- htdocs/zapier/lib/zapier.lib.php | 3 +- phpstan.neon.dist | 1 + 114 files changed, 737 insertions(+), 472 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 1b89107308a..9ce6425b6c4 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,36 +9,36 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1000+ occurrences - // PhanUndeclaredProperty : 840+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 630+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 470+ occurrences - // PhanUndeclaredGlobalVariable : 410+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 380+ occurrences - // PhanPluginUnknownArrayMethodParamType : 290+ occurrences + // PhanUndeclaredProperty : 800+ occurrences + // PhanPluginUnknownPropertyType : 740+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 430+ occurrences + // PhanUndeclaredGlobalVariable : 380+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 320+ occurrences + // PhanPluginUnknownArrayMethodParamType : 270+ occurrences // PhanPossiblyUndeclaredVariable : 260+ occurrences - // PhanTypeMismatchProperty : 180+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 140+ occurrences - // PhanPluginUnknownArrayFunctionParamType : 120+ occurrences + // PhanTypeMismatchProperty : 170+ occurrences + // PhanPluginUnknownArrayFunctionParamType : 110+ occurrences // PhanTypeMismatchArgumentNullableInternal : 70+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences - // PhanPluginUnknownArrayPropertyType : 65+ occurrences - // PhanPluginEmptyStatementIf : 50+ occurrences + // PhanPluginUnknownArrayPropertyType : 60+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 55+ occurrences // PhanRedefineFunction : 50+ occurrences - // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences - // PhanTypeInvalidDimOffset : 35+ occurrences - // PhanTypeMismatchDimFetch : 30+ occurrences - // PhanPluginUnknownObjectMethodCall : 25+ occurrences + // PhanPluginEmptyStatementIf : 45+ occurrences + // PhanTypeMismatchDimFetch : 40+ occurrences + // PhanTypeSuspiciousNonTraversableForeach : 30+ occurrences // PhanTypeExpectedObjectPropAccess : 25+ occurrences + // PhanTypeInvalidDimOffset : 25+ occurrences + // PhanPluginUnknownObjectMethodCall : 15+ occurrences // PhanTypeComparisonFromArray : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences + // PhanUndeclaredMethod : 15+ occurrences // PhanEmptyForeach : 10+ occurrences // PhanPluginConstantVariableNull : 10+ occurrences - // PhanPluginSuspiciousParamPosition : 10+ occurrences // PhanPossiblyNullTypeMismatchProperty : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences - // PhanUndeclaredMethod : 10+ occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences + // PhanPluginSuspiciousParamPosition : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences @@ -51,11 +51,8 @@ return [ 'file_suppressions' => [ 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeInvalidDimOffset'], - 'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], - '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' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], @@ -82,7 +79,6 @@ return [ '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' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -91,11 +87,8 @@ return [ 'htdocs/bookcal/calendar_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/bookcal/lib/bookcal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/bookcal/lib/bookcal_availabilities.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/bookcal/lib/bookcal_calendar.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/categories/class/categorie.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'], + 'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'], 'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'], @@ -122,16 +115,13 @@ return [ 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/comm/propal/class/propal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/commande/list.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/commande/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], @@ -155,21 +145,20 @@ return [ 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/facture/class/facturestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/compta/facture/class/facturestats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/compta/facture/class/paymentterm.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -245,7 +234,6 @@ return [ 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/ajax/fileupload.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/ajax/saveinplace.php' => ['PhanUndeclaredProperty'], 'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'], @@ -317,7 +305,7 @@ return [ 'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/core/class/translate.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/core/class/translate.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/class/utils.class.php' => ['PhanPluginConstantVariableNull', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], 'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'], @@ -329,58 +317,32 @@ return [ 'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionParamType', 'PhanTypeInvalidDimOffset'], 'htdocs/core/lib/accounting.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/admin.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/agenda.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/lib/agenda.lib.php' => ['PhanPluginConstantVariableNull', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], 'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/lib/date.lib.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/doc.lib.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/ecm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/geturl.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/core/lib/holiday.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/hrm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/images.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/core/lib/import.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/invoice.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/invoice2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/ldap.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/oauth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/order.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/payments.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/prelevement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], '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/receiptprinter.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/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/menus/standard/eldy_menu.php' => ['PhanTypeInvalidDimOffset'], @@ -456,8 +418,8 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanPluginConstantVariableNull', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], @@ -517,7 +479,6 @@ return [ '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'], - 'htdocs/don/class/donstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/don/class/paymentdonation.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -527,7 +488,6 @@ return [ 'htdocs/don/paiement/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/don/stats/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/ecm/class/ecmfiles.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], @@ -539,8 +499,6 @@ return [ 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/emailcollector/class/emailcollectoraction.class.php' => ['PhanPluginUnknownPropertyType'], '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' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -548,12 +506,10 @@ return [ 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], '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'], 'htdocs/expedition/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expedition/document.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -563,7 +519,6 @@ return [ 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'], @@ -576,7 +531,7 @@ return [ 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -625,19 +580,12 @@ return [ 'htdocs/hrm/job_agenda.php' => ['PhanPossiblyUndeclaredGlobalVariable'], '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'], - 'htdocs/hrm/lib/hrm_position.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - '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_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/hrm/skill_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/imports/class/import.class.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/imports/import.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], @@ -648,7 +596,6 @@ return [ 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', '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' => ['PhanUndeclaredProperty'], 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], @@ -669,8 +616,6 @@ return [ 'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/mrp/lib/mrp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/mrp/lib/mrp_mo.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/mo_movements.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/mrp/mo_production.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -681,7 +626,7 @@ return [ 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'], - 'htdocs/opensurvey/lib/opensurvey.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/opensurvey/lib/opensurvey.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -690,12 +635,10 @@ return [ 'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/class/partnershiputils.class.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/partnership/lib/partnership.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'], 'htdocs/paypal/lib/paypal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/printing/index.php' => ['PhanUndeclaredProperty'], - 'htdocs/printing/lib/printing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/canvas/product/actions_card_product.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'], @@ -716,7 +659,6 @@ return [ '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'], 'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -743,7 +685,6 @@ return [ 'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stockatdate.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/product/stock/stocktransfer/stocktransfer_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/product/stock/stocktransfer/stocktransfer_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'], @@ -755,7 +696,7 @@ return [ 'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], @@ -807,7 +748,7 @@ return [ 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'], - 'htdocs/public/website/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/public/website/index.php' => ['PhanRedefineFunction'], 'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'], 'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'], 'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -836,13 +777,12 @@ return [ 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'], - 'htdocs/resource/element_resource.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/resource/element_resource.php' => ['PhanUndeclaredProperty'], 'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/salaries/class/salary.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/salaries/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -852,7 +792,6 @@ return [ 'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], @@ -869,15 +808,13 @@ return [ 'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/stripe/lib/stripe.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -904,7 +841,7 @@ return [ 'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'], 'htdocs/ticket/class/ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'], @@ -921,24 +858,20 @@ return [ 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'], + 'htdocs/viewimage.php' => ['PhanRedefineFunction', 'PhanUndeclaredMethod'], 'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/webhook/class/target.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty'], - 'htdocs/webhook/lib/webhook.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/webhook/lib/webhook_target.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/webhook/class/target.class.php' => ['PhanUndeclaredMethod'], 'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/webhook/target_list.php' => ['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' => ['PhanTypeInvalidDimOffset'], 'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'], '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'], + 'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_contact.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_invoice.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_order.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'], @@ -949,21 +882,17 @@ return [ 'htdocs/webservices/server_thirdparty.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_user.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/website/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/website/lib/websiteaccount.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'], 'htdocs/workstation/class/api_workstations.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/workstation/class/workstation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], + 'htdocs/workstation/class/workstation.class.php' => ['PhanUndeclaredProperty'], 'htdocs/workstation/class/workstationresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/workstation/class/workstationusergroup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/workstation/lib/workstation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/workstation/lib/workstation_workstation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/workstation/workstation_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/zapier/class/hook.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/zapier/lib/zapier.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'internal' => ['PhanUndeclaredConstant'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 3a0b59a6740..f428ee2700e 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -462,7 +462,7 @@ class AccountingJournal extends CommonObject $element = array( 'ref' => dol_trunc($element_static->ref, 16, 'right', 'UTF-8', 1), - 'error' => $pre_data_info['error'], + 'error' => array_key_exists('error', $pre_data_info) ? $pre_data_info['error'] : '', 'blocks' => array(), ); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 0652a6bfc52..dc8386865a3 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -546,7 +546,7 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) { if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) { - $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; + $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; } else { $bookkeeping->subledger_account = ''; @@ -1182,7 +1182,7 @@ if (empty($action) || $action == 'view') { print ""; if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) { if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) { - print length_accounta($tabcompany[$key]['code_compta']); + print length_accounta($tabcompany[$key]['code_compta_fournisseur']); } } elseif (($accountoshow == "") || $accountoshow == 'NotDefined') { print '' . $langs->trans("ThirdpartyAccountNotDefined") . ''; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 27173334e7d..83fe00991f3 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -172,7 +172,7 @@ class AdherentStats extends Stats /** * Return nb, total and average * - * @return array Array with nb, total amount, average for each year + * @return array Array with nb, total amount, average for each year */ public function getAllByYear() { diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index c98d314741d..360e6a868ff 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2019-2023 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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function bomAdminPrepareHead() { @@ -73,7 +74,7 @@ function bomAdminPrepareHead() * Prepare array of tabs for BillOfMaterials * * @param BOM $object BillOfMaterials - * @return array Array of tabs + * @return array Array of tabs to show */ function bomPrepareHead($object) { diff --git a/htdocs/bookcal/lib/bookcal.lib.php b/htdocs/bookcal/lib/bookcal.lib.php index 049de3c6472..8ce10a34009 100644 --- a/htdocs/bookcal/lib/bookcal.lib.php +++ b/htdocs/bookcal/lib/bookcal.lib.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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function bookcalAdminPrepareHead() { diff --git a/htdocs/bookcal/lib/bookcal_availabilities.lib.php b/htdocs/bookcal/lib/bookcal_availabilities.lib.php index a91e79cce52..558470345b6 100644 --- a/htdocs/bookcal/lib/bookcal_availabilities.lib.php +++ b/htdocs/bookcal/lib/bookcal_availabilities.lib.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 @@ -26,7 +27,7 @@ * Prepare array of tabs for Availabilities * * @param Availabilities $object Availabilities - * @return array Array of tabs + * @return array Array of tabs to show */ function availabilitiesPrepareHead($object) { diff --git a/htdocs/bookcal/lib/bookcal_calendar.lib.php b/htdocs/bookcal/lib/bookcal_calendar.lib.php index 9a2bd1213e2..37cdcd18798 100644 --- a/htdocs/bookcal/lib/bookcal_calendar.lib.php +++ b/htdocs/bookcal/lib/bookcal_calendar.lib.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 @@ -26,7 +27,7 @@ * Prepare array of tabs for Calendar * * @param Calendar $object Calendar - * @return array Array of tabs + * @return array Array of tabs to show */ function calendarPrepareHead($object) { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 77b347d2f41..649385d7d15 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -263,12 +263,12 @@ class Categorie extends CommonObject public $cats = array(); /** - * @var array Mother of table + * @var array Mother of table */ public $motherof = array(); /** - * @var array children + * @var Categorie[] children */ public $childs = array(); @@ -338,7 +338,7 @@ class Categorie extends CommonObject /** * Get map list * - * @return array + * @return array */ public function getMapList() { @@ -361,7 +361,7 @@ class Categorie extends CommonObject /** * Get MAP_ID * - * @return array + * @return array */ public function getMapId() { @@ -1105,7 +1105,7 @@ class Categorie extends CommonObject /** * Return direct children ids of a category into an array * - * @return array|int Return integer <0 KO, array ok + * @return Categorie[]|int Return integer <0 KO, array ok */ public function get_filles() { @@ -1337,14 +1337,14 @@ class Categorie extends CommonObject /** * Returns all categories * - * @param int $type Type of category (0, 1, ...) + * @param ?int $type Type of category (0, 1, ...) * @param boolean $parent Just parent categories if true - * @return array|int Table of Object Category, -1 on error + * @return array|int<-1,-1> Table of Object Category, -1 on error */ public function get_all_categories($type = null, $parent = false) { // phpcs:enable - if (!is_numeric($type)) { + if (!is_numeric($type) && !is_null($type)) { $type = $this->MAP_ID[$type]; } @@ -1376,8 +1376,8 @@ class Categorie extends CommonObject /** * Returns the top level categories (which are not child) * - * @param int $type Type of category (0, 1, ...) - * @return array + * @param ?int $type Type of category (0, 1, ...) + * @return array|int<-1,-1> Table of Object Category, -1 on error */ public function get_main_categories($type = null) { @@ -1443,7 +1443,7 @@ class Categorie extends CommonObject * @param string $url Url ('', 'none' or 'urltouse') * @param int $nocolor 0 * @param int $addpicto Add picto into link - * @return array + * @return string[] */ public function print_all_ways($sep = '>>', $url = '', $nocolor = 0, $addpicto = 0) { @@ -1850,9 +1850,9 @@ class Categorie extends CommonObject /** * Add the image uploaded as $file to the directory $sdir/-/photos/ * - * @param string $sdir Root destination directory - * @param array $file Uploaded file name - * @return void + * @param string $sdir Root destination directory + * @param array{name:string,tmp_name:string} $file Uploaded file name + * @return void */ public function add_photo($sdir, $file) { @@ -1898,9 +1898,9 @@ class Categorie extends CommonObject /** * Return an array with all photos inside the directory * - * @param string $dir Dir to scan - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @return array Tableau de photos + * @param string $dir Dir to scan + * @param int $nbmax Nombre maximum de photos (0=pas de max) + * @return array Table with images */ public function liste_photos($dir, $nbmax = 0) { @@ -2179,7 +2179,7 @@ class Categorie extends CommonObject * * @param string $type The category type (e.g Categorie::TYPE_WAREHOUSE) * @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid") - * @param Array $searchList A list with the selected categories + * @param string[] $searchList A list with the selected categories * @return string A additional SQL SELECT query * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN */ diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 3e134a91669..a96dc3486f8 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -137,7 +137,7 @@ class PropaleStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with number by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -161,7 +161,7 @@ class PropaleStats extends Stats /** * Return propals number per year * - * @return array Array with number by year + * @return array Array of nb each year * */ public function getNbByYear() @@ -186,7 +186,7 @@ class PropaleStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getAmountByMonth($year, $format = 0) { @@ -211,7 +211,7 @@ class PropaleStats extends Stats * Return the propals amount average by month for a year * * @param int $year year for stats - * @return array array with number by month + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -234,7 +234,7 @@ class PropaleStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array with nb, total amount, average for each year */ public function getAllByYear() { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 3db4d075dd4..c17659abe8b 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -334,7 +334,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { // If we have empty year + while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index ca2bc3e8826..f7fb16a08d2 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2020 Maxime DEMAREST * 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 @@ class CommandeStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with number by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -174,7 +175,7 @@ class CommandeStats extends Stats /** * Return orders number per year * - * @return array Array with number by year + * @return array Array of nb each year * */ public function getNbByYear() @@ -199,7 +200,7 @@ class CommandeStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getAmountByMonth($year, $format = 0) { @@ -224,7 +225,7 @@ class CommandeStats extends Stats * Return the orders amount average by month for a year * * @param int $year year for stats - * @return array array with number by month + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -247,7 +248,7 @@ class CommandeStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { @@ -271,7 +272,7 @@ class CommandeStats extends Stats * * @param int $year Year to scan * @param int $limit Limit - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAllByProduct($year, $limit = 10) { diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index adb5ab5b7d8..72c265f8242 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -136,6 +136,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) +$fileurlnb = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { @@ -183,6 +184,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) +$fileurlamount = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { @@ -228,6 +230,8 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); + +$fileurl_avg = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { @@ -334,6 +338,8 @@ if ($user->admin) { } print ''; // Category +$cat_type = 0; +$cat_label = ''; if ($mode == 'customer') { $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); @@ -398,7 +404,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { // If we have empty year + while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 6f2d814d298..aabb1b77f38 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (c) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * 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 @@ -35,11 +36,26 @@ class DeplacementStats extends Stats */ public $table_element; + /** + * @var int + */ public $socid; + /** + * @var int + */ public $userid; + /** + * @var string + */ public $from; + /** + * @var string + */ public $field; + /** + * @var string + */ public $where; /** @@ -47,7 +63,7 @@ class DeplacementStats extends Stats * * @param DoliDB $db Database handler * @param int $socid Id third party - * @param mixed $userid Id user for filter or array of user ids + * @param int|int[] $userid Id user for filter or array of user ids * @return void */ public function __construct($db, $socid = 0, $userid = 0) @@ -78,7 +94,7 @@ class DeplacementStats extends Stats /** * Renvoie le nombre de facture par annee * - * @return array Array of values + * @return array Array of nb each year */ public function getNbByYear() { @@ -96,7 +112,7 @@ class DeplacementStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -118,7 +134,7 @@ class DeplacementStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { @@ -138,7 +154,7 @@ class DeplacementStats extends Stats * Return average amount * * @param int $year Year to scan - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -155,7 +171,7 @@ class DeplacementStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 33520b4d3b6..55b28a9102d 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -167,6 +167,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); +$filename_avg = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { @@ -282,7 +283,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while ($year && $oldyear > $year + 1) { // If we have empty year + while ($year && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; print ''.$oldyear.''; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index bde740a2666..9750fff5f5b 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -154,7 +154,7 @@ class FactureStats extends Stats /** * Return invoices number per year * - * @return array Array with number by year + * @return array Array of nb each year */ public function getNbByYear() { @@ -228,7 +228,7 @@ class FactureStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 2499ec19ff1..a372e6013a8 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -424,7 +424,7 @@ abstract class Stats * Return nb of elements, total amount and avg amount each year * * @param string $sql SQL request - * @return array Array with nb, total amount, average for each year + * @return array Array with nb, total amount, average for each year */ protected function _getAllByYear($sql) { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4cc81b629bd..3d29f9c3e58 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -213,7 +213,7 @@ class Translate /** * Load translation files. * - * @param array $domains Array of lang files to load + * @param string[] $domains Array of lang files to load * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK */ public function loadLangs($domains) @@ -243,12 +243,12 @@ class Translate * If $domain is "file@module" instead of "file" then we look for module lang file * in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang * then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang - * @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US) + * @param int $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US) * @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed) * @param string $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found - * @param array $tabtranslatedomain Store translations to be stored in cache + * @param array $tabtranslatedomain Store translations to be stored in cache * @param string $langkey To create key for cachekey in recursivity * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK * @see loadLangs() @@ -867,11 +867,11 @@ class Translate /** * Return list of all available languages * - * @param string $langdir Directory to scan - * @param integer $maxlength Max length for each value in combo box (will be truncated) - * @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code - * @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) - * @return array List of languages + * @param string $langdir Directory to scan + * @param int $maxlength Max length for each value in combo box (will be truncated) + * @param int<0,1> $usecode 1=Show code instead of country name for language variant, 2=Show only code + * @param int<0,1> $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) + * @return array List of languages */ public function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0, $mainlangonly = 0) { @@ -1195,7 +1195,7 @@ class Translate * Return an array with content of all loaded translation keys (found into this->tab_translate) so * we get a substitution array we can use for substitutions (for mail or ODT generation for example) * - * @return array Array of translation keys lang_key => string_translation_loaded + * @return array Array of translation keys lang_key => string_translation_loaded */ public function get_translations_for_substitutions() { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 0464f172375..f3e67229b67 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -2076,7 +2076,7 @@ function phpinfo_array() /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function company_admin_prepare_head() { @@ -2115,7 +2115,7 @@ function company_admin_prepare_head() /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function email_admin_prepare_head() { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 0032de1b22c..cbcdf3b0019 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -512,7 +512,7 @@ function actions_prepare_head($object) * Define head array for tabs of agenda setup pages * * @param string $param Parameters to add to url - * @return array Array of head + * @return array Array of tabs to show */ function calendars_prepare_head($param) { diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index cd4e8431cf9..6ced74e5966 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2022-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 @@ -178,7 +179,7 @@ function assetPrepareHead(Asset $object) * Prepare array of tabs for AssetModel * * @param AssetModel $object AssetModel - * @return array Array of tabs + * @return array Array of tabs to show */ function assetModelPrepareHead($object) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c1337f02968..ece419a576b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -38,7 +38,7 @@ * Return array of tabs to used on pages for third parties cards. * * @param Societe $object Object company shown - * @return array Array of tabs + * @return array Array of tabs to show */ function societe_prepare_head(Societe $object) { @@ -477,7 +477,7 @@ function societe_prepare_head(Societe $object) * Return array of tabs to used on page * * @param Object $object Object for tabs - * @return array Array of tabs + * @return array Array of tabs to show */ function societe_prepare_head2($object) { @@ -503,7 +503,7 @@ function societe_prepare_head2($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function societe_admin_prepare_head() { diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index b1a9f36432f..532b2652003 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -142,7 +142,7 @@ function contract_prepare_head(Contrat $object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function contract_admin_prepare_head() { diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index ba86ee940ad..c39f5b3719d 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -1,6 +1,7 @@ + * 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 @@ -26,7 +27,7 @@ /** * Return array of tabs to used on pages to setup cron module. * - * @return array Array of tabs + * @return array Array of tabs to show */ function cronadmin_prepare_head() { @@ -56,7 +57,7 @@ function cronadmin_prepare_head() * Return array of tabs to used on a cron job * * @param Cronjob $object Object cron - * @return array Array of tabs + * @return array Array of tabs to show */ function cron_prepare_head(Cronjob $object) { diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index ffdff4a5f43..fb4c0b241c0 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -174,7 +174,7 @@ function ecm_prepare_head_fm($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function ecm_admin_prepare_head() { diff --git a/htdocs/core/lib/eventorganization.lib.php b/htdocs/core/lib/eventorganization.lib.php index 09ebc88a0b3..79510429856 100644 --- a/htdocs/core/lib/eventorganization.lib.php +++ b/htdocs/core/lib/eventorganization.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2023 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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function eventorganizationAdminPrepareHead() { diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index 7510a73569b..72646e4f34e 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -69,7 +69,7 @@ function expedition_prepare_head(Expedition $object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function expedition_admin_prepare_head() { diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 518ed2d475f..3f13f3a6e44 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -94,7 +94,7 @@ function expensereport_prepare_head($object) * It loads tabs from modules looking for the entity payment * * @param PaymentExpenseReport $object Current payment object - * @return array Tabs for the payment section + * @return array Array of tabs to show */ function payment_expensereport_prepare_head(PaymentExpenseReport $object) { @@ -127,7 +127,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function expensereport_admin_prepare_head() { diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 121e41c3ee3..3d4e58ac624 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -283,7 +283,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function supplierorder_admin_prepare_head() { diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index 76361b759c4..e25ee0b5902 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 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 @@ -26,7 +27,7 @@ * Return array head with list of tabs to view object information * * @param Object $object Holiday - * @return array head + * @return array Array of tabs to show */ function holiday_prepare_head($object) { @@ -76,7 +77,7 @@ function holiday_prepare_head($object) /** * Return array head with list of tabs to view object information * - * @return array head + * @return array Array of tabs to show */ function holiday_admin_prepare_head() { diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index 77c380918a4..88176b3cff2 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -63,7 +63,7 @@ function establishment_prepare_head($object) /** * Return array head with list of tabs to view object information * - * @return array head + * @return array Array of tabs to show */ function hrm_admin_prepare_head() { diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 371bc6ed7c1..ed84858103a 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2010 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2018-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 @@ -31,7 +32,7 @@ * * @param string $param Params to add on url links * @param int $maxstep Limit steps to maxstep or no limit if 0 - * @return array Array of tabs + * @return array Array of tabs to show */ function import_prepare_head($param, $maxstep = 0) { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index d9b7928ba49..24dc64a36a8 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -33,7 +33,7 @@ * Initialize the array of tabs for customer invoice * * @param Facture $object Invoice object - * @return array Array of head tabs + * @return array Array of tabs to show */ function facture_prepare_head($object) { @@ -164,7 +164,7 @@ function facture_prepare_head($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function invoice_admin_prepare_head() { @@ -248,7 +248,7 @@ function invoice_admin_prepare_head() * Return array head with list of tabs to view object information. * * @param FactureRec $object Invoice model object - * @return array head array with tabs + * @return array Array of tabs to show */ function invoice_rec_prepare_head($object) { @@ -311,7 +311,7 @@ function invoice_rec_prepare_head($object) * Return array head with list of tabs to view object information. * * @param Facture $object Invoice object - * @return array head array with tabs + * @return array Array of tabs to show */ function supplier_invoice_rec_prepare_head($object) { @@ -366,7 +366,7 @@ function getNumberInvoicesPieChart($mode) $amount_mode = (getDolGlobalInt('FACTURE_VALIDATED_IN_AMOUNT') == 1); - $sql = "SELECT"; + $sql = "SELECT"; $sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late30"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late15"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub15, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as latenow"; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 9b5c039372e..04bc6bedb1a 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -28,7 +28,7 @@ /** * Initialize the array of tabs for customer invoice * - * @return array Array of head tabs + * @return array Array of tabs to show */ function ldap_prepare_head() { diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php index 5449da31228..095f275b9d2 100644 --- a/htdocs/core/lib/mailmanspip.lib.php +++ b/htdocs/core/lib/mailmanspip.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 @@ -24,7 +25,7 @@ /** * Return array head with list of tabs to view object information * - * @return array Tabs of the module + * @return array Array of tabs to show */ function mailmanspip_admin_prepare_head() { diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php index 1be514c60eb..6172fda2065 100644 --- a/htdocs/core/lib/multicurrency.lib.php +++ b/htdocs/core/lib/multicurrency.lib.php @@ -56,7 +56,7 @@ function multicurrencyAdminPrepareHead() /** * Prepare array with list of currency tabs * - * @param array $aCurrencies Currencies array + * @param string[] $aCurrencies Currencies array * @return array Array of tabs to show */ function multicurrencyLimitPrepareHead($aCurrencies) diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index ecd69c3d045..383546cf036 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -1,6 +1,7 @@ + * 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 @@ -359,7 +360,7 @@ function getSupportedOauth2Array() /** * Return array of tabs to used on pages to setup cron module. * - * @return array Array of tabs + * @return array Array of tabs to show */ function oauthadmin_prepare_head() { diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index d89d4897dc7..0f50d417ccc 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -174,7 +174,7 @@ function commande_prepare_head(Commande $object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function order_admin_prepare_head() { diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index a5e48935052..fa7ad623f3a 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Abbes Bahfir * Copyright (C) 2021 Waël Almoman + * 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 @@ * It loads tabs from modules looking for the entity payment * * @param Paiement $object Current payment object - * @return array Tabs for the payment section + * @return array Array of tabs for the payment section */ function payment_prepare_head(Paiement $object) { @@ -73,7 +74,7 @@ function payment_prepare_head(Paiement $object) * It loads tabs from modules looking for the entity payment * * @param int $id ID of bank line - * @return array Tabs for the Bankline section + * @return array Array of tabs for the Banline section */ function bankline_prepare_head($id) { @@ -108,7 +109,7 @@ function bankline_prepare_head($id) * It loads tabs from modules looking for the entity payment_supplier * * @param Paiement $object Current payment object - * @return array Tabs for the payment section + * @return array Tabs for the payment section */ function payment_supplier_prepare_head(Paiement $object) { diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index 460697a2813..830369fe846 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -123,7 +123,7 @@ function prelevement_check_config($type = 'direct-debit') * @param BonPrelevement $object Member * @param int $nbOfInvoices No of invoices * @param int $nbOfSalaryInvoice No of salary invoices - * @return array head + * @return array Array of tabs to show */ function bon_prelevement_prepare_head(BonPrelevement $object, $nbOfInvoices, $nbOfSalaryInvoice) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a809f438419..53383acad48 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -193,6 +193,7 @@ function product_prepare_head($object) // Attachments require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = ''; if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) { $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); } @@ -315,10 +316,10 @@ function productlot_prepare_head($object) /** -* Return array head with list of tabs to view object information. -* -* @return array head array with tabs -*/ + * Return array head with list of tabs to view object information. + * + * @return array Array of tabs to show + */ function product_admin_prepare_head() { global $langs, $conf, $user, $db; @@ -378,7 +379,7 @@ function product_admin_prepare_head() /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function product_lot_admin_prepare_head() { diff --git a/htdocs/core/lib/receiptprinter.lib.php b/htdocs/core/lib/receiptprinter.lib.php index 7bbfbc66387..4999dab2894 100644 --- a/htdocs/core/lib/receiptprinter.lib.php +++ b/htdocs/core/lib/receiptprinter.lib.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 @@ -28,7 +29,7 @@ * Define head array for tabs of receipt printer setup pages * * @param string $mode Mode - * @return Array of head + * @return array Array of tabs to show */ function receiptprinteradmin_prepare_head($mode) { diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index 8bdaf599d78..2bacb7043b2 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2013 Jean-François Ferry * Copyright (C) 2016 Gilles Poirier * Copyright (C) 2023 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 @@ -28,7 +29,7 @@ * Prepare head for tabs * * @param Dolresource $object Object - * @return array Array of head entries + * @return array Array of tabs to show */ function resource_prepare_head($object) { @@ -110,7 +111,7 @@ function resource_prepare_head($object) /** * Prepare head for admin tabs * - * @return array Array of head entries + * @return array Array of tabs to show */ function resource_admin_prepare_head() { diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 6038510a7fa..4a6133a54a7 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2023 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 @@ -25,7 +26,7 @@ * It loads tabs from modules looking for the entity salaries * * @param Paiement $object Current salaries object - * @return array Tabs for the salaries section + * @return array Tabs for the salaries section */ function salaries_prepare_head($object) { @@ -98,7 +99,7 @@ function salaries_prepare_head($object) /** * Return array head with list of tabs to view object information * - * @return array head + * @return array Array of tabs to show */ function salaries_admin_prepare_head() { diff --git a/htdocs/core/lib/socialnetwork.lib.php b/htdocs/core/lib/socialnetwork.lib.php index 368b356f962..a195534d522 100644 --- a/htdocs/core/lib/socialnetwork.lib.php +++ b/htdocs/core/lib/socialnetwork.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2023 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 @@ -22,7 +23,7 @@ /** * Function for return different onglet of socialnetworks admin page - * @return array Tabs for the admin section + * @return array Tabs for the admin section */ function socialnetwork_prepare_head() { diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index c8cb6c22892..9a9238f91c1 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -87,7 +87,7 @@ function stock_prepare_head($object) /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array Array of tabs to show */ function stock_admin_prepare_head() { diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index c7714501d90..c956308145f 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 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 @@ -25,7 +26,7 @@ /** * Prepare array with list of tabs * - * @return array Array of tabs + * @return array Array of tabs to show */ function takepos_admin_prepare_head() { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 3ba2088e4b2..2ed7811961e 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -27,7 +27,7 @@ /** * Build tabs for admin page * - * @return array + * @return array */ function ticketAdminPrepareHead() { @@ -79,7 +79,7 @@ function ticketAdminPrepareHead() * Build tabs for a Ticket object * * @param Ticket $object Object Ticket - * @return array Array of tabs + * @return array Array of tabs to show */ function ticket_prepare_head($object) { @@ -218,12 +218,12 @@ function generate_random_id($car = 16) /** * Show http header, open body tag and show HTML header banner for public pages for tickets * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files + * @param string $title Title + * @param string $head Head array + * @param int<0,1> $disablejs More content into html header + * @param int<0,1> $disablehead More content into html header + * @param string[] $arrayofjs Array of complementary js files + * @param string[] $arrayofcss Array of complementary css files * @return void */ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index c4bebcedbb6..814c741090f 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -512,8 +512,8 @@ function dolWebsiteSaveContent($content) * @param string $containerref Ref of container to redirect to (Example: 'mypage' or 'mypage.php'). * @param string $containeraliasalt Ref of alternative aliases to redirect to. * @param int $containerid Id of container. - * @param int $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301 - * @param array $parameters Array of parameters to append to the URL. + * @param int<0,1> $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301 + * @param array $parameters Array of parameters to append to the URL. * @return void */ function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0, $parameters = array()) @@ -654,7 +654,7 @@ function includeContainer($containerref) * 'Name', 'os'=>'Windows', 'price'=>10)); ?> * * @param string $type 'blogpost', 'product', 'software', 'organization', 'qa', ... - * @param array $data Array of data parameters for structured data + * @param array $data Array of data parameters for structured data * @return string HTML content */ function getStructuredData($type, $data = array()) @@ -862,7 +862,7 @@ function getStructuredData($type, $data = array()) /** * Return HTML content to add as header card for an article, news or Blog Post or home page. * - * @param array $params Array of parameters + * @param ?array $params Array of parameters * @return string HTML content */ function getSocialNetworkHeaderCards($params = null) @@ -1106,7 +1106,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '') * Return array with list of all public files of a given object. * * @param Object $object Object - * @return array List of public files of object + * @return array List of public files of object * @see getImagePublicURLOfObject() */ function getPublicFilesOfObject($object) @@ -1163,11 +1163,11 @@ function getPublicFilesOfObject($object) * @param string $searchstring Search string * @param int $max Max number of answers * @param string $sortfield Sort Fields - * @param string $sortorder Sort order ('DESC' or 'ASC') + * @param 'DESC'|'ASC' $sortorder Sort order ('DESC' or 'ASC') * @param string $langcode Language code ('' or 'en', 'fr', 'es', ...) - * @param array $otherfilters Other filters - * @param int $status 0 or 1, or -1 for both - * @return array Array with results of search + * @param array $otherfilters Other filters + * @param int<-1,1> $status 0 or 1, or -1 for both + * @return array{list?:WebsitePage[],code?:string,message?:string} Array with results of search */ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = [], $status = 1) { @@ -1534,7 +1534,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify * Retrieves the details of a news post by its ID. * * @param string $postId The ID of the news post to retrieve. - * @return array|int Return array if OK, -1 if KO + * @return array|int<-1,-1> Return array if OK, -1 if KO */ function getNewsDetailsById($postId) { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3d215cc3a6f..728a9856da1 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -559,7 +559,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } if ($localtax2_type && $localtax2ligne != 0) { if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { - $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + $this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne; } else { $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; } @@ -869,7 +869,7 @@ class pdf_aurore extends ModelePDFSupplierProposal * Show total to pay * * @param TCPDF $pdf Object PDF - * @param Facture $object Object invoice + * @param SupplierProposal $object Object proposal * @param int $deja_regle Montant deja regle * @param int $posy Position depart * @param Translate $outputlangs Object langs @@ -1144,7 +1144,7 @@ class pdf_aurore extends ModelePDFSupplierProposal //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1210,6 +1210,7 @@ class pdf_aurore extends ModelePDFSupplierProposal protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $conf, $langs; + '@phan-var-force SupplierProposal $object'; // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies")); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 72044b24b05..0713297269d 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -694,7 +694,7 @@ class pdf_zenith extends ModelePDFSupplierProposal } if ($localtax2_type && $localtax2ligne != 0) { if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { - $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + $this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne; } else { $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; } @@ -1146,7 +1146,7 @@ class pdf_zenith extends ModelePDFSupplierProposal //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index 1e8f9f09d47..b0e8440e2f7 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * 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 @@ -38,7 +39,13 @@ class DonationStats extends Stats */ public $table_element; + /** + * @var int + */ public $socid; + /** + * @var int + */ public $userid; /** @@ -114,7 +121,7 @@ class DonationStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with number by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -132,7 +139,7 @@ class DonationStats extends Stats /** * Return shipments number per year * - * @return array Array with number by year + * @return array Array of nb each year * */ public function getNbByYear() @@ -152,7 +159,7 @@ class DonationStats extends Stats * * @param int $year Year * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of amount each month + * @return array,array{0:int<1,12>,1:int|float}> Array of amount each month */ public function getAmountByMonth($year, $format = 0) { @@ -171,7 +178,7 @@ class DonationStats extends Stats * Return average amount each month * * @param int $year Year - * @return array Array of average each month + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -189,7 +196,7 @@ class DonationStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 2813f9a130c..783a9a45028 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -38,7 +38,7 @@ $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); // Load translation files required by the page -$langs->loadLangs("donations"); +$langs->loadLangs(array("donations")); $userid = GETPOSTINT('userid'); $socid = GETPOSTINT('socid'); @@ -226,7 +226,7 @@ if (isModEnabled('category')) { $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); print ''.$cat_label.''; - $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories($cat_type, '', 'parent', 0, 0, 1); print img_picto('', 'category', 'class="pictofixedwidth"'); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300'); print ''; @@ -274,7 +274,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { + while (!empty($year) && $oldyear > (int) $year + 1) { $oldyear--; print ''; print ''.$oldyear.''; diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index 75a5d47103e..492b5b4aa86 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -27,7 +27,7 @@ * Prepare array of tabs for EmailCollector * * @param EmailCollector $object EmailCollector - * @return array Array of tabs + * @return array Array of tabs to show */ function emailcollectorPrepareHead($object) { diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index a6ad366354a..f232592f51a 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -120,18 +120,54 @@ class ConferenceOrBooth extends ActionComm 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'EvntOrgDraft', '1' => 'EvntOrgSuggested', '2' => 'EvntOrgConfirmed', '3' => 'EvntOrgNotQualified', '4' => 'EvntOrgDone', '9' => 'EvntOrgCancelled'),), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $id; + /** + * @var string + */ public $label; + /** + * @var int + */ public $fk_soc; + /** + * @var int + */ public $fk_project; + /** + * @var string + */ public $note; + /** + * @var int + */ public $fk_action; + /** + * @var int + */ public $datec; + /** + * @var int + */ public $fk_user_author; + /** + * @var int + */ public $fk_user_mod; + /** + * @var string + */ public $import_key; + /** + * @var int + */ public $status; // END MODULEBUILDER PROPERTIES @@ -714,7 +750,7 @@ class ConferenceOrBooth extends ActionComm } if (property_exists($this, 'amount')) { $return .= '
'; - $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; + $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; // @phan-suppress-current-line PhanUndeclaredProperty } if (method_exists($this, 'getLibStatut')) { $return .= '
'.$this->getLibStatut(3).'
'; @@ -773,10 +809,10 @@ class ConferenceOrBooth extends ActionComm * * @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/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 2945f6ae3fb..111da1e56ae 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -28,7 +28,7 @@ * * @param ConferenceOrBooth $object ConferenceOrBooth * @param int $with_project Add project id to URL - * @return array Array of tabs + * @return array Array of tabs to show */ function conferenceorboothPrepareHead($object, $with_project = 0) { @@ -116,7 +116,7 @@ function conferenceorboothPrepareHead($object, $with_project = 0) * Prepare array of tabs for ConferenceOrBooth Project tab * * @param Project $object Project - * @return array + * @return array */ function conferenceorboothProjectPrepareHead($object) { @@ -191,7 +191,7 @@ function conferenceorboothProjectPrepareHead($object) * Prepare array of tabs for ConferenceOrBoothAttendees * * @param ConferenceOrBoothAttendee $object ConferenceOrBoothAttendee - * @return array> Array of tabs + * @return array Array of tabs */ function conferenceorboothAttendeePrepareHead($object) { diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php index 425cd4a7e1b..d53bd0e0628 100644 --- a/htdocs/expedition/class/expeditionstats.class.php +++ b/htdocs/expedition/class/expeditionstats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * 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 @@ -112,7 +113,7 @@ class ExpeditionStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with number by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -135,7 +136,7 @@ class ExpeditionStats extends Stats /** * Return shipments number per year * - * @return array Array with number by year + * @return array Array of nb each year * */ public function getNbByYear() @@ -159,7 +160,7 @@ class ExpeditionStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { @@ -183,7 +184,7 @@ class ExpeditionStats extends Stats * Return the orders amount average by month for a year * * @param int $year year for stats - * @return array array with number by month + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -205,7 +206,7 @@ class ExpeditionStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index f8d905475c2..f21be7acba5 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -262,7 +262,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { // If we have empty year + while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 5f1c0858959..8b25b65281a 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * 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 @@ -112,7 +113,7 @@ class ExpenseReportStats extends Stats /** * Return nb of expense report per year * - * @return array Array of values + * @return array Array of nb each year */ public function getNbByYear() { @@ -130,7 +131,7 @@ class ExpenseReportStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -152,7 +153,7 @@ class ExpenseReportStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { @@ -172,7 +173,7 @@ class ExpenseReportStats extends Stats * Return average amount * * @param int $year Year to scan - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -189,7 +190,7 @@ class ExpenseReportStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index c302138a8bd..34e87c54b64 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -3,6 +3,7 @@ * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2012 Marcos García * Copyright (C) 2018 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 @@ -39,7 +40,8 @@ $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer'; $object_status = GETPOST('object_status', 'intcomma'); $userid = GETPOSTINT('userid'); -$socid = GETPOSTINT('socid'); if ($socid < 0) { +$socid = GETPOSTINT('socid'); +if ($socid < 0) { $socid = 0; } $id = GETPOSTINT('id'); @@ -272,7 +274,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while ($year && $oldyear > $year + 1) { // If we have empty year + while ($year && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index d5d58ec8bfd..c2f7fbd7638 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -91,7 +91,7 @@ class FichinterStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with number by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -114,7 +114,7 @@ class FichinterStats extends Stats /** * Return interventions number per year * - * @return array Array with number by year + * @return array Array of nb each year * */ public function getNbByYear() @@ -138,7 +138,7 @@ class FichinterStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getAmountByMonth($year, $format = 0) { @@ -162,7 +162,7 @@ class FichinterStats extends Stats * Return the intervention amount average by month for a year * * @param int $year year for stats - * @return array array with number by month + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ public function getAverageByMonth($year) { @@ -184,7 +184,7 @@ class FichinterStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index cdd926c9471..63af162e404 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.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 @@ -271,7 +272,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { + while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index 88a851f0137..3dd00c38b62 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2022 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 @@ -29,7 +30,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function hrmAdminPrepareHead() { diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index adeb2637445..69df852cadf 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -3,6 +3,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 @@ -28,7 +29,7 @@ * Prepare array of tabs for Job * * @param Job $object Job - * @return array Array of tabs + * @return array Array of tabs to show */ function jobPrepareHead($object) { diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php index 2cb05a9593b..c21c042bbc6 100644 --- a/htdocs/hrm/lib/hrm_position.lib.php +++ b/htdocs/hrm/lib/hrm_position.lib.php @@ -3,6 +3,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 @@ -29,7 +30,7 @@ * Prepare array of tabs for positions * * @param Position $object Position - * @return array Array of tabs + * @return array Array of tabs to show */ function positionCardPrepareHead($object) { diff --git a/htdocs/hrm/lib/hrm_skill.lib.php b/htdocs/hrm/lib/hrm_skill.lib.php index c3b7b892c79..9c5a61c158c 100644 --- a/htdocs/hrm/lib/hrm_skill.lib.php +++ b/htdocs/hrm/lib/hrm_skill.lib.php @@ -3,6 +3,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 @@ -28,7 +29,7 @@ * Prepare array of tabs for Skill * * @param Skill $object Skill - * @return array Array of tabs + * @return array Array of tabs to show */ function skillPrepareHead($object) { diff --git a/htdocs/hrm/lib/hrm_skilldet.lib.php b/htdocs/hrm/lib/hrm_skilldet.lib.php index 1ba52808f28..679fae5ffb0 100644 --- a/htdocs/hrm/lib/hrm_skilldet.lib.php +++ b/htdocs/hrm/lib/hrm_skilldet.lib.php @@ -3,6 +3,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 @@ -28,7 +29,7 @@ * Prepare array of tabs for Skilldet * * @param Skilldet $object Skilldet - * @return array Array of tabs + * @return array Array of tabs to show */ function skilldetPrepareHead($object) { diff --git a/htdocs/hrm/lib/hrm_skillrank.lib.php b/htdocs/hrm/lib/hrm_skillrank.lib.php index 1d0083ea37f..6ab9e994f5e 100644 --- a/htdocs/hrm/lib/hrm_skillrank.lib.php +++ b/htdocs/hrm/lib/hrm_skillrank.lib.php @@ -3,6 +3,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 @@ -28,7 +29,7 @@ * Prepare array of tabs for SkillRank * * @param SkillRank $object SkillRank - * @return array Array of tabs + * @return array Array of tabs to show */ function skillrankPrepareHead($object) { @@ -115,7 +116,7 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode $skilldet = new Skilldet($db); $Lines = $skilldet->fetchAll('ASC', 'rankorder', 0, 0, '(fk_skill:=:'.((int) $fk_skill).')'); - if (!is_array($Lines) && $Lines<0) { + if (!is_array($Lines) && $Lines < 0) { setEventMessages($skilldet->error, $skilldet->errors, 'errors'); } if (empty($Lines)) { diff --git a/htdocs/intracommreport/lib/intracommreport.lib.php b/htdocs/intracommreport/lib/intracommreport.lib.php index ad19b8002af..27467f2a125 100644 --- a/htdocs/intracommreport/lib/intracommreport.lib.php +++ b/htdocs/intracommreport/lib/intracommreport.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 Array of tabs to show */ function intracommreportAdminPrepareHead() { @@ -75,7 +76,7 @@ function intracommreportAdminPrepareHead() * Prepare array of tabs for IntraCommReport * * @param IntraCommReport $object IntraCommReport - * @return array Array of tabs + * @return array Array of tabs to show */ function intracommreportPrepareHead($object) { diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index f6d94797387..abf1958dedb 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -27,7 +27,7 @@ /** * Define head array for tabs of marges tools setup pages * - * @return Array of head + * @return array Array of tabs to show */ function marges_admin_prepare_head() { @@ -55,7 +55,7 @@ function marges_admin_prepare_head() /** * Return array of tabs to used on pages for third parties cards. * - * @return array Array of tabs + * @return array Array of tabs to show */ function marges_prepare_head() { diff --git a/htdocs/mrp/lib/mrp.lib.php b/htdocs/mrp/lib/mrp.lib.php index 20840d40e1b..17e1eae0639 100644 --- a/htdocs/mrp/lib/mrp.lib.php +++ b/htdocs/mrp/lib/mrp.lib.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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function mrpAdminPrepareHead() { diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 63f39445e91..3b135210fdd 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -1,6 +1,7 @@ + * 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 @@ -26,7 +27,7 @@ * Prepare array of tabs for Mo * * @param Mo $object Mo - * @return array Array of tabs + * @return array Array of tabs to show */ function moPrepareHead($object) { diff --git a/htdocs/opensurvey/lib/opensurvey.lib.php b/htdocs/opensurvey/lib/opensurvey.lib.php index 6ec2ee54605..cec135abe00 100644 --- a/htdocs/opensurvey/lib/opensurvey.lib.php +++ b/htdocs/opensurvey/lib/opensurvey.lib.php @@ -29,7 +29,7 @@ * It loads tabs from modules looking for the entity Opensurveyso * * @param Opensurveysondage $object Current viewing poll - * @return array Tabs for the opensurvey section + * @return array Tabs for the opensurvey section */ function opensurvey_prepare_head(Opensurveysondage $object) { diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php index f5822e20a16..92ae9e1c4db 100644 --- a/htdocs/partnership/lib/partnership.lib.php +++ b/htdocs/partnership/lib/partnership.lib.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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function partnershipAdminPrepareHead() { @@ -78,7 +79,7 @@ function partnershipAdminPrepareHead() * Prepare array of tabs for Partnership * * @param Partnership $object Partnership - * @return array Array of tabs + * @return array Array of tabs to show */ function partnershipPrepareHead($object) { diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 13733e2be52..8ba85109cb8 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; /** * Define head array for tabs of paypal tools setup pages * - * @return Array of head + * @return array Array of tabs to show */ function paypaladmin_prepare_head() { diff --git a/htdocs/printing/lib/printing.lib.php b/htdocs/printing/lib/printing.lib.php index 291ebd46ca8..fc038c68c3a 100644 --- a/htdocs/printing/lib/printing.lib.php +++ b/htdocs/printing/lib/printing.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 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 @@ -28,7 +29,7 @@ * Define head array for tabs of printing tools setup pages * * @param string $mode Mode - * @return array Array of head + * @return array Array of tabs to show */ function printingAdminPrepareHead($mode) { diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php index a3534229246..cff17432fe7 100644 --- a/htdocs/product/inventory/lib/inventory.lib.php +++ b/htdocs/product/inventory/lib/inventory.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 ATM Consulting + * 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 @@ /** * Define head array for tabs of inventory tools setup pages * - * @return array Array of head + * @return array Array of tabs to show */ function inventoryAdminPrepareHead() { @@ -64,7 +65,7 @@ function inventoryAdminPrepareHead() * @param string $title parameter * @param string $get parameter * - * @return array Array of head + * @return array Array of tabs to show */ function inventoryPrepareHead(&$inventory, $title = 'Inventory', $get = '') { @@ -75,7 +76,7 @@ function inventoryPrepareHead(&$inventory, $title = 'Inventory', $get = '') array(dol_buildpath('/product/inventory/inventory.php?id='.$inventory->id.$get, 1), $langs->trans('Inventory'), 'inventory') ); - $h=2; + $h = 2; complete_head_from_modules($conf, $langs, $inventory, $head, $h, 'inventory'); complete_head_from_modules($conf, $langs, $inventory, $head, $h, 'inventory', 'remove'); diff --git a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php index 90fd3f25ba9..0392e51dff0 100644 --- a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php +++ b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php @@ -1,6 +1,7 @@ + * 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 admin pages header * - * @return array + * @return array Array of tabs to show */ function stocktransferAdminPrepareHead() { diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 5c4e6c2045a..48500e722be 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -135,7 +135,7 @@ class ProjectStats extends Stats /** * Return count, and sum of products * - * @return array of values + * @return array Array of values */ public function getAllByYear() { @@ -237,7 +237,7 @@ class ProjectStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -262,7 +262,7 @@ class ProjectStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getAmountByMonth($year, $format = 0) { @@ -374,7 +374,7 @@ class ProjectStats extends Stats * * @param int $year Year to scan * @param int $wonlostfilter Add a filter on status won/lost - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getWeightedAmountByMonth($year, $wonlostfilter = 1) { @@ -482,7 +482,7 @@ class ProjectStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month */ public function getTransformRateByMonth($year, $format = 0) { @@ -531,7 +531,7 @@ class ProjectStats extends Stats /** * Return average of entity by month * @param int $year year number - * @return array + * @return array,array{0:int<1,12>,1:int|float}> Array with number by month */ protected function getAverageByMonth($year) { diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 9d792420754..b4290635b7e 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.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 @@ -113,7 +114,7 @@ class TaskStats extends Stats /** * Return count, and sum of products * - * @return array of values + * @return array Array of values */ public function getAllByYear() { @@ -173,7 +174,7 @@ class TaskStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -201,7 +202,7 @@ class TaskStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array with amount by month + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index eb99b0d35d1..6a3bcc6724a 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2015-2021 Laurent Destailleur + * 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 @@ -279,7 +280,7 @@ print ''; $oldyear = 0; foreach ($data_all_year as $val) { $year = $val['year']; - while ($year && $oldyear > $year + 1) { // If we have empty year + while ($year && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index fc6bdc33d97..04e2b9fbccf 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Laurent Destailleur + * 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 @@ -190,7 +191,7 @@ print ''; $oldyear = 0; foreach ($data_all_year as $val) { $year = $val['year']; - while ($year && $oldyear > $year + 1) { // If we have empty year + while ($year && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index eff1c46628b..e8fe227c50d 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -67,7 +67,7 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$eventtype = GETPOST("eventtype"); +$eventtype = GETPOSTINT("eventtype"); $email = GETPOST("email"); $societe = GETPOST("societe"); $label = GETPOST("label"); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index ff764b1fcae..ad1a877e085 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -67,7 +67,7 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$eventtype = GETPOST("eventtype"); +$eventtype = GETPOSTINT("eventtype"); $email = GETPOST("email"); $societe = GETPOST("societe"); $label = GETPOST("label"); diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index fa62583f102..fb5bb7ac696 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -167,7 +167,7 @@ class ReceptionStats extends Stats * Return the orders amount average by month for a year * * @param int $year year for stats - * @return array,array{0:int<1,12>,1:int|float}> Array of average each month array with number by month + * @return array,array{0:int<1,12>,1:int|float}> Array of average each month */ public function getAverageByMonth($year) { @@ -189,7 +189,7 @@ class ReceptionStats extends Stats /** * Return nb, total and average * - * @return array Array with nb, total amount, average for each year + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 3f74defca3c..f10db268366 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -113,6 +113,7 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; + $objstat = null; if ($action == 'add_element_resource' && !$cancel) { $res = 0; @@ -185,7 +186,7 @@ if (empty($reshook)) { } } - if (!$error && $res > 0) { + if (!$error && $res > 0 && is_object($objstat)) { setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$objstat->id); exit; @@ -195,15 +196,15 @@ if (empty($reshook)) { } // Update resource - if ($action == 'update_linked_resource' && $user->hasRight('resource', 'write') && !GETPOST('cancel', 'alpha')) { + if ($action == 'update_linked_resource' && $user->hasRight('resource', 'write') && !GETPOST('cancel', 'alpha') && is_object($objstat)) { $res = $object->fetchElementResource($lineid); if ($res) { $object->busy = $busy; $object->mandatory = $mandatory; if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK') && $object->element_type == 'action' && $object->resource_type == 'dolresource' && intval($object->busy) == 1) { - $eventDateStart = $object->objelement->datep; - $eventDateEnd = $object->objelement->datef; + $eventDateStart = $object->objelement->datep; // @phan-suppress-current-line PhanUndeclaredProperty + $eventDateEnd = $object->objelement->datef; // @phan-suppress-current-line PhanUndeclaredProperty $isFullDayEvent = $objstat->fulldayevent; if (empty($eventDateEnd)) { if ($isFullDayEvent) { @@ -482,7 +483,7 @@ if (!$ret) { $listofcontactid = array(); // not used yet $listofotherid = array(); // not used yet print '
'; - print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', ($act->datep != $act->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid); + print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($act->datep != $act->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid); print '
'; /*if (in_array($user->id,array_keys($listofuserid))) { diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index ff54b229846..64269370560 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -80,13 +80,14 @@ class PaymentSalary extends CommonObject public $datep = ''; /** - * @deprecated + * @deprecated Use $amount * @see $amount + * @var float|string */ public $total; /** - * @var float Total amount of payment + * @var float Total amount of payment */ public $amount; @@ -102,7 +103,7 @@ class PaymentSalary extends CommonObject /** * @var string - * @deprecated + * @deprecated Use $num_payment */ public $num_paiement; @@ -295,7 +296,7 @@ class PaymentSalary extends CommonObject //$deposits=$tmpsalary->getSumDepositsUsed(); $deposits = 0; $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT'); - $remaintopay = price2num($tmpsalary->amount - $paiement - $creditnotes - $deposits, 'MT'); + $remaintopay = price2num((float) $tmpsalary->amount - $paiement - $creditnotes - $deposits, 'MT'); if ($remaintopay == 0) { $result = $tmpsalary->setPaid($user); } else { diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php index 384e939787e..11c250fcab4 100644 --- a/htdocs/salaries/class/salariesstats.class.php +++ b/htdocs/salaries/class/salariesstats.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Alexandre Spangaro * Copyright (c) 2018 Fidesio * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -47,7 +48,7 @@ class SalariesStats extends Stats * * @param DoliDB $db Database handler * @param int $socid Id third party - * @param mixed $userid Id user for filter or array of user ids + * @param int|int[] $userid Id user for filter or array of user ids * @return void */ public function __construct($db, $socid = 0, $userid = 0) @@ -77,7 +78,7 @@ class SalariesStats extends Stats /** * Return the number of salary by year * - * @return array Array of values + * @return array Array of nb each year */ public function getNbByYear() { @@ -95,7 +96,7 @@ class SalariesStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values by month + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -117,7 +118,7 @@ class SalariesStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { @@ -137,7 +138,7 @@ class SalariesStats extends Stats * Return average amount * * @param int $year Year to scan - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAverageByMonth($year) { @@ -154,7 +155,7 @@ class SalariesStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 1daacafe330..5e8f0901494 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -67,10 +67,22 @@ class Salary extends CommonObject */ public $fk_user; + /** + * @var int|string + */ public $datep; + /** + * @var int|string + */ public $datev; + /** + * @var string + */ public $salary; + /** + * @var float|string + */ public $amount; /** @@ -78,7 +90,13 @@ class Salary extends CommonObject */ public $fk_project; + /** + * @var int + */ public $type_payment; // TODO Rename into type_payment_id + /** + * @var string + */ public $type_payment_code; /** @@ -86,7 +104,13 @@ class Salary extends CommonObject */ public $label; + /** + * @var int|string + */ public $datesp; + /** + * @var int|string + */ public $dateep; /** @@ -116,19 +140,22 @@ class Salary extends CommonObject public $fk_user_modif; /** - * @var user User + * @var User */ public $user; /** - * @var int 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) - * @deprecated + * @var int<0,1> 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) + * @deprecated Use $status and $close_code */ public $paye; const STATUS_UNPAID = 0; const STATUS_PAID = 1; + /** + * @var string + */ public $resteapayer; public $fields = array( @@ -847,7 +874,9 @@ class Salary extends CommonObject $return .= ''; } if (!empty($arraydata['user']) && is_object($arraydata['user'])) { - $return .= '
'.$arraydata['user']->getNomUrl(empty($arraydata['user']->photo) ? 1 : -1, '', 0, 0, 16, 0, '', 'maxwidth100').''; + $user = $arraydata['user']; + '@phan-var-force User $user'; + $return .= '
'.$user->getNomUrl(empty($arraydata['user']->photo) ? 1 : -1, '', 0, 0, 16, 0, '', 'maxwidth100').''; } if (property_exists($this, 'amount')) { $return .= '
'.price($this->amount).''; diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 5f3165ed14b..b9095416ec3 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2016-2018 Frédéric France * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -282,7 +283,7 @@ if ($action == 'create') { print ''.price($sumpaid).""; - print ''.price($objp->amount - $sumpaid).""; + print ''.price((float) $objp->amount - $sumpaid).""; print ''; if ($sumpaid < $objp->amount) { @@ -292,7 +293,7 @@ if ($action == 'create') { if (!empty($conf->use_javascript_ajax)) { print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); } */ - $valuetoshow = GETPOSTISSET($namef) ? GETPOST($namef) : ($objp->amount - $sumpaid); + $valuetoshow = GETPOSTISSET($namef) ? GETPOST($namef) : ((float) $objp->amount - $sumpaid); print ''; print ''; diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 592883b8443..0566503e631 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -240,7 +240,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while ($year && $oldyear > $year + 1) { + while ($year && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index 96a5db052a2..a2733f878b4 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -424,7 +424,7 @@ if ($resql) { // print ''.$langs->trans("AlreadyPaid").' :'.price($totalpaid)."\n"; // print ''.$langs->trans("AmountExpected").' :'.price($object->amount)."\n"; - $resteapayer = $object->amount - $totalpaid; + $resteapayer = (float) $object->amount - $totalpaid; // $cssforamountpaymentcomplete = 'amountpaymentcomplete'; // print ''.$langs->trans("RemainderToPay")." :"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 0e8fee90371..a1a8b990b93 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -362,17 +362,17 @@ if (empty($reshook)) { $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); - $object->capital = GETPOST('capital', 'alphanohtml'); + $object->capital = GETPOSTFLOAT('capital'); $object->barcode = GETPOST('barcode', 'alphanohtml'); $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); - $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); + $object->tva_assuj = GETPOSTINT('assujtva_value'); $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; - $object->status = GETPOST('status', 'alpha'); + $object->status = GETPOSTINT('status'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); + $object->localtax1_assuj = GETPOSTINT('localtax1assuj_value'); + $object->localtax2_assuj = GETPOSTINT('localtax2assuj_value'); $object->localtax1_value = GETPOST('lt1', 'alpha'); $object->localtax2_value = GETPOST('lt2', 'alpha'); @@ -1040,8 +1040,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Prospect / Customer if (GETPOST("type", 'aZ') == 'c') { - if (getDolGlobalString('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) { - $object->client = getDolGlobalString('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'); + if (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) { + $object->client = getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'); } else { $object->client = 3; } @@ -1092,7 +1092,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->capital = GETPOST('capital', 'alphanohtml'); + $object->capital = GETPOSTFLOAT('capital'); $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); @@ -1122,8 +1122,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->localtax1_assuj = GETPOSTINT('localtax1assuj_value'); $object->localtax2_assuj = GETPOSTINT('localtax2assuj_value'); - $object->localtax1_value = GETPOSTINT('lt1'); - $object->localtax2_value = GETPOSTINT('lt2'); + $object->localtax1_value = GETPOST('lt1', 'alpha'); + $object->localtax2_value = GETPOST('lt2', 'alpha'); $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); @@ -2089,7 +2089,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->no_email = GETPOSTINT("no_email"); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->capital = GETPOST('capital', 'alphanohtml'); + $object->capital = GETPOSTFLOAT('capital'); $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); $object->idprof3 = GETPOST('idprof3', 'alphanohtml'); @@ -2137,8 +2137,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } //Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + $object->localtax1_assuj = GETPOSTINT('localtax1assuj_value'); + $object->localtax2_assuj = GETPOSTINT('localtax2assuj_value'); $object->localtax1_value = GETPOST('lt1'); $object->localtax2_value = GETPOST('lt2'); @@ -2690,7 +2690,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Capital print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).''; print ' '.$langs->trans("Currency".$object->multicurrency_code).''; } else { diff --git a/htdocs/stripe/lib/stripe.lib.php b/htdocs/stripe/lib/stripe.lib.php index de510a35d56..9f94fadd5eb 100644 --- a/htdocs/stripe/lib/stripe.lib.php +++ b/htdocs/stripe/lib/stripe.lib.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 @@ -27,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; /** * Define head array for tabs of stripe tools setup pages * - * @return Array of head + * @return array Array of tabs to show */ function stripeadmin_prepare_head() { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index a3d739f5bd0..aa7f2274c78 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -290,7 +290,7 @@ if (empty($reshook)) { $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); $object->fk_account = GETPOSTINT('fk_account'); - $object->socid = GETPOST('socid'); + $object->socid = GETPOSTINT('socid'); $object->fk_project = GETPOSTINT('projectid'); $object->model_pdf = GETPOST('model'); $object->author = $user->id; // deprecated diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 6f573d2022b..d400c8e46f1 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -92,15 +92,25 @@ class SupplierProposal extends CommonObject */ protected $table_ref_field = 'ref'; + /** + * @var int + */ public $socid; // Id client /** - * @deprecated + * @deprecated Use $user_author_id * @see $user_author_id + * @var int */ public $author; + /** + * @var string + */ public $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande + /** + * @var string + */ public $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande /** @@ -120,43 +130,60 @@ class SupplierProposal extends CommonObject public $delivery_date; /** - * @deprecated + * @deprecated Use $date_creation * @see $date_creation + * @var int|string */ public $datec; /** - * @deprecated + * @deprecated Use $date_validation * @see $date_validation + * @var int|string */ public $datev; + /** + * @var int + */ public $user_author_id; /** - * @deprecated + * @deprecated Use $price_ht * @see $price_ht + * @var float */ public $price; /** - * @deprecated + * @deprecated Use $total_tva * @see $total_tva + * @var float */ public $tva; /** - * @deprecated + * @deprecated Use $total_ttc * @see $total_ttc + * @var float */ public $total; + /** + * @var string + */ public $cond_reglement_code; + /** + * @var string + */ public $cond_reglement_doc; // label doc + /** + * @var string + */ public $mode_reglement_code; /** - * @deprecated + * @deprecated Use $mode_reglement_code * @var string Mode reglement */ public $mode_reglement; @@ -166,12 +193,21 @@ class SupplierProposal extends CommonObject */ public $extraparams = array(); public $lines = array(); + /** + * @var SupplierProposalLine + */ public $line; public $labelStatus = array(); public $labelStatusShort = array(); + /** + * @var int + */ public $nbtodo; + /** + * @var int + */ public $nbtodolate; // Multicurrency @@ -180,10 +216,25 @@ class SupplierProposal extends CommonObject */ public $fk_multicurrency; + /** + * @var string + */ 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; /** @@ -361,15 +412,15 @@ class SupplierProposal extends CommonObject * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * * @param string $desc Description de la ligne - * @param double $pu_ht Prix unitaire - * @param double $qty Quantite - * @param double $txtva Taux de tva - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu_ht Prix unitaire + * @param float $qty Quantite + * @param float $txtva Taux de tva + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Product/Service ID predefined - * @param double $remise_percent Percentage discount of the line + * @param float $remise_percent Percentage discount of the line * @param string $price_base_type HT or TTC - * @param double $pu_ttc Prix unitaire TTC + * @param float $pu_ttc Prix unitaire TTC * @param int $info_bits Bits of type of lines * @param int $type Type of line (product, service) * @param int $rang Position of line @@ -378,12 +429,12 @@ class SupplierProposal extends CommonObject * @param int $fk_fournprice Id supplier price. If 0, we will take best price. If -1 we keep it empty. * @param int $pa_ht Buying price without tax * @param string $label ??? - * @param array $array_options extrafields array + * @param array $array_options extrafields array * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. * @param string $origin 'order', 'supplier_proposal', ... * @param int $origin_id Id of origin line - * @param double $pu_ht_devise Amount in currency + * @param float $pu_ht_devise Amount in currency * @param int $date_start Date start * @param int $date_end Date end * @return int >0 if OK, <0 if KO @@ -648,12 +699,12 @@ class SupplierProposal extends CommonObject * Update a proposal line * * @param int $rowid Id de la ligne - * @param double $pu Unit price (HT or TTC depending on price_base_type) - * @param double $qty Quantity - * @param double $remise_percent Discount on line - * @param double $txtva VAT rate - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu Unit price (HT or TTC depending on price_base_type) + * @param float $qty Quantity + * @param float $remise_percent Discount on line + * @param float $txtva VAT rate + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param string $desc Description * @param string $price_base_type HT or TTC * @param int $info_bits Miscellaneous information @@ -664,10 +715,10 @@ class SupplierProposal extends CommonObject * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label ??? * @param int $type 0/1=Product/service - * @param array $array_options extrafields array + * @param array $array_options extrafields array * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. - * @param double $pu_ht_devise Unit price in currency + * @param float $pu_ht_devise Unit price in currency * @return int 0 if OK, <0 if KO */ public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_options = [], $ref_supplier = '', $fk_unit = 0, $pu_ht_devise = 0) @@ -1145,6 +1196,7 @@ class SupplierProposal extends CommonObject require_once DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/" . getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').'.php'; $obj = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON'); $modSupplierProposal = new $obj(); + '@phan-var-force ModeleNumRefSupplierProposal $modSupplierProposal'; $this->ref = $modSupplierProposal->getNextValue($objsoc, $this); // Create clone @@ -1541,7 +1593,7 @@ class SupplierProposal extends CommonObject * Set an overall discount on the proposal * * @param User $user Object user that modify - * @param double $remise Amount discount + * @param float $remise Amount discount * @return int Return integer <0 if ko, >0 if ok */ /* @@ -1574,7 +1626,7 @@ class SupplierProposal extends CommonObject * Set an absolute overall discount on the proposal * * @param User $user Object user that modify - * @param double $remise Amount discount + * @param float $remise Amount discount * @return int Return integer <0 if ko, >0 if ok */ /* @@ -1774,7 +1826,7 @@ class SupplierProposal extends CommonObject } $productsupplier->id = $product->fk_product; - $productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', ''); + $productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, 0, $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, 0, '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', 0); } return 1; @@ -1930,7 +1982,7 @@ class SupplierProposal extends CommonObject * @param int $offset For pagination * @param string $sortfield Sort criteria * @param string $sortorder Sort order - * @return array|int -1 if KO, array with result if OK + * @return array|array|int<-1,-1> -1 if KO, array with result if OK */ public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datec', $sortorder = 'DESC') { @@ -2237,6 +2289,7 @@ class SupplierProposal extends CommonObject if ($resql) { $label = $labelShort = ''; $status = ''; + $delay_warning = 0; if ($mode == 'opened') { $delay_warning = !empty($conf->supplier_proposal->cloture->warning_delay) ? $conf->supplier_proposal->cloture->warning_delay : 0; $status = self::STATUS_VALIDATED; @@ -2430,6 +2483,7 @@ class SupplierProposal extends CommonObject } $obj = new $classname(); + '@phan-var-force ModeleNumRefSupplierProposal $obj'; $numref = ""; $numref = $obj->getNextValue($soc, $this); @@ -2676,13 +2730,13 @@ class SupplierProposal extends CommonObject /** * 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) { @@ -2821,6 +2875,9 @@ class SupplierProposalLine extends CommonObjectLine */ public $fk_parent_attribute = 'fk_supplier_proposal'; + /** + * @var SupplierProposalLine + */ public $oldline; /** @@ -2838,6 +2895,9 @@ class SupplierProposalLine extends CommonObjectLine */ public $fk_parent_line; + /** + * @var string + */ public $desc; // Description ligne /** @@ -2846,8 +2906,9 @@ class SupplierProposalLine extends CommonObjectLine public $fk_product; // Id produit predefini /** - * @deprecated + * @deprecated Use $product_type * @see $product_type + * @var int */ public $fk_product_type; /** @@ -2861,7 +2922,13 @@ class SupplierProposalLine extends CommonObjectLine * @var float Quantity */ public $qty; + /** + * @var float|string + */ public $tva_tx; + /** + * @var string + */ public $vat_src_code; /** @@ -2869,6 +2936,9 @@ class SupplierProposalLine extends CommonObjectLine * @var float */ public $subprice; + /** + * @var float|string + */ public $remise_percent; /** @@ -2876,6 +2946,9 @@ class SupplierProposalLine extends CommonObjectLine */ public $fk_remise_except; + /** + * @var int + */ public $rang = 0; /** @@ -2883,8 +2956,17 @@ class SupplierProposalLine extends CommonObjectLine */ public $fk_fournprice; + /** + * @var int|float|string + */ public $pa_ht; + /** + * @var int|float + */ public $marge_tx; + /** + * @var int|float + */ public $marque_tx; /** @@ -2895,20 +2977,39 @@ class SupplierProposalLine extends CommonObjectLine // 2: ecotaxe // 3: option line (when qty = 0) + /** + * @var int + */ public $info_bits = 0; // Liste d'options cumulables: // Bit 0: 0 si TVA normal - 1 if TVA NPR // Bit 1: 0 ligne normal - 1 if fixed reduction + /** + * @var float + */ public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne + /** + * @var float + */ public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne + /** + * @var float + */ public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne + /** + * @var int|string + */ public $date_start; + /** + * @var int|string + */ public $date_end; // From llx_product /** - * @deprecated + * @var string + * @deprecated Use $product_ref * @see $product_ref */ public $ref; @@ -2920,7 +3021,8 @@ class SupplierProposalLine extends CommonObjectLine public $product_ref; /** - * @deprecated + * @var string + * @deprecated Use $product_label * @see $product_label */ public $libelle; @@ -2943,16 +3045,43 @@ class SupplierProposalLine extends CommonObjectLine */ public $product_desc; + /** + * @var int|string + */ public $localtax1_tx; // Local tax 1 + /** + * @var int|string + */ public $localtax2_tx; // Local tax 2 + /** + * @var string + */ public $localtax1_type; // Local tax 1 type + /** + * @var string + */ public $localtax2_type; // Local tax 2 type + /** + * @var float + */ public $total_localtax1; // Line total local tax 1 + /** + * @var float + */ public $total_localtax2; // Line total local tax 2 + /** + * @var int<0,1> + */ public $skip_update_total; // Skip update price total for special lines + /** + * @var string + */ public $ref_fourn; + /** + * @var string + */ public $ref_supplier; // Multicurrency @@ -2961,10 +3090,25 @@ class SupplierProposalLine extends CommonObjectLine */ public $fk_multicurrency; + /** + * @var string + */ public $multicurrency_code; + /** + * @var float + */ public $multicurrency_subprice; + /** + * @var float + */ public $multicurrency_total_ht; + /** + * @var float + */ public $multicurrency_total_tva; + /** + * @var float + */ public $multicurrency_total_ttc; /** @@ -3085,10 +3229,10 @@ class SupplierProposalLine extends CommonObjectLine $this->localtax2_tx = 0; } if (empty($this->localtax1_type)) { - $this->localtax1_type = 0; + $this->localtax1_type = ''; } if (empty($this->localtax2_type)) { - $this->localtax2_type = 0; + $this->localtax2_type = ''; } if (empty($this->total_localtax1)) { $this->total_localtax1 = 0; @@ -3293,10 +3437,10 @@ class SupplierProposalLine extends CommonObjectLine $this->total_localtax2 = 0; } if (empty($this->localtax1_type)) { - $this->localtax1_type = 0; + $this->localtax1_type = ''; } if (empty($this->localtax2_type)) { - $this->localtax2_type = 0; + $this->localtax2_type = ''; } if (empty($this->marque_tx)) { $this->marque_tx = 0; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 038b9cfbcba..c2226fe798e 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Thibault FOUCART * Copyright (C) 2022 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 @@ -452,6 +453,7 @@ if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") { require_once $dir.$filebis; $module = new $classname($db); + '@phan-var-force ModeleNumRefFactures $module'; // Show modules according to features level if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index ae052f6243c..a491775376e 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.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 @@ -46,7 +47,7 @@ class TicketStats extends Stats * * @param DoliDB $db Database handler * @param int $socid Id third party - * @param mixed $userid Id user for filter or array of user ids + * @param int|int[] $userid Id user for filter or array of user ids * @return void */ public function __construct($db, $socid = 0, $userid = 0) @@ -76,7 +77,7 @@ class TicketStats extends Stats /** * Renvoie le nombre de tickets par annee * - * @return array Array of values + * @return array Array of values */ public function getNbByYear() { @@ -93,7 +94,7 @@ class TicketStats extends Stats * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int}> Array with number by month */ public function getNbByMonth($year, $format = 0) { @@ -110,11 +111,11 @@ class TicketStats extends Stats } /** - * Return th eamount of tickets for a month and a given year + * Return the number of tickets for a month and a given year * * @param int $year Year to scan * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAmountByMonth($year, $format = 0) { @@ -134,7 +135,7 @@ class TicketStats extends Stats * Return average amount * * @param int $year Year to scan - * @return array Array of values + * @return array,array{0:int<1,12>,1:int|float}> Array of values */ public function getAverageByMonth($year) { @@ -151,7 +152,7 @@ class TicketStats extends Stats /** * Return nb, total and average * - * @return array Array of values + * @return array Array of values */ public function getAllByYear() { diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 721f4f30b12..99798ff54be 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.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 @@ -210,7 +211,7 @@ print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { // If we have empty year + while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year $oldyear--; print ''; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 1103e057c4b..39dfa719237 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -388,6 +388,7 @@ if ($modulepart == 'barcode') { $classname = "mod".ucfirst($generator); $module = new $classname($db); + '@phan-var-force ModeleBarCode $module'; if ($module->encodingIsSupported($encoding)) { $result = $module->buildBarCode($code, $encoding, $readable); } diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index fb6aeec88e8..8ea07ced4ec 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -109,16 +109,49 @@ class Target extends CommonObject 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'default' => '1', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'AutomaticTrigger', '2' => 'ManualTrigger'), 'validate' => 1,), "trigger_stack" => array("type" => "text", "label" => "TriggerStack", "enabled" => "1", 'position' => 59, 'notnull' => 0, "visible" => "0",), ); + /** + * @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 string + */ public $url; /** * @var string List of trigger codes separated by a comma. Example: 'BILL_VALIDATE,PROPAL_DELETE,...' @@ -413,7 +446,7 @@ class Target extends CommonObject * @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 array|int<-1,-1> int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -517,9 +550,9 @@ class Target extends CommonObject /** * 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) { @@ -936,6 +969,7 @@ class Target extends CommonObject if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force CommonNumRefGenerator $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -956,10 +990,10 @@ class Target extends CommonObject * * @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/webhook/lib/webhook.lib.php b/htdocs/webhook/lib/webhook.lib.php index 338361785a1..dbf6e2fdf9c 100644 --- a/htdocs/webhook/lib/webhook.lib.php +++ b/htdocs/webhook/lib/webhook.lib.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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function webhookAdminPrepareHead() { diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index 687b16e42f6..56f51ad6501 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.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 @@ -25,7 +26,7 @@ * Prepare array of tabs for Target * * @param Target $object Target - * @return array Returns an array of tabs + * @return array Array of tabs to show */ function targetPrepareHead($object) { diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index f47fd8dcad2..03c051bce4f 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -321,6 +321,7 @@ class FormWebPortal extends Form if (empty($this->infofiles['extensions'][$ext])) { $this->infofiles['extensions'][$ext] = 1; } else { + // @phan-suppress-next-line PhanTypeInvalidDimOffset $this->infofiles['extensions'][$ext]++; } diff --git a/htdocs/webportal/lib/webportal.lib.php b/htdocs/webportal/lib/webportal.lib.php index a2f3fb0eff3..0b47205f0b2 100644 --- a/htdocs/webportal/lib/webportal.lib.php +++ b/htdocs/webportal/lib/webportal.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2023-2024 Laurent Destailleur * Copyright (C) 2023-2024 Lionel Vessiller * 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 @@ -26,7 +27,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function webportalAdminPrepareHead() { diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index b584b88c091..fdb4104a397 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -202,7 +202,7 @@ $server->register( /** * Get category infos and children * - * @param array $authentication Array of authentication information + * @param array{login:string,entity?:int} $authentication Array of authentication information * @param int $id Id of object * @return mixed */ diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 9271b074786..bd2b2e8be86 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -244,9 +244,9 @@ class WebsitePage extends CommonObject /** * Create object into database * - * @param User $user User that creates - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, Id of created object if OK + * @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) { @@ -272,9 +272,9 @@ class WebsitePage extends CommonObject * @param int $id Id object. * - If this is 0, the value into $page will be used. If not found or $page not defined, the default page of website_id will be used or the first page found if not set. * - If value is < 0, we must exclude this ID. - * @param string $website_id Web site id (page name must also be filled if this parameter is used) - * @param string $page Page name (website id must also be filled if this parameter is used). Example 'myaliaspage' or 'fr/myaliaspage' - * @param string $aliasalt Alternative alias to search page (slow) + * @param ?string $website_id Web site id (page name must also be filled if this parameter is used) + * @param ?string $page Page name (website id must also be filled if this parameter is used). Example 'myaliaspage' or 'fr/myaliaspage' + * @param ?string $aliasalt Alternative alias to search page (slow) * @param int $translationparentid Translation parent ID (a main language page ID to get the translated page). Parameter $translationparentlang must also be set. * @param string $translationparentlang Translation parent Lang (a language lang to search the translation of the main page ID). Parameter $translationparentid must also be set. * @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK @@ -403,8 +403,8 @@ class WebsitePage extends CommonObject * @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|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 WebSitePage[]|int<-1,-1> int <0 if KO, array of pages if OK */ @@ -550,8 +550,8 @@ class WebsitePage extends CommonObject * Count objects in the database. * * @param string $websiteid Web site - * @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|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 Filter mode (AND or OR) * @return int int <0 if KO, array of pages if OK */ @@ -636,9 +636,9 @@ class WebsitePage extends CommonObject /** * 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) { @@ -735,15 +735,15 @@ class WebsitePage extends CommonObject /** * Load an object from its id and create a new one in database * - * @param User $user User making the clone - * @param int $fromid Id of object to clone - * @param string $newref New ref/alias of page - * @param string $newlang New language - * @param int $istranslation 1=New page is a translation of the cloned page. - * @param int $newwebsite 0=Same web site, >0=Id of new website - * @param string $newtitle New title - * @param Website|null $website Website - * @return mixed New object created, <0 if KO + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @param string $newref New ref/alias of page + * @param string $newlang New language + * @param int $istranslation 1=New page is a translation of the cloned page. + * @param int $newwebsite 0=Same web site, >0=Id of new website + * @param string $newtitle New title + * @param ?Website $website Website + * @return self|int<-1,-1> New object created, <0 if KO */ public function createFromClone(User $user, $fromid, $newref, $newlang = '', $istranslation = 0, $newwebsite = 0, $newtitle = '', $website = null) { @@ -859,12 +859,12 @@ class WebsitePage extends CommonObject * Return a link to the user card (with optionally the picto) * Use this->id,this->lastname, this->firstname * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param string $option On what the link point to - * @param integer $notooltip 1=Disable tooltip - * @param int $maxlen Max length of visible user name - * @param string $morecss Add more css on link - * @return string String with URL + * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to + * @param int<0,1> $notooltip 1=Disable tooltip + * @param int $maxlen Max length of visible user name + * @param string $morecss Add more css on link + * @return string String with URL */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { @@ -916,8 +916,8 @@ class WebsitePage extends CommonObject /** * 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) { @@ -928,9 +928,9 @@ class WebsitePage extends CommonObject /** * Return the label of a given 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) { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index eb834ab530c..6979702a314 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3412,7 +3412,7 @@ if (!GETPOST('hide_websitemenu')) { $formquestion[] = array('type' => 'checkbox', 'tdclass' => 'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss' => 'margintoponly'); } - $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); + $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, array(), $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); $formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550); @@ -3872,9 +3872,9 @@ if ($action == 'editcss') { } else { $manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON', 'restricthtml'); } - if (!trim($manifestjsoncontent)) { - //$manifestjsoncontent.=""; - } + //if (!trim($manifestjsoncontent)) { + //$manifestjsoncontent.=""; + //} if (!GETPOSTISSET('WEBSITE_README')) { $readmecontent = @file_get_contents($filereadme); @@ -3883,9 +3883,9 @@ if ($action == 'editcss') { } else { $readmecontent = GETPOST('WEBSITE_README', 'restricthtmlallowunvalid'); } - if (!trim($readmecontent)) { - //$readmecontent.=""; - } + //if (!trim($readmecontent)) { + //$readmecontent.=""; + //} if (!GETPOSTISSET('WEBSITE_LICENSE')) { $licensecontent = @file_get_contents($filelicense); @@ -3894,9 +3894,9 @@ if ($action == 'editcss') { } else { $licensecontent = GETPOST('WEBSITE_LICENSE', 'restricthtmlallowunvalid'); } - if (!trim($licensecontent)) { - //$readmecontent.=""; - } + //if (!trim($licensecontent)) { + //$readmecontent.=""; + //} print dol_get_fiche_head(); @@ -3928,7 +3928,7 @@ if ($action == 'editcss') { print $form->textwithpicto($langs->trans('MainLanguage'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_LANG'); print ''; print img_picto('', 'language', 'class="picotfixedwidth"'); - print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : ($object->lang ? $object->lang : '0')), 'WEBSITE_LANG', 0, null, 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); + print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : ($object->lang ? $object->lang : '0')), 'WEBSITE_LANG', 0, array(), 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); print ''; print ''; @@ -4139,7 +4139,7 @@ if ($action == 'createsite') { print ''; $shortlangcode = preg_replace('/[_-].*$/', '', trim($langs->defaultlang)); print img_picto('', 'language', 'class="pictofixedwidth"'); - print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : $shortlangcode), 'WEBSITE_LANG', 0, null, 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); + print $formadmin->select_language((GETPOSTISSET('WEBSITE_LANG') ? GETPOST('WEBSITE_LANG', 'aZ09comma') : $shortlangcode), 'WEBSITE_LANG', 0, array(), 1, 0, 0, 'minwidth300', 2, 0, 0, array(), 1); print ''; print ''; @@ -4304,7 +4304,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties //print $langs->trans('InternalURLOfPage'); //print ''; print '   -   '; - print '/public/website/index.php?website='.urlencode($websitekey).'&pageid='.urlencode($pageid); + print '/public/website/index.php?website='.urlencode($websitekey).'&pageid='.urlencode((string) $pageid); //if ($objectpage->grabbed_from) print ' - '.$langs->trans('InitiallyGrabbedFrom').' '.$objectpage->grabbed_from.''; print ''; @@ -4515,7 +4515,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties if (empty($object->lang) && empty($object->otherlang)) { $onlykeys = null; // We keep full list of languages } - print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($pagelang ? $pagelang : '', 'WEBSITE_LANG', 0, null, '1', 0, 0, 'minwidth200', 0, 0, 0, $onlykeys, 1); + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($pagelang ? $pagelang : '', 'WEBSITE_LANG', 0, array(), '1', 0, 0, 'minwidth200', 0, 0, 0, $onlykeys, 1); $htmltext = $langs->trans("AvailableLanguagesAreDefinedIntoWebsiteProperties"); print $form->textwithpicto('', $htmltext); print ''; @@ -4607,7 +4607,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print ''.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); - print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'minwidth200 widthcentpercentminusxx'); + print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), 0, 0, 'minwidth200 widthcentpercentminusxx'); print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), img_picto('', 'add'), '/categories/index.php?leftmenu=website&nosearch=1&type='.urlencode(Categorie::TYPE_WEBSITE_PAGE).'&website='.urlencode($website->ref), $disabled); @@ -4997,7 +4997,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { print $langs->trans("Language"); print ''; print '
'; - print img_picto('', 'language', 'class="paddingrightonly"').' '.$formadmin->select_language(GETPOSTISSET('optionlanguage') ? GETPOST('optionlanguage') : '', 'optionlanguage', 0, null, '1', 0, 0, 'minwidth125 maxwidth400 widthcentpercentminusx', 2, 0, 0, null, 1); + print img_picto('', 'language', 'class="paddingrightonly"').' '.$formadmin->select_language(GETPOSTISSET('optionlanguage') ? GETPOST('optionlanguage') : '', 'optionlanguage', 0, array(), '1', 0, 0, 'minwidth125 maxwidth400 widthcentpercentminusx', 2, 0, 0, array(), 1); print '
'; print ''; @@ -5272,6 +5272,8 @@ if ($mode == 'replacesite' || $massaction == 'replace') { print ''; } else { + // $answerrecord is not list of WebsitePage + '@phan-var-force array{type:string} $answerrecord'; $param = '?mode=replacesite'; $param .= '&websiteid='.$website->id; $param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09'); diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index 10053cde001..c327bf1b475 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.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 @@ -26,7 +27,7 @@ * Prepare array of tabs for SocieteAccount * * @param SocieteAccount $object SocieteAccount - * @return array Array of tabs + * @return array Array of tabs to show */ function websiteaccountPrepareHead($object) { diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index d5374d68a03..ba71e9386ad 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -887,6 +887,7 @@ class Workstation extends CommonObject if (class_exists($classname)) { $obj = new $classname(); + '@phan-var-force ModeleNumRefWorkstation $obj'; $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -909,13 +910,13 @@ class Workstation extends CommonObject /** * 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 $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $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/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php index 5cca71a1738..086093daaab 100644 --- a/htdocs/workstation/lib/workstation.lib.php +++ b/htdocs/workstation/lib/workstation.lib.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 @@ -25,7 +26,7 @@ /** * Prepare admin pages header * - * @return array + * @return array Array of tabs to show */ function workstationAdminPrepareHead() { diff --git a/htdocs/workstation/lib/workstation_workstation.lib.php b/htdocs/workstation/lib/workstation_workstation.lib.php index e044de7566d..f9500cb8324 100644 --- a/htdocs/workstation/lib/workstation_workstation.lib.php +++ b/htdocs/workstation/lib/workstation_workstation.lib.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 @@ -26,7 +27,7 @@ * Prepare array of tabs for Workstation * * @param Workstation $object Workstation - * @return array Array of tabs + * @return array Array of tabs to show */ function workstationPrepareHead($object) { diff --git a/htdocs/zapier/lib/zapier.lib.php b/htdocs/zapier/lib/zapier.lib.php index e04e048949d..20f6fed8bca 100644 --- a/htdocs/zapier/lib/zapier.lib.php +++ b/htdocs/zapier/lib/zapier.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 @@ -24,7 +25,7 @@ /** * Prepare admin pages header * - * @return array Returns an array with list of tab entries + * @return array Array of tabs to show */ function zapierAdminPrepareHead() { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 294aff64943..0db3ae9a88a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -118,6 +118,7 @@ parameters: - '# (?: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#' + - '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#' - '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#' - '#(?:make_substitutions expects array,) string given\.#'