Merge pull request #33211 from mdeweerd/fix/ci.2025.2.25
Qual: Fix phan notices in functions.lib.php
This commit is contained in:
commit
be65ab0650
9 changed files with 108 additions and 84 deletions
|
|
@ -9,21 +9,21 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanTypeMismatchArgument : 1380+ occurrences
|
||||
// PhanUndeclaredProperty : 500+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 310+ occurrences
|
||||
// PhanTypeMismatchArgument : 1240+ occurrences
|
||||
// PhanUndeclaredProperty : 480+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 290+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 170+ occurrences
|
||||
// PhanTypeMismatchProperty : 120+ occurrences
|
||||
// PhanTypeMismatchProperty : 160+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 110+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 100+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 35+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 30+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 25+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 25+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 25+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 20+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 20+ occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 15+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 15+ occurrences
|
||||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
// PhanTypeMismatchArgumentNullableInternal : 10+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 9 occurrences
|
||||
// PhanUndeclaredMethod : 9 occurrences
|
||||
// PhanTypeComparisonFromArray : 7 occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 6 occurrences
|
||||
|
|
@ -47,11 +47,9 @@ return [
|
|||
'htdocs/accountancy/admin/account.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/categories.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/categories_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/categories_list.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/fiscalyear_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/journals_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/admin/report_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/admin/subaccount.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/bookkeeping/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/accountancy/bookkeeping/export.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -76,9 +74,8 @@ return [
|
|||
'htdocs/accountancy/supplier/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/accountancy/tpl/export_journal.tpl.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/admin/member.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/admin/website.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -93,7 +90,6 @@ return [
|
|||
'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/admin/dict.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/emailcollector_card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/emailcollector_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -121,14 +117,13 @@ return [
|
|||
'htdocs/admin/ticket.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/tools/export.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/webhook.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/admin/website.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/asset/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/asset/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -160,7 +155,7 @@ return [
|
|||
'htdocs/categories/photos.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'],
|
||||
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/class/actioncomm.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
|
||||
|
|
@ -168,10 +163,10 @@ return [
|
|||
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/info.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/comm/action/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/action/rapport/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/comm/mailing/cibles.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -191,7 +186,7 @@ return [
|
|||
'htdocs/comm/remise.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/remx.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/commande/agenda.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/commande/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/commande/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/commande/class/commande.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/commande/class/orderline.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -231,7 +226,7 @@ return [
|
|||
'htdocs/compta/deplacement/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/agenda-rec.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/agenda.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -260,7 +255,7 @@ return [
|
|||
'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -269,7 +264,7 @@ return [
|
|||
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/result.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/sociales/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/sociales/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/payments.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/cabyprodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -285,7 +280,7 @@ return [
|
|||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/ajax/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/class/contact.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/contact/consumption.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -309,7 +304,6 @@ return [
|
|||
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/ajax/ajaxstatusprospect.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/ajax/contacts.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/ajax/editinline.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/ajax/loadinplace.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -337,7 +331,6 @@ return [
|
|||
'htdocs/core/class/extrafields.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/fileupload.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/fiscalyear.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/class/html.formcompany.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/html.formfile.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -359,7 +352,6 @@ return [
|
|||
'htdocs/core/lib/date.lib.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/lib/expedition.lib.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/lib/files.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/lib/functions.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/lib/images.lib.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -432,6 +424,7 @@ return [
|
|||
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/tpl/extrafields_list_array_fields.tpl.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/tpl/extrafields_list_print_fields.tpl.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -451,8 +444,10 @@ return [
|
|||
'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/dav/dav.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/debugbar/class/TraceableDB.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/delivery/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/don/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -480,9 +475,10 @@ return [
|
|||
'htdocs/expedition/class/expedition.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/expedition/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expedition/shipment.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/expedition/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/ajax/ajaxik.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/expensereport/class/expensereportline.class.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -497,6 +493,7 @@ return [
|
|||
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/agenda.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/contact.php' => ['PhanTypeMismatchArgument'],
|
||||
|
|
@ -506,6 +503,7 @@ return [
|
|||
'htdocs/fichinter/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fourn/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -515,13 +513,14 @@ return [
|
|||
'htdocs/fourn/class/fournisseur.facture.ligne.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fourn/class/fournisseur.orderline.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/commande/dispatch.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/fourn/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/holiday/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/holiday/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -556,12 +555,15 @@ return [
|
|||
'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/inventory/class/inventory.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/price.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/price_suppliers.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'],
|
||||
'htdocs/product/stock/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/product/stock/class/api_stockmovements.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/product/stock/class/api_warehouses.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -578,8 +580,9 @@ return [
|
|||
'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -592,10 +595,10 @@ return [
|
|||
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/reception/class/api_receptions.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/reception/list.php' => ['PhanTypeMismatchArgumentNullable', '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' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -612,11 +615,12 @@ return [
|
|||
'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/stripe/class/stripe.class.php' => ['PhanTypeExpectedObjectPropAccess'],
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -110,7 +110,7 @@ if (empty($reshook)) {
|
|||
|
||||
// Action mise a jour d'une categorie
|
||||
if ($action == 'update' && $user->hasRight('categorie', 'creer')) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/* Copyright (C) 2010-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -150,7 +150,8 @@ class HookManager
|
|||
'@phan-var-force CommonHookActions $actionInstance';
|
||||
|
||||
|
||||
$priority = empty($actionInstance->priority) ? 50 : $actionInstance->priority;
|
||||
// @phan-suppress-next-line PhanUndeclaredProperty
|
||||
$priority = property_exists($actionInstance, 'priority') && empty($actionInstance->priority) ? 50 : $actionInstance->priority;
|
||||
|
||||
$this->hooks[$context][$module] = $actionInstance;
|
||||
$this->hooksSorted[$context][$priority.':'.$module] = $actionInstance;
|
||||
|
|
@ -189,7 +190,7 @@ class HookManager
|
|||
*
|
||||
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
|
||||
* @param array<string,mixed> $parameters Array of parameters
|
||||
* @param object $object Object to use hooks on
|
||||
* @param null|Object|string $object Object to use hooks on @phan-ignore-reference
|
||||
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||
* @return int<-1,1> For 'addreplace' hooks (doActions, formConfirm, formObjectOptions, pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0 if we want to keep standard actions, >0 uf we want to stop/replace standard actions (at least one > 0 and replacement will be done), <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
|
|
@ -309,7 +310,7 @@ class HookManager
|
|||
$actionclassinstance->errors = array();
|
||||
|
||||
if (getDolGlobalInt('MAIN_HOOK_DEBUG')) {
|
||||
// This his too much verbose, enabled if const enabled only
|
||||
// This is too verbose, enabled if const enabled only // False positive about id & element: @phan-suppress-next-line PhanUndeclaredProperty
|
||||
dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG);
|
||||
}
|
||||
|
||||
|
|
@ -347,8 +348,8 @@ class HookManager
|
|||
} else {
|
||||
// Generic hooks that return a string or array (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...)
|
||||
|
||||
// TODO. this test should be done into the method of hook by returning nothing @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
if (is_array($parameters) && !empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) {
|
||||
// TODO. this test should be done in the hook method by returning nothing @phan-suppress-next-line PhanTypeInvalidDimOffset,PhanUndeclaredProperty
|
||||
if (is_array($parameters) && !empty($parameters['special_code']) && $parameters['special_code'] > 3 && (property_exists($actionclassinstance, 'module_number') && ($parameters['special_code'] != $actionclassinstance->module_number))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1180,7 +1180,9 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto', $saverestore = '')
|
|||
$minute = intval($m[2]);
|
||||
$second = intval($m[3]);
|
||||
} elseif ($hourTime === 'end') {
|
||||
$hour = 23; $minute = 59; $second = 59;
|
||||
$hour = 23;
|
||||
$minute = 59;
|
||||
$second = 59;
|
||||
} else {
|
||||
$hour = $minute = $second = 0;
|
||||
}
|
||||
|
|
@ -2432,7 +2434,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
|
||||
if (!array_key_exists($level, $logLevels)) {
|
||||
dol_syslog('Error Bad Log Level '.$level, LOG_ERR);
|
||||
$level = $logLevels[LOG_ERR];
|
||||
$level = LOG_ERR;
|
||||
}
|
||||
if ($level > getDolGlobalInt('SYSLOG_LEVEL')) {
|
||||
return;
|
||||
|
|
@ -2461,12 +2463,12 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
|
||||
$data = array(
|
||||
'message' => $message,
|
||||
'script' => (isset($_SERVER['PHP_SELF']) ? basename($_SERVER['PHP_SELF'], '.php') : false),
|
||||
'script' => (isset($_SERVER['PHP_SELF']) ? basename($_SERVER['PHP_SELF'], '.php') : ''),
|
||||
'level' => $level,
|
||||
'user' => ((is_object($user) && $user->id) ? $user->login : false),
|
||||
'ip' => false,
|
||||
'osuser' => function_exists('posix_getuid') ? posix_getuid() : false,
|
||||
'ospid' => getmypid() // on linux, max value is defined into cat /proc/sys/kernel/pid_max
|
||||
'user' => ((is_object($user) && $user->id) ? $user->login : ''),
|
||||
'ip' => '',
|
||||
'osuser' => function_exists('posix_getuid') ? (string) posix_getuid() : '',
|
||||
'ospid' => (string) getmypid() // on linux, max value is defined into cat /proc/sys/kernel/pid_max
|
||||
);
|
||||
|
||||
$remoteip = getUserRemoteIP(); // Get ip when page run on a web server
|
||||
|
|
@ -2480,20 +2482,20 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
}
|
||||
} elseif (!empty($_SERVER['SERVER_ADDR'])) {
|
||||
// This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache)
|
||||
$data['ip'] = $_SERVER['SERVER_ADDR'];
|
||||
$data['ip'] = (string) $_SERVER['SERVER_ADDR'];
|
||||
} elseif (!empty($_SERVER['COMPUTERNAME'])) {
|
||||
// This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defines it).
|
||||
$data['ip'] = $_SERVER['COMPUTERNAME'];
|
||||
$data['ip'] = (string) $_SERVER['COMPUTERNAME'];
|
||||
} else {
|
||||
$data['ip'] = '???';
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['USERNAME'])) {
|
||||
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but useful if OS defines it).
|
||||
$data['osuser'] = $_SERVER['USERNAME'];
|
||||
$data['osuser'] = (string) $_SERVER['USERNAME'];
|
||||
} elseif (!empty($_SERVER['LOGNAME'])) {
|
||||
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but useful if OS defines it).
|
||||
$data['osuser'] = $_SERVER['LOGNAME'];
|
||||
$data['osuser'] = (string) $_SERVER['LOGNAME'];
|
||||
}
|
||||
|
||||
// Loop on each log handler and send output
|
||||
|
|
@ -3149,7 +3151,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||
}
|
||||
}
|
||||
} elseif (!$phototoshow) { // example if modulepart = 'societe' or 'photo' or 'memberphoto'
|
||||
$phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0, $maxvisiblephotos);
|
||||
$phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0);
|
||||
}
|
||||
|
||||
if ($phototoshow) {
|
||||
|
|
@ -3211,12 +3213,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||
$morehtmlstatus .= '<span class="statusrefbuy">'.$object->getLibStatut(6, 1).'</span>';
|
||||
}
|
||||
} elseif (in_array($object->element, array('salary'))) {
|
||||
'@phan-var-force Salary $object';
|
||||
$tmptxt = $object->getLibStatut(6, $object->alreadypaid);
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
|
||||
$tmptxt = $object->getLibStatut(5, $object->alreadypaid);
|
||||
}
|
||||
$morehtmlstatus .= $tmptxt;
|
||||
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier'))) { // TODO Move this to use ->alreadypaid
|
||||
'@phan-var-force Facture|FactureFournisseur|CommonInvoice $object';
|
||||
$totalallpayments = $object->getSommePaiement(0);
|
||||
$totalallpayments += $object->getSumCreditNotesUsed(0);
|
||||
$totalallpayments += $object->getSumDepositsUsed(0);
|
||||
|
|
@ -3226,6 +3230,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||
}
|
||||
$morehtmlstatus .= $tmptxt;
|
||||
} elseif (in_array($object->element, array('chargesociales', 'loan', 'tva'))) { // TODO Move this to use ->alreadypaid
|
||||
'@phan-var-force ChargeSociales|Loan|Tva $object';
|
||||
$tmptxt = $object->getLibStatut(6, $object->totalpaid);
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
|
||||
$tmptxt = $object->getLibStatut(5, $object->totalpaid);
|
||||
|
|
@ -4769,9 +4774,9 @@ function dol_print_address($address, $htmlid, $element, $id, $noprint = 0, $char
|
|||
}
|
||||
if (empty($reshook)) {
|
||||
if (empty($charfornl)) {
|
||||
$out .= nl2br($address);
|
||||
$out .= nl2br((string) $address);
|
||||
} else {
|
||||
$out .= preg_replace('/[\r\n]+/', $charfornl, $address);
|
||||
$out .= preg_replace('/[\r\n]+/', $charfornl, (string) $address);
|
||||
}
|
||||
|
||||
// TODO Remove this block, we can add this using the hook now
|
||||
|
|
@ -6412,9 +6417,9 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
|||
} else {
|
||||
$tmptooltip = array($tooltip);
|
||||
}
|
||||
$out .= $form->textwithpicto($langs->trans($name), $langs->trans($tmptooltip[0]), (empty($tmptooltip[2]) ? 1 : $tmptooltip[2]), 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1]));
|
||||
$out .= $form->textwithpicto($langs->trans((string) $name), $langs->trans($tmptooltip[0]), (empty($tmptooltip[2]) ? '1' : $tmptooltip[2]), 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1]));
|
||||
} else {
|
||||
$out .= $langs->trans($name);
|
||||
$out .= $langs->trans((string) $name);
|
||||
}
|
||||
|
||||
if (empty($thead) && $field && empty($disablesortlink)) { // If this is a sort field
|
||||
|
|
@ -7188,7 +7193,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
|
|||
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
|
||||
* @param ?Societe $thirdparty_buyer Object of buying third party
|
||||
* @param ?Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param int $vatnpr If vat rate is NPR or not
|
||||
* @param int<0,1> $vatnpr If vat rate is NPR or not
|
||||
* @return int<0,0>|string 0 if not found, localtax rate if found (Can be '20', '-19:-15:-9')
|
||||
* @see get_default_tva()
|
||||
*/
|
||||
|
|
@ -7298,7 +7303,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer = null, $thirdparty_se
|
|||
if (!empty($vatratecode)) {
|
||||
$sql .= " AND t.code ='".$db->escape($vatratecode)."'"; // If we have the code, we use it in priority
|
||||
} else {
|
||||
$sql .= " AND t.recuperableonly = '".$db->escape($vatnpr)."'";
|
||||
$sql .= " AND t.recuperableonly = '".$db->escape((string) $vatnpr)."'";
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
|
@ -7545,7 +7550,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
|||
) {
|
||||
// If country of thirdparty to consider is ours
|
||||
if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object
|
||||
$result = $product->get_buyprice($idprodfournprice, 0, 0, 0);
|
||||
$result = $product->get_buyprice($idprodfournprice, 0, 0, '');
|
||||
if ($result > 0) {
|
||||
$ret = $product->vatrate_supplier;
|
||||
if ($product->default_vat_code_supplier) {
|
||||
|
|
@ -10152,7 +10157,7 @@ function setEventMessages($mesg, $mesgs, $style = 'mesgs', $messagekey = '', $no
|
|||
dol_print_error(null, 'Bad parameter style='.$style.' for setEventMessages');
|
||||
}
|
||||
if (empty($mesgs)) {
|
||||
setEventMessage($mesg, $style, $noduplicate, $attop);
|
||||
setEventMessage((string) $mesg, $style, $noduplicate, $attop);
|
||||
} else {
|
||||
if (!empty($mesg) && !in_array($mesg, $mesgs)) {
|
||||
setEventMessage($mesg, $style, $noduplicate, $attop); // Add message string if not already into array
|
||||
|
|
@ -10674,14 +10679,14 @@ function dol_eval_new($s)
|
|||
{
|
||||
// Only this global variables can be read by eval function and returned to caller
|
||||
global $conf, // Read of const is done with getDolGlobalString() but we need $conf->currency for example
|
||||
$db, $langs, $user, $website, $websitepage,
|
||||
$action, $mainmenu, $leftmenu,
|
||||
$mysoc,
|
||||
$objectoffield, // To allow the use of $objectoffield in computed fields
|
||||
$db, $langs, $user, $website, $websitepage,
|
||||
$action, $mainmenu, $leftmenu,
|
||||
$mysoc,
|
||||
$objectoffield, // To allow the use of $objectoffield in computed fields
|
||||
|
||||
// Old variables used
|
||||
$object,
|
||||
$obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object
|
||||
// Old variables used
|
||||
$object,
|
||||
$obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object
|
||||
|
||||
// PHP < 7.4.0
|
||||
defined('T_COALESCE_EQUAL') || define('T_COALESCE_EQUAL', PHP_INT_MAX);
|
||||
|
|
@ -11870,10 +11875,23 @@ function dolExplodeKeepIfQuotes($input)
|
|||
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
|
||||
|
||||
// Merge result and delete empty values
|
||||
// @phan-suppress-next-line PhanPluginUnknownClosureParamType, PhanPluginUnknownClosureReturnType
|
||||
return array_filter(array_map(function ($a, $b, $c) {
|
||||
return $a ?: ($b ?: $c);
|
||||
}, $matches[1], $matches[2], $matches[3]));
|
||||
return array_filter(array_map(
|
||||
/**
|
||||
* Return first non-empty item, or empty string
|
||||
*
|
||||
* @param string $a Possibly empty item - match ""
|
||||
* @param string $b Possibly empty item - match ''
|
||||
* @param string $c Non empty string if $a and $b are empty
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function ($a, $b, $c) {
|
||||
return $a ?: ($b ?: $c);
|
||||
},
|
||||
$matches[1],
|
||||
$matches[2],
|
||||
$matches[3]
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -12901,7 +12919,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||
} else { // If a title was forced from $params['badgeParams']['attr']['title'], we set the class to get it as a tooltip.
|
||||
$dolGetBadgeParams['attr']['class'] .= ' classfortooltip';
|
||||
// And if we use tooltip, we can output title in HTML @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
$dolGetBadgeParams['attr']['title'] = dol_htmlentitiesbr($dolGetBadgeParams['attr']['title'], 1);
|
||||
$dolGetBadgeParams['attr']['title'] = dol_htmlentitiesbr((string) $dolGetBadgeParams['attr']['title'], 1);
|
||||
}
|
||||
|
||||
if ($displayMode == 3) {
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ class pdf_octopus extends ModelePDFFactures
|
|||
$this->atleastonediscount = 0;
|
||||
$this->situationinvoice = true;
|
||||
if (!empty($object)) {
|
||||
'@phan-var-force Facture $object'; // Supposing $object is Facture;
|
||||
$this->TDataSituation = $this->getDataSituation($object);
|
||||
} else {
|
||||
dol_syslog("object is empty, do not call getDataSituation...");
|
||||
|
|
|
|||
|
|
@ -5935,9 +5935,9 @@ class Product 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 $type 0=Sell, 1=Buy, 2=Batch Number management
|
||||
* @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
|
||||
* @param int<0,2> $type 0=Sell, 1=Buy, 2=Batch Number management
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLibStatut($mode = 0, $type = 0)
|
||||
{
|
||||
|
|
@ -5959,8 +5959,8 @@ class Product extends CommonObject
|
|||
* Return label of a given status
|
||||
*
|
||||
* @param int $status Statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @param int $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch"
|
||||
* @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
|
||||
* @param int<0,2> $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch"
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0, $type = 0)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('projet', 'cree
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (!$error) {
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$tmparray = explode('_', GETPOST('task_parent'));
|
||||
$task_parent = $tmparray[1];
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ if (empty($reshook)) {
|
|||
if (!$error) {
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
|
@ -687,7 +687,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
if (GETPOST("password", "password")) { // If pass is empty, we do not change it.
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$ret = $object->setPassword($user, GETPOST("password", "password"));
|
||||
if (is_int($ret) && $ret < 0) {
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ if (empty($reshook)) {
|
|||
if (($action == 'adduser' || $action == 'removeuser') && $permissiontoedit) {
|
||||
if ($userid > 0) {
|
||||
$object->fetch($id);
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($userid);
|
||||
|
|
@ -203,7 +203,7 @@ if (empty($reshook)) {
|
|||
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->name = GETPOST("nom", 'alphanohtml');
|
||||
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
|
||||
|
|
|
|||
Loading…
Reference in a new issue