diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index c2382f6e823..2c9cc23ca11 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,11 +9,11 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 1380+ occurrences - // PhanUndeclaredProperty : 500+ occurrences + // PhanTypeMismatchArgument : 1360+ occurrences + // PhanUndeclaredProperty : 640+ occurrences // PhanTypeMismatchArgumentNullable : 310+ occurrences // PhanPluginUnknownArrayMethodReturnType : 170+ occurrences - // PhanTypeMismatchProperty : 120+ occurrences + // PhanTypeMismatchProperty : 160+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences // PhanUndeclaredGlobalVariable : 100+ occurrences // PhanTypeMismatchArgumentProbablyReal : 35+ occurrences @@ -78,7 +78,7 @@ return [ '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'], @@ -128,7 +128,7 @@ return [ '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 +160,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 +168,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 +191,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 +231,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 +260,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 +269,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 +285,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'], @@ -359,7 +359,7 @@ 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/functions.lib.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/lib/images.lib.php' => ['PhanTypeMismatchArgumentNullable'], @@ -432,6 +432,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 +452,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 +483,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 +501,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 +511,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 +521,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 +563,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 +588,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 +603,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 +623,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'], diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index aa1c2a32439..d10758189df 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2020-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bfc13a8d337..24b7341cb96 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -189,7 +189,7 @@ class HookManager * * @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...) * @param array $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. diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 17215e8b665..67fa18fa32b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2434,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; @@ -2463,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 @@ -2482,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 @@ -3151,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) { @@ -4771,9 +4771,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 @@ -6414,9 +6414,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 @@ -7190,7 +7190,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() */ @@ -7300,7 +7300,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); @@ -7547,7 +7547,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) { @@ -10154,7 +10154,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 @@ -12916,7 +12916,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) { diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 792d86938fc..cf5e3aa55f2 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -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..."); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f06a8fd29ec..88ab82da615 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -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) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 6afc01197d9..b82b92940ea 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -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]; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 19d4d3cf424..75dcbe9d0dc 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -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) { diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index af5f69019c7..f1a07f585fb 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -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')));