Qual: Fix phan/phpstan notices in class files (part 6) (#31634)

* Qual: Fix notices for paymentdonation...workstationusergroup.class

* Qual: Fix PhanPluginRedundantReturnComment, update baseline

* Qual: Complete array phpdoc for properties
This commit is contained in:
MDW 2024-11-06 23:57:45 +01:00 committed by GitHub
parent 0e55db7caf
commit 278d301f32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 428 additions and 183 deletions

View File

@ -9,15 +9,15 @@
*/
return [
// # Issue statistics:
// PhanUndeclaredProperty : 570+ occurrences
// PhanUndeclaredProperty : 560+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 320+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 220+ occurrences
// PhanPluginUnknownPropertyType : 200+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 210+ occurrences
// PhanTypeMismatchProperty : 160+ occurrences
// PhanPluginUnknownArrayMethodParamType : 140+ occurrences
// PhanPossiblyUndeclaredVariable : 120+ occurrences
// PhanPluginUnknownArrayMethodParamType : 130+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 50+ occurrences
// PhanRedefineFunction : 45+ occurrences
@ -27,10 +27,9 @@ return [
// PhanPluginUnknownArrayFunctionReturnType : 30+ occurrences
// PhanTypeInvalidDimOffset : 30+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginUnknownArrayPropertyType : 10+ occurrences
// PhanPluginUnknownObjectMethodCall : 10+ occurrences
// PhanTypeArraySuspiciousNull : 10+ occurrences
// PhanTypeComparisonFromArray : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
@ -43,6 +42,7 @@ return [
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
// PhanPluginUnknownArrayPropertyType : 2 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
@ -101,7 +101,7 @@ return [
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayFunctionParamType', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
@ -214,7 +214,7 @@ return [
'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'],
@ -241,7 +241,6 @@ return [
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
@ -252,6 +251,7 @@ return [
'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'],
@ -263,7 +263,6 @@ return [
'htdocs/core/db/sqlite3.class.php' => ['PhanTypeMismatchReturn'],
'htdocs/core/extrafieldsinimport.inc.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/admin.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/agenda.lib.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchArgumentReal'],
'htdocs/core/lib/company.lib.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/core/lib/customreports.lib.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'],
@ -297,15 +296,14 @@ return [
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],
'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/modules/printing/modules_printing.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanParamTooMany'],
'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
@ -358,6 +356,7 @@ return [
'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'],
'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'],
@ -366,7 +365,6 @@ return [
'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolPhpCollector.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
@ -379,7 +377,6 @@ return [
'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
'htdocs/don/class/paymentdonation.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/don/info.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
@ -389,9 +386,7 @@ return [
'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/ecm/class/ecmfiles.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/ecm/class/htmlecm.form.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
@ -523,10 +518,9 @@ return [
'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/product/document.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/product/dynamic_price/class/price_global_variable.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'],
'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/product/inventory/class/inventory.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'],
@ -536,10 +530,8 @@ return [
'htdocs/product/stock/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/product/stock/class/api_stockmovements.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/product/stock/class/api_warehouses.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/product/stock/class/entrepot.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/stock/class/productlot.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/product/stock/class/productstockentrepot.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/product/stock/class/entrepot.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -563,8 +555,6 @@ 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' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/element.php' => ['PhanUndeclaredProperty'],
'htdocs/projet/ganttchart.inc.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
@ -618,15 +608,14 @@ return [
'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'],
'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'],
'htdocs/reception/class/receptionstats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/reception/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'],
'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'],
@ -639,22 +628,17 @@ return [
'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/recruitment/recruitmentjobposition_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'],
'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/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'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', 'PhanUndeclaredProperty'],
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
@ -662,7 +646,7 @@ return [
'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'],
'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' => ['PhanUndeclaredProperty'],
@ -689,7 +673,7 @@ return [
'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'],
@ -699,10 +683,9 @@ return [
'htdocs/user/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/user/class/user.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/class/usergroup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'],
'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
@ -712,10 +695,8 @@ return [
'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.formlistwebportal.class.php' => ['PhanTypeInvalidDimOffset', 'PhanUndeclaredProperty'],
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'],
@ -734,8 +715,6 @@ return [
'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'],
'htdocs/workstation/class/api_workstations.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/class/workstation.class.php' => ['PhanUndeclaredProperty'],
'htdocs/workstation/class/workstationresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/class/workstationusergroup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/workstation_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],

View File

@ -420,8 +420,8 @@ return [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
// 'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
'PhanTypeArraySuspiciousNullable', // Was All fixed, but a lot of occurrences again because of properties made nullable for phpstan.
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is

View File

@ -66,8 +66,8 @@ $config['suppress_issue_types'] = [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
// 'PhanTypeArraySuspiciousNullable', // All fixed.
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
class AgendaEvents extends DolibarrApi
{
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
* @var string[] $FIELDS Mandatory fields, checked when create and update object
*/
public static $FIELDS = array(
);

View File

@ -34,7 +34,7 @@ abstract class CommonHookActions
public $resprints;
/**
* @var array Array of results.
* @var array<mixed|mixed[]> Array of results.
*/
public $results = array();

View File

@ -1943,8 +1943,8 @@ class FormFile
if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) {
dol_include_once($hookmanager->resArray['classpath']);
if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
if (class_exists($hookmanager->resArray['classname'])) {
$tmpclassname = $hookmanager->resArray['classname'];
$tmpclassname = $hookmanager->resArray['classname'];
if (is_string($tmpclassname) && class_exists($tmpclassname)) {
$object_instance = new $tmpclassname($this->db);
}
}

View File

@ -939,9 +939,9 @@ if (!empty($search_measures) && !empty($search_xaxis)) {
$sql = preg_replace_callback(
"/(\w+)\.(\w+)\s*(=|!=|<>|<|>|<=|>=)\s*'(\d{4})-(\d{2})-(\d{2})'/",
/**
* @param array<int, string> $matches
* @return string
*/
* @param array<int, string> $matches
* @return string SQL filter condition
*/
function (array $matches): string {
global $db;
$column = $matches[1] . '.' . $matches[2];

View File

@ -43,7 +43,7 @@ class MailingTargets // This can't be abstract as it is used for some method
public $error = '';
/**
* @var array of errors
* @var string[] of errors
*/
public $errors;

View File

@ -138,7 +138,7 @@ class PrintingDriver
/**
* Return list of available printers
*
* @return array list of printers
* @return array<int|string,string|array<string|int,string>> list of printers
*/
public function getlistAvailablePrinters()
{

View File

@ -56,7 +56,7 @@ class printing_printgcp extends PrintingDriver
public $active = 'PRINTING_PRINTGCP';
/**
* @var array module parameters
* @var array<string|int,string|array{varname:string,info:string,type:'info',renew?:string,delete?:string}|array{enabled:int<0,1>,type:'submit'}> module parameters
*/
public $conf = array();
@ -75,6 +75,9 @@ class printing_printgcp extends PrintingDriver
*/
public $db;
/**
* @var string
*/
private $OAUTH_SERVICENAME_GOOGLE = 'Google';
const LOGIN_URL = 'https://accounts.google.com/o/oauth2/token';
@ -242,7 +245,7 @@ class printing_printgcp extends PrintingDriver
/**
* Return list of available printers
*
* @return array{available:array} list of printers
* @return array{available:array{name:string,displayname:string,id:string,ownerName:string,status:string,connectionStatus:string,type:string}} list of printers
*/
public function getlistAvailablePrinters()
{
@ -366,7 +369,7 @@ class printing_printgcp extends PrintingDriver
* @param string $printjobtitle Job Title
* @param string $filepath File Path to be send to Google Cloud Print
* @param string $contenttype File content type by example application/pdf, image/png
* @return array status array
* @return array{status:int<0,1>,errorcode:string,errormessage:string} status array
*/
public function sendPrintToPrinter($printerid, $printjobtitle, $filepath, $contenttype)
{

View File

@ -44,7 +44,8 @@ class PhpCollector extends DataCollector implements Renderable
* List of messages. Each item includes:
* 'message', 'message_html', 'is_string', 'label', 'time'.
*
* @var array
*
* @var array<array{message:string,message_html:?string,is_string:bool,label:string,time:float}>
*/
protected $messages = [];
@ -62,7 +63,7 @@ class PhpCollector extends DataCollector implements Renderable
/**
* Called by the DebugBar when data needs to be collected.
*
* @return array Array of collected data
* @return array{count:int,messages:array<array{message:string,message_html:?string,is_string:bool,label:string,time:float}>} Array of collected data
*/
public function collect()
{
@ -76,7 +77,7 @@ class PhpCollector extends DataCollector implements Renderable
/**
* Returns a list of messages ordered by their timestamp.
*
* @return array<array{time:int}> A list of messages ordered by time.
* @return array<array{message:string,message_html:?string,is_string:bool,label:string,time:float}> A list of messages ordered by time.
*/
public function getMessages()
{
@ -104,7 +105,7 @@ class PhpCollector extends DataCollector implements Renderable
* Returns a hash where keys are control names and their values an array of options as defined in
* {@see DebugBar\JavascriptRenderer::addControl()}
*
* @return array Array of details to render the widget.
* @return array<array{icon:string,widget:string,map:string,default:string}|array{map:string,default:string}> Array of details to render the widget.
*/
public function getWidgets()
{

View File

@ -78,7 +78,7 @@ class PaymentDonation extends CommonObject
/**
* @var int Payment mode ID
* @deprecated
* @deprecated Use $paymenttype
* @see $paymenttype
*/
public $fk_typepayment;
@ -110,16 +110,35 @@ class PaymentDonation extends CommonObject
public $fk_user_modif;
/**
* @deprecated
* @deprecated Use $amount, $amounts
* @see $amount, $amounts
* @var float
*/
public $total;
/**
* @var string
*/
public $type_code;
/**
* @var string
*/
public $type_label;
/**
* @var ?int
*/
public $chid;
/**
* @var int|''
*/
public $datepaid;
/**
* @var int
*/
public $bank_account;
/**
* @var int
*/
public $bank_line;
/**
@ -147,7 +166,7 @@ class PaymentDonation extends CommonObject
* Use this->amounts to have list of lines for the payment
*
* @param User $user User making payment
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $notrigger = 0)
@ -603,6 +622,7 @@ class PaymentDonation extends CommonObject
global $conf;
$error = 0;
$amount = 0;
if (isModEnabled("bank")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -621,7 +641,7 @@ class PaymentDonation extends CommonObject
$label,
$amount,
$this->num_payment,
'',
0,
$user,
$emetteur_nom,
$emetteur_banque

View File

@ -95,22 +95,22 @@ class EcmDirectory extends CommonObject
public $ref;
/**
* @var array array of categories
* @var array<int,array{id:int,id_mere:int,fulllabel:string,fullpath:string,fullrelativename:string,label:string,description:string,cachenbofdoc:int,date_c:int,fk_user_c:int,statut_c:int,login_c:int,id_children?:int[],level:int}> Array of categories
*/
public $cats = array();
/**
* @var array array of children categories
* @var array<int,int> array of children categories
*/
public $motherof = array();
/**
* @var array array of forbidden chars
* @var string[] array of forbidden chars
*/
public $forbiddenchars = array('<', '>', ':', '/', '\\', '?', '*', '|', '"');
/**
* @var array array of forbidden chars for dir
* @var string[] array of forbidden chars for dir
*/
public $forbiddencharsdir = array('<', '>', ':', '?', '*', '|', '"');
@ -358,7 +358,7 @@ class EcmDirectory extends CommonObject
$this->label = $obj->label;
$this->fk_parent = $obj->fk_parent;
$this->description = $obj->description;
$this->cachenbofdoc = $obj->cachenbofdoc;
$this->cachenbofdoc = (int) $obj->cachenbofdoc;
$this->fk_user_m = $obj->fk_user_m;
$this->fk_user_c = $obj->fk_user_c;
$this->date_c = $this->db->jdate($obj->date_c);
@ -394,6 +394,7 @@ class EcmDirectory extends CommonObject
$error = 0;
$relativepath = '__MUST_NOT_EXIST__';
if ($mode != 'databaseonly') {
$relativepath = $this->getRelativePath(1); // Ex: dir1/dir2/dir3
}
@ -421,6 +422,7 @@ class EcmDirectory extends CommonObject
// End call triggers
}
$file = '__MUST_NOT_EXIST__';
if ($mode != 'databaseonly') {
$file = $conf->ecm->dir_output."/".$relativepath;
if ($deletedirrecursive) {
@ -547,7 +549,7 @@ class EcmDirectory extends CommonObject
//print "c=".$idtosearch."-".$cursorindex;
if ($cursorindex >= 0) {
// Path is label sanitized (no space and no special char) and concatenated
// Path is label sanitized (no space and no special char) and concatenated @phan-suppress-next-line PhanTypeSuspiciousStringExpression
$ret = dol_sanitizeFileName($this->cats[$cursorindex]['label']).'/'.$ret;
$idtosearch = $this->cats[$cursorindex]['id_mere'];
@ -636,8 +638,9 @@ class EcmDirectory extends CommonObject
* fulllabel Full label (Added by buildPathFromId call)
* level Level of line (Added by buildPathFromId call)
*
*
* @param int $force Force reload of full arbo even if already loaded in cache $this->cats
* @return array|int Tableau de array if OK, -1 if KO
* @return array<int,array{id:int,id_mere:int,fulllabel:string,fullpath:string,fullrelativename:string,label:string,description:string,cachenbofdoc:int,date_c:int,fk_user_c:int,statut_c:int,login_c:int,id_children?:int[],level:int}>|int<-1,-1> Tableau de array if OK, -1 if KO
*/
public function get_full_arbo($force = 0)
{
@ -677,7 +680,7 @@ class EcmDirectory extends CommonObject
$this->cats[$obj->rowid]['id_mere'] = (isset($this->motherof[$obj->rowid]) ? $this->motherof[$obj->rowid] : '');
$this->cats[$obj->rowid]['label'] = $obj->label;
$this->cats[$obj->rowid]['description'] = $obj->description;
$this->cats[$obj->rowid]['cachenbofdoc'] = $obj->cachenbofdoc;
$this->cats[$obj->rowid]['cachenbofdoc'] = (int) $obj->cachenbofdoc;
$this->cats[$obj->rowid]['date_c'] = $this->db->jdate($obj->date_c);
$this->cats[$obj->rowid]['fk_user_c'] = (int) $obj->fk_user_c;
$this->cats[$obj->rowid]['statut_c'] = (int) $obj->statut_c;

View File

@ -107,7 +107,7 @@ class EcmFiles extends CommonObject
public $position;
/**
* @var string can be 'generated', 'uploaded', 'unknown'
* @var 'generated'|'uploaded'|'unknown'|'copy'|''
*/
public $gen_or_uploaded;
@ -535,7 +535,7 @@ class EcmFiles extends CommonObject
* @param string $sortfield Sort field
* @param int $limit Limit
* @param int $offset Offset limit
* @param string|array $filter filter array
* @param string|array<string,mixed> $filter filter array
* @param string $filtermode filter mode (AND or OR)
* @return int Return integer <0 if KO, >0 if OK
*/
@ -613,7 +613,7 @@ class EcmFiles extends CommonObject
$num = $this->db->num_rows($resql);
while ($obj = $this->db->fetch_object($resql)) {
$line = new EcmFilesLine();
$line = new EcmFilesLine($this->db);
$line->id = $obj->rowid;
$line->ref = $obj->rowid;
@ -1033,7 +1033,7 @@ class EcmFiles extends CommonObject
/**
* Class of an index line of a document
*/
class EcmFilesLine
class EcmFilesLine extends CommonObjectLine
{
/**
* @var string ECM files line label
@ -1045,8 +1045,17 @@ class EcmFilesLine
*/
public $entity;
/**
* @var string
*/
public $filename;
/**
* @var string
*/
public $filepath;
/**
* @var string
*/
public $fullpath_orig;
/**
@ -1054,12 +1063,33 @@ class EcmFilesLine
*/
public $description;
/**
* @var string
*/
public $keywords;
/**
* @var string
*/
public $cover;
/**
* @var int
*/
public $position;
/**
* @var 'generated'|'uploaded'|'unknown'|'copy'|''
*/
public $gen_or_uploaded; // can be 'generated', 'uploaded', 'unknown'
/**
* @var string
*/
public $extraparams;
/**
* @var int|''
*/
public $date_c = '';
/**
* @var int|''
*/
public $date_m = '';
/**
@ -1072,7 +1102,16 @@ class EcmFilesLine
*/
public $fk_user_m;
/**
* @var string
*/
public $acl;
/**
* @var string
*/
public $src_object_type;
/**
* @var int
*/
public $src_object_id;
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2008-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -55,7 +56,7 @@ class FormEcm
* @param int $selected Id of preselected section
* @param string $select_name Name of HTML select component
* @param string $module Module ('ecm', 'medias', ...)
* @param array $ids_to_ignore Array of id to ignore
* @param int[] $ids_to_ignore Array of id to ignore
* @return string String with HTML select
*/
public function selectAllSections($selected = 0, $select_name = '', $module = 'ecm', $ids_to_ignore = array())

View File

@ -51,6 +51,9 @@ class PriceGlobalVariable
*/
public $id;
/**
* @var ?string
*/
public $code;
/**
@ -58,6 +61,9 @@ class PriceGlobalVariable
*/
public $description;
/**
* @var int|string|float
*/
public $value;
/**
@ -110,6 +116,7 @@ class PriceGlobalVariable
if (!$error) {
$this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element);
/*
if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -119,6 +126,7 @@ class PriceGlobalVariable
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
*/
}
// Commit or rollback
@ -320,7 +328,7 @@ class PriceGlobalVariable
/**
* List all price global variables
*
* @return array|int Array of price global variables, <0 if ko
* @return PriceGlobalVariable[]|int<-1,-1> Array of price global variables, <0 if ko
*/
public function listGlobalVariables()
{

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*/
/*
* This program is free software; you can redistribute it and/or modify
@ -57,7 +58,7 @@ $fk_entrepot = GETPOSTINT("fk_entrepot");
$fk_inventory = GETPOSTINT("fk_inventory");
$fk_product = GETPOSTINT("fk_product");
$reelqty = GETPOSTINT("reelqty");
$batch = GETPOSTINT("batch");
$batch = GETPOST("batch", "aZ09");
$mode = GETPOST("mode", "aZ");
$warehousefound = 0;
@ -97,7 +98,7 @@ if ($action == "existbarcode" && !empty($barcode) && $user->hasRight('stock', 'l
$result = $db->query($sql);
if ($result) {
$nbline = $db->num_rows($result);
for ($i=0; $i < $nbline; $i++) {
for ($i = 0; $i < $nbline; $i++) {
$object = $db->fetch_object($result);
if (($mode == "barcode" && $barcode == $object->barcode) || ($mode == "lotserial" && $barcode == $object->batch)) {
$warehouse->fetch(0, $product["Warehouse"]);
@ -107,22 +108,22 @@ if ($action == "existbarcode" && !empty($barcode) && $user->hasRight('stock', 'l
$fk_product = $object->fk_product;
$reelqty = $object->reel;
$objectreturn = array('fk_warehouse'=>$warehouseid,'fk_product'=>$fk_product,'reelqty'=>$reelqty);
$objectreturn = array('fk_warehouse' => $warehouseid,'fk_product' => $fk_product,'reelqty' => $reelqty);
}
}
}
if ($warehousefound < 1) {
$response = array('status'=>'error','errorcode'=>'NotFound','message'=>'No warehouse found for barcode'.$barcode);
$response = array('status' => 'error','errorcode' => 'NotFound','message' => 'No warehouse found for barcode'.$barcode);
} elseif ($warehousefound > 1) {
$response = array('status'=>'error','errorcode'=>'TooManyWarehouse','message'=>'Too many warehouse found');
$response = array('status' => 'error','errorcode' => 'TooManyWarehouse','message' => 'Too many warehouse found');
} else {
$response = array('status'=>'success','message'=>'Warehouse found','object'=>$objectreturn);
$response = array('status' => 'success','message' => 'Warehouse found','object' => $objectreturn);
}
} else {
$response = array('status'=>'error','errorcode'=>'NotFound','message'=>"No results found for barcode");
$response = array('status' => 'error','errorcode' => 'NotFound','message' => "No results found for barcode");
}
} else {
$response = array('status'=>'error','errorcode'=>'ActionError','message'=>"Error on action");
$response = array('status' => 'error','errorcode' => 'ActionError','message' => "Error on action");
}
if ($action == "addnewlineproduct" && $user->hasRight('stock', 'creer')) {
@ -141,12 +142,12 @@ if ($action == "addnewlineproduct" && $user->hasRight('stock', 'creer')) {
$result = $inventoryline->create($user);
if ($result > 0) {
$response = array('status'=>'success','message'=>'Success on creating line','id_line'=>$result);
$response = array('status' => 'success','message' => 'Success on creating line','id_line' => $result);
} else {
$response = array('status'=>'error','errorcode'=>'ErrorCreation','message'=>"Error on line creation");
$response = array('status' => 'error','errorcode' => 'ErrorCreation','message' => "Error on line creation");
}
} else {
$response = array('status'=>'error','errorcode'=>'NoIdForInventory','message'=>"No id for inventory");
$response = array('status' => 'error','errorcode' => 'NoIdForInventory','message' => "No id for inventory");
}
}

View File

@ -136,7 +136,13 @@ class Inventory extends CommonObject
* @var string Categories id separated by comma
*/
public $categories_product;
/**
* @var int|''
*/
public $date_inventory;
/**
* @var string
*/
public $title;
/**
@ -759,8 +765,8 @@ class Inventory extends CommonObject
* Return the child warehouse of the current one
*
* @param int $id Id of warehouse
* @param array $TChildWarehouse Array of child warehouses
* @return int Return integer <0 if KO, >0 if OK
* @param int[] $TChildWarehouse Array of child warehouses
* @return int<-1,-1>|int<1,1> Return integer <0 if KO, >0 if OK
*/
public function getChildWarehouse($id, &$TChildWarehouse)
{
@ -851,10 +857,25 @@ class InventoryLine extends CommonObjectLine
*/
public $rowid;
/**
* @var int
*/
public $fk_inventory;
/**
* @var int
*/
public $fk_warehouse;
/**
* @var int
*/
public $fk_product;
/**
* @var string
*/
public $batch;
/**
* @var int
*/
public $datec;
/**
@ -863,7 +884,7 @@ class InventoryLine extends CommonObjectLine
public $qty_stock;
/**
* @var float|null Quantity viewed
* @var ?float Quantity viewed
*/
public $qty_view;
@ -872,7 +893,13 @@ class InventoryLine extends CommonObjectLine
*/
public $qty_regulated;
/**
* @var string
*/
public $pmp_real;
/**
* @var string
*/
public $pmp_expected;
/**

View File

@ -5,7 +5,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -52,7 +52,7 @@ class Entrepot extends CommonObject
/**
* @var string Label
* @deprecated
* @deprecated Use $label
* @see $label
*/
public $libelle;
@ -67,6 +67,9 @@ class Entrepot extends CommonObject
*/
public $description;
/**
* @var int
*/
public $statut;
/**
@ -608,7 +611,7 @@ class Entrepot extends CommonObject
* Return list of all warehouses
*
* @param int $status Status
* @return array Array list of warehouses
* @return array<int,string> Array list of warehouses
*/
public function list_array($status = 1)
{
@ -638,7 +641,7 @@ class Entrepot extends CommonObject
/**
* Return number of unique different product into a warehouse
*
* @return array|int Array('nb'=>Nb, 'value'=>Value)
* @return array{nb:int}|int<-1,-1> Array('nb'=>Nb, 'value'=>Value)
*/
public function nb_different_products()
{
@ -667,9 +670,9 @@ class Entrepot extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return stock and value of warehosue
* Return stock and value of warehouse
*
* @return array|int Array('nb'=>Nb, 'value'=>Value)
* @return array{nb:int,value:float}|int<-1,-1> Array('nb'=>Nb, 'value'=>Value)
*/
public function nb_products()
{
@ -716,7 +719,7 @@ class Entrepot extends CommonObject
/**
* Return label of status of object
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @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
* @return string Label of status
*/
public function getLibStatut($mode = 0)
@ -729,7 +732,7 @@ class Entrepot extends CommonObject
* Return 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
* @param int<0,5> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label of status
*/
public function LibStatut($status, $mode = 0)
@ -770,7 +773,7 @@ class Entrepot extends CommonObject
return ['optimize' => $langs->trans("Warehouse")];
}
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Warehouse").'</u>';
if (isset($this->statut)) {
if (!empty($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.(empty($this->ref) ? $this->label : $this->ref);
@ -952,9 +955,9 @@ class Entrepot extends CommonObject
/**
* Return array of children warehouses ids from $id warehouse (recursive function)
*
* @param int $id id parent warehouse
* @param integer[] $TChildWarehouses array which will contain all children (param by reference)
* @return integer[] $TChildWarehouses array which will contain all children
* @param int $id id parent warehouse
* @param int[] $TChildWarehouses array which will contain all children (param by reference)
* @return int[] $TChildWarehouses array which will contain all children
*/
public function get_children_warehouses($id, &$TChildWarehouses)
{

View File

@ -79,6 +79,9 @@ class MouvementStock extends CommonObject
* @var null|int|'' datem date
*/
public $datem = '';
/**
* @var float|string
*/
public $price;
/**
@ -114,7 +117,13 @@ class MouvementStock extends CommonObject
* @var string Origin type ('project', ...)
*/
public $origin_type;
/**
* @var int
*/
public $line_id_oject_src;
/**
* @var int
*/
public $line_id_oject_origin;
/**
@ -127,7 +136,13 @@ class MouvementStock extends CommonObject
*/
public $batch;
/**
* @var int
*/
public $line_id_object_src;
/**
* @var int
*/
public $line_id_object_origin;
/**
@ -910,11 +925,11 @@ class MouvementStock extends CommonObject
/**
* Create or update batch record (update table llx_product_batch). No check is done here, done by parent.
*
* @param array|int $dluo Could be either
* - int if row id of product_batch table (for update)
* - or complete array('fk_product_stock'=>, 'batchnumber'=>)
* @param array{fk_product_stock:int,batchnumber:string}|int $dluo Could be either
* - int if row id of product_batch table (for update)
* - or complete array('fk_product_stock'=>, 'batchnumber'=>)
* @param float $qty Quantity of product with batch number. May be a negative amount.
* @return int Return integer <0 if KO, -2 if we try to update a product_batchid that does not exist, else return productbatch id
* @return int<-2,-1>|int<1,max> Return integer <0 if KO, -2 if we try to update a product_batchid that does not exist, else return productbatch id
*/
private function createBatch($dluo, $qty)
{
@ -924,6 +939,8 @@ class MouvementStock extends CommonObject
$pdluo = new Productbatch($this->db);
$vbatchnumber = '';
$vfk_product_stock = 0;
$result = 0;
// Try to find an existing record with same batch number or id
@ -940,7 +957,7 @@ class MouvementStock extends CommonObject
$vfk_product_stock = $dluo['fk_product_stock'];
$vbatchnumber = $dluo['batchnumber'];
$result = $pdluo->find($vfk_product_stock, '', '', $vbatchnumber); // Search on batch number only (eatby and sellby are deprecated here)
$result = $pdluo->find($vfk_product_stock, 0, 0, $vbatchnumber); // Search on batch number only (eatby and sellby are deprecated here)
} else {
dol_syslog(get_class($this)."::createBatch array param dluo must contain at least key fk_product_stock", LOG_ERR);
$result = -1;
@ -950,6 +967,7 @@ class MouvementStock extends CommonObject
$result = -1;
}
$fk_product_stock = 0;
if ($result >= 0) {
// No error
if ($pdluo->id > 0) { // product_batch record found

View File

@ -96,10 +96,25 @@ class Productlot extends CommonObject
* @var array{customers_toconsume:int,nb_toconsume:int,qty_toconsume:int,customers_consumed:int,nb_consumed:int,qty_consumed:int,customers_toproduce:int,nb_toproduce:int,qty_toproduce:int,customers_produced:int,nb_produced:int,qty_produced:int} stats by role toconsume, consumed, toproduce, produced
*/
public $stats_mo;
/**
* @var array{nb_toproduce:int,qty_toproduce:float,nb_toconsume:int,qty_toconsume:float}
*/
public $stats_bom;
/**
* @var array{customers:int,nb:int,rows:int,qty:float}
*/
public $stats_mrptoconsume;
/**
* @var array{customers:int,nb:int,rows:int,qty:float}
*/
public $stats_mrptoproduce;
/**
* @var array{customers:int,nb:int,rows:int,qty:float}
*/
public $stats_facturerec;
/**
* @var array{suppliers:int,nb:int,rows:int,qty:float}
*/
public $stats_facture_fournisseur;
@ -179,22 +194,31 @@ class Productlot extends CommonObject
public $sellby = '';
/**
* @var int|string eal_date
* @var int|'' eol_date
*/
public $eol_date = '';
/**
* @var int|string manufacturing_date
* @var int|'' manufacturing_date
*/
public $manufacturing_date = '';
/**
* @var int|string scrapping_date
* @var int|'' scrapping_date
*/
public $scrapping_date = '';
//public $commissionning_date = '';
/**
* @var int|''
*/
public $qc_frequency = '';
/**
* @var int|''
*/
public $lifetime = '';
/**
* @var int|''
*/
public $datec = '';
/**
@ -265,7 +289,7 @@ class Productlot extends CommonObject
* @param int $sellBy Sell by date
* @param int $eatBy Eat by date
* @param string $onlyFieldName [=''] check all fields by default or only one field name ("sellby", "eatby")
* @return array|null Array of errors or null if nothing done
* @return string[]|null Array of errors or null if nothing done
*/
public static function checkSellOrEatByMandatoryFromProductIdAndDates($productId, $sellBy, $eatBy, $onlyFieldName = '')
{
@ -299,7 +323,7 @@ class Productlot extends CommonObject
* @param int $eatBy Eat by date
* @param string $onlyFieldName [=''] check all fields by default or only one field name ("sellby", "eatby")
* @param bool $alreadyCheckConf [=false] conf hasn't been already checked by default or true not to check conf
* @return array|null Array of errors or null if nothing done
* @return string[]|null Array of errors or null if nothing done
*/
public static function checkSellOrEatByMandatoryFromProductAndDates($product, $sellBy, $eatBy, $onlyFieldName = '', $alreadyCheckConf = false)
{
@ -627,7 +651,7 @@ class Productlot extends CommonObject
//$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').',';
$sql .= ' qc_frequency = '.(!empty($this->qc_frequency) ? (int) $this->qc_frequency : 'null').',';
$sql .= ' lifetime = '.(!empty($this->lifetime) ? (int) $this->lifetime : 'null').',';
$sql .= ' datec = ' . (!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'" . $this->db->idate($this->datec) . "'" : 'null') . ',';
$sql .= ' datec = ' . (dol_strlen((string) $this->datec) != 0 ? "'" . $this->db->idate($this->datec) . "'" : 'null') . ',';
$sql .= ' tms = ' . (dol_strlen((string) $this->tms) != 0 ? "'" . $this->db->idate($this->tms) . "'" : "'" . $this->db->idate(dol_now()) . "'") . ',';
$sql .= ' fk_user_creat = ' . (isset($this->fk_user_creat) ? $this->fk_user_creat : "null") . ',';
$sql .= ' fk_user_modif = ' . (isset($this->fk_user_modif) ? $this->fk_user_modif : "null") . ',';

View File

@ -59,8 +59,17 @@ class ProductStockEntrepot extends CommonObject
*/
public $fk_entrepot;
/**
* @var null|float|string
*/
public $seuil_stock_alerte;
/**
* @var null|float|string
*/
public $desiredstock;
/**
* @var string
*/
public $import_key;
@ -235,9 +244,9 @@ class ProductStockEntrepot extends CommonObject
* @param string $sortfield Sort field
* @param int $limit Limit
* @param int $offset Offset limit
* @param string|array $filter Filter USF.
* @param string|array<string,mixed> $filter Filter USF.
* @param string $filtermode Filter mode (AND or OR)
* @return int|array Return integer <0 if KO, array if OK
* @return int<-1,-1>|array<int,array{id:int,fk_product:int,fk_entrepot:int,seuil_stock_alerte:float,desiredstock:float}> Return integer <0 if KO, array if OK
*/
public function fetchAll($fk_product = 0, $fk_entrepot = 0, $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{

View File

@ -25,15 +25,39 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
*/
class ProjectStats extends Stats
{
/**
* @var Project
*/
private $project;
/**
* @var int
*/
public $userid;
/**
* @var int
*/
public $socid;
/**
* @var int
*/
public $status;
/**
* @var string
*/
public $opp_status;
//SQL stat
/**
* @var string
*/
public $field;
/**
* @var string
*/
public $from;
/**
* @var string
*/
public $where;
@ -70,7 +94,7 @@ class ProjectStats extends Stats
* Warning: There is no filter on WON/LOST because we want this for statistics.
*
* @param int $limit Limit results
* @return array|int Array with value or -1 if error
* @return array<array{0:string,1:float}>|int<-1,-1> Array with value or -1 if error
* @throws Exception
*/
public function getAllProjectByStatus($limit = 5)
@ -290,7 +314,7 @@ class ProjectStats extends Stats
* @param int $startyear End year
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
* @param int $wonlostfilter Add a filter on status won/lost
* @return array|int<-1,-1> Array of values or <0 if error
* @return int<-1,-1>|array<array<int<0,11>,array{0:int<1,12>,1:int|float}>> Array of values or <0 if error
*/
public function getWeightedAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $wonlostfilter = 1)
{
@ -313,6 +337,7 @@ class ProjectStats extends Stats
$nowgmt = dol_now();
$foundintocache = 0;
$filedate = 0;
if ($cachedelay > 0) {
$filedate = dol_filemtime($newpathofdestfile);
if ($filedate >= ($nowgmt - $cachedelay)) {
@ -399,8 +424,8 @@ class ProjectStats extends Stats
*
* @param int $endyear End year
* @param int $startyear Start year
* @param int $cachedelay accept for cache file (0=No read, no save of cache, -1=No read but save)
* @return array|int Array of values or <0 if error
* @param int $cachedelay accept for cache file (0=No read, no save of cache, -1=No read but save)
* @return array<int<0,11>,array<string|float>>|int<-1,-1> Array of values or <0 if error
*/
public function getTransformRateByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0)
{
@ -423,6 +448,7 @@ class ProjectStats extends Stats
$nowgmt = dol_now();
$foundintocache = 0;
$filedate = 0;
if ($cachedelay > 0) {
$filedate = dol_filemtime($newpathofdestfile);
if ($filedate >= ($nowgmt - $cachedelay)) {

View File

@ -26,6 +26,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
*/
class TaskStats extends Stats
{
/**
* @var Project
*/
private $project; // @phpstan-ignore-line
/**
@ -58,7 +61,7 @@ class TaskStats extends Stats
* Return all tasks grouped by status.
*
* @param int $limit Limit results
* @return array|int Array with value or -1 if error
* @return array<int,array{0:int|string,1:int}>|int<-1,-1> Array with value or -1 if error
* @throws Exception
*/
public function getAllTaskByStatus($limit = 5)
@ -213,7 +216,7 @@ class TaskStats extends Stats
/**
* Return average of entity by month
* @param int $year year number
* @return array array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of average each month
*/
protected function getAverageByMonth($year)
{

View File

@ -49,8 +49,17 @@ class ReceptionStats extends Stats
*/
public $userid;
/**
* @var string
*/
public $from;
/**
* @var string
*/
public $field;
/**
* @var string
*/
public $where;

View File

@ -1021,7 +1021,7 @@ class RecruitmentCandidature extends CommonObject
if (class_exists($classname)) {
$obj = new $classname();
'@phan-var-force ModeleNumRefRecruitmentCandidature $module';
'@phan-var-force ModeleNumRefRecruitmentCandidature $obj';
$numref = $obj->getNextValue($this);
if ($numref != '' && $numref != '-1') {

View File

@ -1070,7 +1070,7 @@ class RecruitmentJobPosition extends CommonObject
if (class_exists($classname)) {
$obj = new $classname();
'@phan-var-force ModeleNumRefRecruitmentJobPosition $module';
'@phan-var-force ModeleNumRefRecruitmentJobPosition $obj';
$numref = $obj->getNextValue($this);
if ($numref != '' && $numref != '-1') {

View File

@ -61,7 +61,7 @@ class Dolresource extends CommonObject
public $phone;
/**
* @var int|null Maximum users
* @var ?int Maximum users
*/
public $max_users;
@ -70,6 +70,9 @@ class Dolresource extends CommonObject
*/
public $fk_code_type_resource;
/**
* @var ?string
*/
public $type_label;
/**
@ -119,7 +122,7 @@ class Dolresource extends CommonObject
public $fk_user_create;
/**
* Used by fetchElementResource() to return an object
* @var CommonObject Used by fetchElementResource() to return an object
*/
public $objelement;

View File

@ -42,8 +42,14 @@ class FormResource
*/
public $db;
/**
* @var array<string,string>
*/
public $substit = array();
/**
* @var array<string,mixed>
*/
public $param = array();
/**
@ -69,19 +75,19 @@ class FormResource
*
* @param int $selected Preselected resource id
* @param string $htmlname Name of field in form
* @param array $filter Optional filters criteria (example: 's.rowid <> x')
* @param string $filter Optional filters criteria (example: 's.rowid <> x')
* @param int $showempty Add an empty field
* @param int $showtype Show third party type in combo list (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param array $filterkey Filter on key value
* @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $filterkey Filter on key value
* @param int<0,2> $outputmode 0=HTML select string, 1=Array, 2=without form tag
* @param int $limit Limit number of answers, 0 for no limit
* @param string $morecss More css
* @param bool $multiple add [] in the name of element and add 'multiple' attribute
* @return string|array HTML string with
* @return string|array<array{key:int,value:int,label:string}> HTML string with
*/
public function select_resource_list($selected = 0, $htmlname = 'fk_resource', array $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = [], $filterkey = [], $outputmode = 0, $limit = 20, $morecss = 'minwidth100', $multiple = false)
public function select_resource_list($selected = 0, $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = [], $filterkey = '', $outputmode = 0, $limit = 20, $morecss = 'minwidth100', $multiple = false)
{
// phpcs:enable
global $conf, $langs;
@ -126,13 +132,14 @@ class FormResource
}
// Test if entry is the first element of $selected.
// @phan-suppress-next-line PhanTypeExpectedObjectPropAccess
if ((isset($selected[0]) && is_object($selected[0]) && $selected[0]->id == $resourcestat->lines[$i]->id) || ((!isset($selected[0]) || !is_object($selected[0])) && !empty($selected) && in_array($resourcestat->lines[$i]->id, $selected))) {
$out .= '<option value="'.$resourcestat->lines[$i]->id.'" selected>'.$label.'</option>';
} else {
$out .= '<option value="'.$resourcestat->lines[$i]->id.'">'.$label.'</option>';
}
array_push($outarray, array('key'=>$resourcestat->lines[$i]->id, 'value'=>$resourcestat->lines[$i]->id, 'label'=>$label));
array_push($outarray, array('key' => (int) $resourcestat->lines[$i]->id, 'value' => (int) $resourcestat->lines[$i]->id, 'label' => (string) $label));
$i++;
if (($i % 10) == 0) {

View File

@ -69,7 +69,7 @@ class PaymentSalary extends CommonObject
/**
* @var int|string Date of payment
* @deprecated
* @deprecated Use $datep
* @see $datep
*/
public $datepaye = '';
@ -92,7 +92,7 @@ class PaymentSalary extends CommonObject
public $amount;
/**
* @var array Array of amounts
* @var array<float|string> Array of amounts
*/
public $amounts = array();
@ -115,6 +115,7 @@ class PaymentSalary extends CommonObject
/**
* @inheritdoc
* @var int
*/
public $fk_bank;
@ -639,7 +640,7 @@ class PaymentSalary extends CommonObject
$label,
-$total,
$this->num_payment,
'',
0,
$user,
$emetteur_nom,
$emetteur_banque,
@ -772,9 +773,6 @@ class PaymentSalary extends CommonObject
$this->error = 'Error -1 '.$this->db->error();
}
if (!$error) {
}
if (!$error) {
$this->datepaye = $date;

View File

@ -33,7 +33,7 @@ class Contacts extends DolibarrApi
{
/**
*
* @var array $FIELDS Mandatory fields, checked when create and update object
* @var string[] $FIELDS Mandatory fields, checked when create and update object
*/
public static $FIELDS = array(
'lastname',
@ -127,7 +127,7 @@ class Contacts extends DolibarrApi
if (empty($email)) {
$result = $this->contact->initAsSpecimen();
} else {
$result = $this->contact->fetch('', '', '', $email);
$result = $this->contact->fetch(0, null, '', $email);
}
if (!$result) {
@ -292,6 +292,8 @@ class Contacts extends DolibarrApi
* Create contact object
*
* @param array $request_data Request datas
* @phan-param ?array<string,string> $request_data
* @phpstan-param ?array<string,string> $request_data
* @return int ID of contact
*
* @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation
@ -333,6 +335,8 @@ class Contacts extends DolibarrApi
*
* @param int $id Id of contact to update
* @param array $request_data Datas
* @phan-param ?array<string,string> $request_data
* @phpstan-param ?array<string,string> $request_data
* @return Object|false Updated object, false when issue toupdate
*
* @throws RestException 401
@ -389,6 +393,8 @@ class Contacts extends DolibarrApi
*
* @param int $id Contact ID
* @return array[]
* @phan-return array<string,array{code:int,message:string}>
* @phpstan-return array<string,array{code:int,message:string}>
*/
public function delete($id)
{
@ -403,7 +409,7 @@ class Contacts extends DolibarrApi
if (!DolibarrApi::_checkAccessToResource('contact', $this->contact->id, 'socpeople&societe')) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->contact->oldcopy = clone $this->contact;
$this->contact->oldcopy = clone $this->contact; // @phan-suppress-current-line PhanTypeMismatchProperty
if ($this->contact->delete(DolibarrApiAccess::$user) <= 0) {
throw new RestException(500, 'Error when delete contact ' . $this->contact->error);
@ -422,6 +428,8 @@ class Contacts extends DolibarrApi
*
* @param int $id Id of contact
* @param array $request_data Request datas
* @phan-param ?array<string,string> $request_data
* @phpstan-param ?array<string,string> $request_data
* @return int ID of user
*
* @url POST {id}/createUser

View File

@ -131,10 +131,25 @@ class SocieteAccount extends CommonObject
*/
public $entity;
/**
* @var string
*/
public $key_account;
/**
* @var string
*/
public $login;
/**
* @var string
*/
public $pass_encoding;
/**
* @var string
*/
public $pass_crypted;
/**
* @var string
*/
public $pass_temp;
/**
@ -142,7 +157,13 @@ class SocieteAccount extends CommonObject
*/
public $fk_soc;
/**
* @var string
*/
public $site;
/**
* @var ?string
*/
public $site_account;
/**
@ -150,8 +171,17 @@ class SocieteAccount extends CommonObject
*/
public $date_last_login;
/**
* @var int|''
*/
public $date_last_reset_password;
/**
* @var int|''
*/
public $date_previous_login;
/**
* @var string
*/
public $note_private;
/**
@ -164,6 +194,9 @@ class SocieteAccount extends CommonObject
*/
public $fk_user_modif;
/**
* @var string
*/
public $import_key;
/**

View File

@ -1363,8 +1363,10 @@ class Stripe extends CommonObject
}
}
'@phan-var-force stdClass|\Stripe\Charge $charge';
/*
if (isset($charge->id)) {
}
*/
$return->result = 'success';
$return->id = $charge->id;
@ -1376,7 +1378,7 @@ class Stripe extends CommonObject
$return->message = $charge->source->card->brand." ....".$charge->source->card->last4;
} elseif ($charge->source->type == 'three_d_secure') {
$stripe = new Stripe($this->db);
$src = \Stripe\Source::retrieve("".$charge->source->three_d_secure->card, array(
$src = \Stripe\Source::retrieve((string) $charge->source->three_d_secure->card, array(
"stripe_account" => $stripe->getStripeAccount($service)
));
$return->message = $src->card->brand." ....".$src->card->last4;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -51,6 +52,9 @@ class ActionsTicket extends CommonHookActions
*/
public $dao;
/**
* @var string
*/
public $mesg;
/**
@ -63,10 +67,18 @@ class ActionsTicket extends CommonHookActions
*/
public $errors = array();
//! Numero de l'erreur
/**
* @var int Error number
*/
public $errno = 0;
/**
* @var string
*/
public $template_dir;
/**
* @var string
*/
public $template;
/**

View File

@ -62,7 +62,7 @@ class UserGroup extends CommonObject
/**
* @var string
* @deprecated
* @deprecated Use $name
* @see $name
*/
public $nom;
@ -73,7 +73,7 @@ class UserGroup extends CommonObject
public $name; // Name of group
/**
* @var int<0,1> global group
* @var int<0,1> global group Does not seem to be used
*/
public $globalgroup; // Global group
@ -86,7 +86,7 @@ class UserGroup extends CommonObject
/**
* Date creation record (datec)
*
* @var integer
* @var int
*/
public $datec;
@ -125,6 +125,9 @@ class UserGroup extends CommonObject
*/
public $all_permissions_are_loaded;
/**
* @var static
*/
public $oldcopy; // To contains a clone of this when we need to save old properties of object
public $fields = array(
@ -912,11 +915,11 @@ class UserGroup extends CommonObject
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
* @param array $info Info array loaded by _load_ldap_info
* @param int $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
* @param array<string,mixed> $info Info array loaded by _load_ldap_info
* @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
* 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
* 2=Return key only (uid=qqq)
* @return string DN
* @return string DN
*/
public function _load_ldap_dn($info, $mode = 0)
{
@ -941,7 +944,7 @@ class UserGroup extends CommonObject
/**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
*
* @return array Tableau info des attributes
* @return array<string,mixed> Tableau info des attributes
*/
public function _load_ldap_info()
{
@ -1012,10 +1015,10 @@ class UserGroup extends CommonObject
*
* @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
* @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<string,mixed> $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)

View File

@ -1104,7 +1104,7 @@ class ProductAttribute extends CommonObject
/**
* Update position of attributes with ajax
*
* @param array $rows Array of rows
* @param int[] $rows Array of rows
* @return void
*/
public function attributesAjaxOrder($rows)

View File

@ -325,7 +325,7 @@ class Context
* Get root url
*
* @param string $controller Controller name
* @param string|array $moreParams More parameters
* @param string|array<string,mixed> $moreParams More parameters
* @param bool $addToken Add token hash only if $controller is set
* @return string
* @deprecated see getControllerUrl()
@ -339,7 +339,7 @@ class Context
* Get controller url according to context
*
* @param string $controller Controller name
* @param string|array $moreParams More parameters
* @param string|array<string,mixed> $moreParams More parameters
* @param bool $addToken Add token hash only if controller is set
* @return string
*/
@ -369,9 +369,9 @@ class Context
* Used for external link (like email or web page)
* so remove token and contextual behavior associate with current user
*
* @param string $controller Controller
* @param string|array $moreParams More parameters
* @param array $Tparams Parameters
* @param string $controller Controller
* @param string|array<string,mixed> $moreParams More parameters
* @param array<string,mixed> $Tparams Parameters
* @return string
*/
public static function getPublicControllerUrl($controller = '', $moreParams = '', $Tparams = array())

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -16,11 +17,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/webportal/class/controller.class.php
* \ingroup webportal
* \brief File of controller class for WebPortal
*/
/**
* \file htdocs/webportal/class/controller.class.php
* \ingroup webportal
* \brief File of controller class for WebPortal
*/
/**
* Class to manage pages
@ -141,7 +142,7 @@ class Controller
/**
* Execute hook doActions
*
* @param array $parameters Parameters
* @param array<string,mixed> $parameters Parameters
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function hookDoAction($parameters = array())
@ -164,7 +165,7 @@ class Controller
/**
* Execute hook PrintPageView
*
* @param array $parameters Parameters
* @param array<string,mixed> $parameters Parameters
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function hookPrintPageView($parameters = array())

View File

@ -93,17 +93,17 @@ class FormListWebPortal
public $contextpage = '';
/**
* @var array Search filters
* @var string[] Search filters
*/
public $search = array();
/**
* @var array Array of fields
* @var array<string,array{type?:string,label:string,checked:int<0,1>,visible:int<0,1>,enabled:int<0,1>,position:int,help:string}> Array of fields
*/
public $arrayfields = array();
/**
* @var array Company static list (cache)
* @var array<int,Societe> Company static list (cache)
*/
public $companyStaticList = array();
@ -199,7 +199,7 @@ class FormListWebPortal
$arrayfields['t.' . $key] = array(
'label' => $val['label'],
'checked' => (($visible < 0) ? 0 : 1),
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
@ -212,7 +212,6 @@ class FormListWebPortal
if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) {
$arrayfields['signature_link'] = array('label' => 'Signature', 'checked' => 1, 'enabled' => 1, 'visible' => 1, 'position' => 10002, 'help' => '',);
}
$object->fields = dol_sort_array($object->fields, 'position');
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
$arrayfields = dol_sort_array($arrayfields, 'position');
@ -260,6 +259,7 @@ class FormListWebPortal
global $conf, $hookmanager, $langs;
$html = '';
$nbpages = 0;
// initialize
$action = $this->action;
@ -501,8 +501,8 @@ class FormListWebPortal
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
$html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
$postDateStart = dol_mktime(0, 0, 0, $search[$key . '_dtstartmonth'], $search[$key . '_dtstartday'], $search[$key . '_dtstartyear']);
$postDateEnd = dol_mktime(0, 0, 0, $search[$key . '_dtendmonth'], $search[$key . '_dtendday'], $search[$key . '_dtendyear']);
$postDateStart = dol_mktime(0, 0, 0, (int) $search[$key . '_dtstartmonth'], (int) $search[$key . '_dtstartday'], (int) $search[$key . '_dtstartyear']);
$postDateEnd = dol_mktime(0, 0, 0, (int) $search[$key . '_dtendmonth'], (int) $search[$key . '_dtendday'], (int) $search[$key . '_dtendyear']);
$html .= '<div class="grid width150">';
$html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From'));
@ -616,6 +616,7 @@ class FormListWebPortal
'nbfield' => 0,
'totalizable' => [],
];
$remaintopay = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $this->db->fetch_object($resql);
@ -629,6 +630,7 @@ class FormListWebPortal
// specific to get invoice status (depends on payment)
$payment = -1;
if ($elementEn == 'invoice') {
'@phan-var-force Facture $object';
// paid sum
$payment = $object->getSommePaiement();
$totalcreditnotes = $object->getSumCreditNotesUsed();
@ -641,7 +643,7 @@ class FormListWebPortal
$remaintopay = 0;
}
if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) {
$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id);
$remaincreditnote = $discount->getAvailableDiscounts($companyStatic, null, 'rc.fk_facture_source=' . $object->id);
$remaintopay = -$remaincreditnote;
}
}
@ -692,6 +694,7 @@ class FormListWebPortal
}
// Remain to pay
if (!empty($arrayfields['remain_to_pay']['checked'])) {
// @phan-suppress-next-line PhanTypeSuspiciousStringExpression
$html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">';
$html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, '');
//$html .= price($remaintopay);
@ -714,6 +717,7 @@ class FormListWebPortal
}
// Signature link
if ($elementEn == "propal" && getDolGlobalString("PROPOSAL_ALLOW_ONLINESIGN") != 0) {
'@phan-var-force Propal $object';
if (!empty($arrayfields['signature_link']['checked'])) {
$html .= '<td class="nowraponall" data-label="' . $arrayfields['signature_link']['label'] . '">';
if ($object->fk_statut == Propal::STATUS_VALIDATED) {

View File

@ -89,7 +89,7 @@ class WorkstationResource extends CommonObject
* Function used to get an array with all resources linked to a workstation
*
* @param int $fk_workstation Id of workstation we need to get linked resources
* @return array Array of record
* @return int[] Array of record
*/
public static function getAllResourcesOfWorkstation($fk_workstation)
{

View File

@ -88,7 +88,7 @@ class WorkstationUserGroup extends CommonObject
* Function used to get an array with all usergroups linked to a workstation
*
* @param int $fk_workstation id of workstation we need to get linked usergroups
* @return array Array of record
* @return int[] Array of record
*/
public static function getAllGroupsOfWorkstation($fk_workstation)
{