diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 7352582772d9d..1c990c53c7862 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,26 +9,26 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1430+ occurrences - // PhanUndeclaredProperty : 850+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 700+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 670+ occurrences + // PhanPluginUnknownPropertyType : 1330+ occurrences + // PhanUndeclaredProperty : 840+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 690+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 630+ occurrences // PhanUndeclaredGlobalVariable : 440+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 430+ occurrences - // PhanPluginUnknownArrayMethodParamType : 350+ occurrences - // PhanPossiblyUndeclaredVariable : 300+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 420+ occurrences + // PhanPluginUnknownArrayMethodParamType : 340+ occurrences + // PhanPossiblyUndeclaredVariable : 280+ occurrences // PhanTypeMismatchProperty : 190+ occurrences // PhanPluginUnknownArrayFunctionReturnType : 150+ occurrences - // PhanPluginUnknownObjectMethodCall : 150+ occurrences // PhanPluginUnknownArrayFunctionParamType : 140+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 95+ occurrences - // PhanPluginUnknownArrayPropertyType : 75+ occurrences + // PhanPluginUnknownObjectMethodCall : 130+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 80+ occurrences // PhanPluginUndeclaredVariableIsset : 70+ occurrences + // PhanPluginUnknownArrayPropertyType : 70+ occurrences // PhanPluginEmptyStatementIf : 55+ occurrences - // PhanTypeMismatchDimFetch : 55+ occurrences // PhanRedefineFunction : 50+ occurrences // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences + // PhanTypeMismatchDimFetch : 35+ occurrences // PhanTypeExpectedObjectPropAccess : 25+ occurrences // PhanPossiblyNullTypeMismatchProperty : 15+ occurrences // PhanTypeComparisonFromArray : 15+ occurrences @@ -36,16 +36,16 @@ return [ // PhanEmptyForeach : 10+ occurrences // PhanPluginConstantVariableNull : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanUndeclaredMethod : 9 occurrences + // PhanTypeMismatchDimFetchNullable : 10+ occurrences + // PhanUndeclaredMethod : 10+ occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences - // PhanTypeMismatchDimFetchNullable : 7 occurrences - // PhanTypeExpectedObjectPropAccessButGotNull : 6 occurrences + // PhanTypeExpectedObjectPropAccessButGotNull : 5 occurrences + // PhanParamTooMany : 4 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanParamTooMany : 3 occurrences - // PhanInvalidFQSENInClasslike : 2 occurrences + // PhanEmptyFQSENInClasslike : 3 occurrences + // PhanInvalidFQSENInClasslike : 3 occurrences // PhanAccessMethodProtected : 1 occurrence - // PhanEmptyFQSENInClasslike : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ @@ -60,7 +60,7 @@ return [ 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -76,7 +76,6 @@ return [ 'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'], - 'htdocs/barcode/codeinit.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/blockedlog/ajax/block-info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/blockedlog/class/blockedlog.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'], @@ -90,14 +89,13 @@ return [ 'htdocs/bookcal/availabilities_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/bookcal/availabilities_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookcal/booking_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/bookcal/calendar_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/bookcal/calendar_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/bookcal/lib/bookcal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/bookcal/lib/bookcal_availabilities.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/bookcal/lib/bookcal_calendar.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/bookmarks/class/bookmark.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/categories/class/categorie.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'], 'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'], @@ -123,21 +121,20 @@ return [ 'htdocs/comm/mailing/class/html.formadvtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/comm/mailing/class/mailing.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], - 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], - 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/comm/propal/class/propal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -158,7 +155,6 @@ return [ 'htdocs/compta/cashcontrol/class/cashcontrol.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/deplacement/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -208,12 +204,9 @@ return [ 'htdocs/compta/resultat/clientfourn.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/resultat/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/resultat/result.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/sociales/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/compta/sociales/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/compta/sociales/class/cchargesociales.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], - 'htdocs/compta/sociales/class/chargesociales.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/sociales/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/sociales/info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/sociales/list.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/compta/sociales/payments.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/stats/byratecountry.php' => ['PhanPluginEmptyStatementIf'], @@ -224,13 +217,11 @@ return [ 'htdocs/compta/stats/supplier_turnover.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/tva/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/tva/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/tva/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/tva/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/tva/info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/quadri_detail.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'], @@ -240,7 +231,7 @@ return [ 'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'], 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/contrat/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], @@ -254,15 +245,14 @@ return [ 'htdocs/core/actions_massactions.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/ajax/fileupload.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/ajax/saveinplace.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/core/ajax/saveinplace.php' => ['PhanUndeclaredProperty'], 'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/ajax/ziptown.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'], @@ -283,8 +273,7 @@ return [ 'htdocs/core/boxes/box_services_contracts.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/boxes/box_task.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_validated_projects.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/class/CSMSFile.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/canvas.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'], 'htdocs/core/class/ccountry.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], @@ -319,32 +308,27 @@ return [ 'htdocs/core/class/html.formaccounting.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/html.formbarcode.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/html.formcategory.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/core/class/html.formcompany.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/class/html.formfile.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/html.formfile.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/html.formmail.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/html.formticket.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/interfaces.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/link.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/mastodonhandler.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/smtps.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/class/translate.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/class/utils.class.php' => ['PhanPluginConstantVariableNull', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/class/validate.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/class/vcard.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchDimFetch'], - 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDimFetchNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], 'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/db/Database.interface.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/db/mysqli.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray'], @@ -359,7 +343,7 @@ return [ 'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], + 'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], 'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'], @@ -417,7 +401,7 @@ return [ 'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/menus/standard/eldy_menu.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/modules/DolibarrModules.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/core/modules/action/modules_action.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], @@ -565,7 +549,7 @@ return [ 'htdocs/delivery/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/document.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/document.php' => ['PhanRedefineFunction'], 'htdocs/don/admin/donation.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -589,7 +573,7 @@ return [ 'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ecm/index_auto.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ecm/index_medias.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanInvalidFQSENInClasslike', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/emailcollector/class/emailcollectoraction.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/emailcollector/class/emailcollectorfilter.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/emailcollector/lib/emailcollector.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -616,7 +600,6 @@ return [ 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -665,9 +648,8 @@ return [ 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/holiday/class/holiday.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch'], - 'htdocs/holiday/define_holiday.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'], 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/hrm/admin/admin_hrm.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/hrm/class/evaluation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/hrm/class/evaluationdet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -770,7 +752,7 @@ return [ 'htdocs/product/canvas/product/actions_card_product.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/product/canvas/service/actions_card_service.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/product/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], + 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/product/class/product.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/product/class/productbatch.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], @@ -873,7 +855,7 @@ return [ 'htdocs/public/project/suggestconference.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/stripe/ipn.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], @@ -949,10 +931,8 @@ return [ 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], @@ -1021,7 +1001,7 @@ return [ 'htdocs/webportal/class/controller.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetch'], + 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetch'], 'htdocs/webportal/class/webPortalTheme.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'], diff --git a/dev/tools/phan/stubs/ovhsms.php b/dev/tools/phan/stubs/ovhsms.php new file mode 100644 index 0000000000000..74d2adecb396f --- /dev/null +++ b/dev/tools/phan/stubs/ovhsms.php @@ -0,0 +1,115 @@ + + */ + +namespace { + /** + * Use an OVH account to send SMS with Dolibarr + */ + class OvhSms extends \CommonObject + { + public $db; + //!< To store db handler + public $error; + //!< To return error code (or message) + public $errors = array(); + //!< To return several error codes (or messages) + public $element = 'ovhsms'; + //!< Id that identify managed object + public $id; + public $account; + public $socid; + public $contact_id; + public $member_id; + public $fk_project; + public $nostop; + public $expe; + public $dest; + public $message; + public $validity; + public $class; + public $deferred; + public $priority; + public $soap; + // Old API + public $conn; + // New API + public $endpoint; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Logout + * + * @return void + */ + public function logout() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Send SMS + * + * @return int <=0 if error, >0 if OK + */ + public function SmsSend() + { + } + /** + * Show HTML select box to select account + * + * @return void + */ + public function printListAccount() + { + } + /** + * Return list of SMSAccounts + * + * @return array + */ + public function getSmsListAccount() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return Credit + * + * @return array + */ + public function CreditLeft() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return History + * + * @return array + */ + public function SmsHistory() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return list of possible SMS senders + * + * @return array|int <0 if KO, array with list of available senders if OK + */ + public function SmsSenderList() + { + } + /** + * Call soapDebug method to output traces + * + * @return void + */ + public function soapDebug() + { + } + } +} diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 7334ec261187b..e45ddb08da2ea 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -140,7 +140,7 @@ $thirdpartystatic->id = $obj->rowid; $nextvalue = $modBarCodeThirdparty->getNextValue($thirdpartystatic, ''); - $result = $thirdpartystatic->setValueFrom('barcode', $nextvalue, '', '', 'text', '', $user, 'THIRDPARTY_MODIFY'); + $result = $thirdpartystatic->setValueFrom('barcode', $nextvalue, '', null, 'text', '', $user, 'THIRDPARTY_MODIFY'); $nbtry++; if ($result > 0) { @@ -249,7 +249,7 @@ $nextvalue = $modBarCodeProduct->getNextValue($productstatic, ''); //print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."
\n"; - $result = $productstatic->setValueFrom('barcode', $nextvalue, '', '', 'text', '', $user, 'PRODUCT_MODIFY'); + $result = $productstatic->setValueFrom('barcode', $nextvalue, '', null, 'text', '', $user, 'PRODUCT_MODIFY'); $nbtry++; if ($result > 0) { diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index 4cd7fc5dd2fad..512fd618c4482 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -180,8 +181,8 @@ } - // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen - include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -196,7 +197,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOSTINT('projectid')); diff --git a/htdocs/bookcal/calendar_card.php b/htdocs/bookcal/calendar_card.php index 070b0c01ff183..30e3bf7b8e458 100644 --- a/htdocs/bookcal/calendar_card.php +++ b/htdocs/bookcal/calendar_card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023 Alice Adminson * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -158,7 +159,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOSTINT('projectid')); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c988dcef24cea..ad445ce6fe0d5 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1016,7 +1016,7 @@ $line->multicurrency_total_tva = $line->tva_tx * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; $line->multicurrency_total_ttc = (1 + $line->tva_tx) * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; // Used previous $line->subprice and $line->multicurrency_subprice above, now they can be set to their new values - $line->subprice = $subprice; + $line->subprice = (float) $subprice; $line->multicurrency_subprice = $multicurrency_subprice; } } elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && $usercancreate) { // Add line @@ -1170,7 +1170,7 @@ } } - if ( !$pricebycustomerexist && $object->thirdparty->price_level) { // If price per segment + if (!$pricebycustomerexist && $object->thirdparty->price_level) { // If price per segment $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 74e2785152a21..1c42c8d3720b2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -203,7 +203,7 @@ class Commande extends CommonOrder public $date_commande; /** - * @var null|int|'' Date expected of shipment (date of start of shipment, not the reception that occurs some days after) + * @var null|int|'' Expected shipment date (date of start of shipment, not the reception that occurs some days after) */ public $delivery_date; @@ -213,10 +213,14 @@ class Commande extends CommonOrder public $fk_remise_except; /** - * @deprecated + * @var string + * @deprecated See $fk_remise_except */ public $remise_percent; + /** + * @var int + */ public $source; // Order mode. How we received order (by phone, by email, ...) /** @@ -253,13 +257,17 @@ class Commande extends CommonOrder public $lines = array(); - //! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) + /** + * @var string key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) + */ public $module_source; - //! key of pos source ('0', '1', ...) + /** + * @var string key of pos source ('0', '1', ...) + */ public $pos_source; /** - * @var array Array with line of all shipments + * @var array Array with lines of all shipments (qty) */ public $expeditions; @@ -1325,7 +1333,7 @@ public function createFromClone(User $user, $socid = 0) /** * Load an object from a proposal and create a new order into database * - * @param Object $object Object source + * @param Propal $object Object source * @param User $user User making creation * @return int Return integer <0 if KO, 0 if nothing done, 1 if OK */ @@ -1506,11 +1514,11 @@ public function createFromProposal($object, User $user) * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) - * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * @param ?int $fk_unit Code of the unit to use. Null to use the default one * @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'.... * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id - * @param double $pu_ht_devise Unit price in currency + * @param float $pu_ht_devise Unit price in currency * @param string $ref_ext line external reference * @param int $noupdateafterinsertline No update after insert of line * @return int >0 if OK, <0 if KO @@ -3116,12 +3124,12 @@ public function classifyUnBilled(User $user, $notrigger = 0) * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label Label * @param int $special_code Special code (also used by externals modules!) - * @param array $array_options extrafields array - * @param int|null $fk_unit Code of the unit to use. Null to use the default one - * @param double $pu_ht_devise Amount in currency + * @param array $array_options extrafields array + * @param ?int $fk_unit Code of the unit to use. Null to use the default one + * @param float $pu_ht_devise Amount in currency * @param int $notrigger disable line update trigger * @param string $ref_ext external reference - * @param integer $rang line rank + * @param int $rang line rank * @return int Return integer < 0 if KO, > 0 if OK */ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = array(), $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang = 0) @@ -4132,11 +4140,11 @@ public function getLinesArray() * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param array $moreparams Array to provide more information + * @return int<0,1> 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { @@ -4235,10 +4243,10 @@ public function showDelay() /** * Set signed status * - * @param User $user Object user that modify - * @param int $status Newsigned status to set (often a constant like self::STATUS_XXX) - * @param int $notrigger 1 = Does not execute triggers, 0 = Execute triggers - * @param string $triggercode Trigger code to use + * @param User $user Object user that modify + * @param int $status Newsigned status to set (often a constant like self::STATUS_XXX) + * @param int<0,1> $notrigger 1 = Does not execute triggers, 0 = Execute triggers + * @param string $triggercode Trigger code to use * @return int 0 < if KO, > 0 if OK */ public function setSignedStatus(User $user, int $status = 0, int $notrigger = 0, $triggercode = ''): int diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index aec781054b422..3fc40eb9b7714 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -831,7 +831,7 @@ } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; $expensereport->ref = $data['ref']; - print $expensereport->getNomUrl(1, 0, 0, '', 0, 0); + print $expensereport->getNomUrl(1, 0, 0, 0, 0, 0); } elseif ($data['item'] == 'SalaryPayment') { $salary_payment->id = $data['id']; $salary_payment->ref = $data['ref']; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 52ef3ce8f2405..773b840b1cd81 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -230,6 +230,7 @@ */ $form = new Form($db); +$proj = null; if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) { $formaccounting = new FormAccounting($db); } @@ -783,7 +784,7 @@ // Project if ($arrayfields['project']['checked']) { print ''; - if ($obj->fk_project > 0) { + if ($obj->fk_project > 0 && is_object($proj)) { $proj->fetch($obj->fk_project); print $proj->getNomUrl(1); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index cfe75817e6832..de576e65c83d7 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -172,7 +173,7 @@ // Set fields $dated = dol_mktime(GETPOSTINT('datedhour'), GETPOSTINT('datedmin'), GETPOSTINT('datedsec'), GETPOSTINT('datedmonth'), GETPOSTINT('datedday'), GETPOSTINT('datedyear')); $object->fetch($id); - $result = $object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY'); + $result = $object->setValueFrom('dated', $dated, '', null, 'date', '', $user, 'DEPLACEMENT_MODIFY'); if ($result < 0) { dol_print_error($db, $object->error); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e8d5b2af6a7ef..9f4446027a313 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -180,7 +180,7 @@ class Facture extends CommonInvoice */ public $module_source; /** - * @var int key of pos source ('0', '1', ...) + * @var string key of pos source ('0', '1', ...) */ public $pos_source; /** diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4bebe93f086d4..faa4c2e26d677 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2016-2018 Frédéric France * Copyright (C) 2017-2022 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,7 +64,7 @@ $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $label = GETPOST('label', 'alpha'); -$actioncode = GETPOST('actioncode'); +$actioncode = GETPOSTINT('actioncode'); $fk_user = GETPOSTINT('userid') > 0 ? GETPOSTINT('userid') : 0; // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context @@ -138,7 +139,7 @@ } if ($action == 'setlib' && $permissiontoadd) { - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -374,7 +375,7 @@ print $langs->trans("Type"); print ''; print ''; - $formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode", 'alpha') ? GETPOST("actioncode", 'alpha') : '', 'actioncode', 1); + $formsocialcontrib->select_type_socialcontrib(GETPOST('actioncode', 'alpha') ? GETPOST('actioncode', 'alpha') : '', 'actioncode', 1); print ''; print ''; @@ -463,12 +464,12 @@ // Clone confirmation if ($action === 'clone') { $formquestion = array( - array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label, 'tdclass'=>'fieldrequired'), + array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label, 'tdclass' => 'fieldrequired'), ); if (getDolGlobalString('TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX')) { $formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); } else { - $formquestion[] = array('type' => 'date', 'datenow'=>1, 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); + $formquestion[] = array('type' => 'date', 'datenow' => 1, 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); $formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100'); } @@ -587,7 +588,8 @@ print ''; print $langs->trans("Type").""; if ($action == 'edit' && $object->getSommePaiement() == 0) { - $formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode", 'alpha') ? GETPOST("actioncode", 'alpha') : $object->type, 'actioncode', 1); + $actionPostValue = GETPOSTINT('actioncode'); + $formsocialcontrib->select_type_socialcontrib($actionPostValue ? $actionPostValue : $object->type, 'actioncode', 1); } else { print $object->type_label; } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 99169e06a0246..cb464d87482be 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -65,20 +65,43 @@ class ChargeSociales extends CommonObject * @var string label */ public $label; + /** + * @var int + */ public $type; + /** + * @var string + */ public $type_label; + /** + * @var string + */ public $type_code; + /** + * @var string + */ public $type_accountancy_code; + /** + * @var int|string + */ public $amount; + /** + * @var int<0,1> + */ public $paye; /** - * @deprecated + * @deprecated Use $period + * @var int|string */ public $periode; + /** + * @var int|string + */ public $period; /** + * @var string * @deprecated Use label instead */ public $lib; @@ -102,7 +125,13 @@ class ChargeSociales extends CommonObject * @var int ID */ public $mode_reglement_id; + /** + * @var string + */ public $mode_reglement_code; + /** + * @var string + */ public $mode_reglement; /** @@ -301,7 +330,7 @@ public function delete($user) // Get bank transaction lines for this social contributions include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $account = new Account($this->db); - $lines_url = $account->get_url('', $this->id, 'sc'); + $lines_url = $account->get_url(0, $this->id, 'sc'); // Delete bank urls foreach ($lines_url as $line_url) { @@ -520,8 +549,8 @@ public function setUnpaid($user) /** * Retourne le libelle du statut d'une charge (impaye, payee) * - * @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 double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @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 float $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) * @return string Label */ public function getLibStatut($mode = 0, $alreadypaid = -1) @@ -535,7 +564,7 @@ public function getLibStatut($mode = 0, $alreadypaid = -1) * * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @param float $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) * @return string Label */ public function LibStatut($status, $mode = 0, $alreadypaid = -1) @@ -792,7 +821,7 @@ public function getKanbanView($option = '', $arraydata = null) if (property_exists($this, 'label')) { $return .= '  
'.$this->label.'
'; } - if (!empty($arraydata['project']) && $arraydata['project']->id > 0) { + if (!empty($arraydata['project']) && $arraydata['project'] instanceof Project && $arraydata['project']->id > 0) { $return .= '
'.$arraydata['project']->getNomUrl(1).''; } if (property_exists($this, 'date_ech')) { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 0666335cc4dd7..bf22354189bb4 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -6,6 +6,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,7 +91,7 @@ if ($action == 'setlib' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index e6ad49531293a..80c4c9b291a98 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ if ($action == 'setlib' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index d5687c9f25f5d..03ac361feada0 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2015-2023 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,7 +116,7 @@ if ($action == 'setlib' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index b9cf49d5dff47..cac5f7898cd03 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -7,6 +7,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Philippe Grand + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ if ($action == 'setlib' && $permissiontoadd) { $object->fetch($id); - $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index 3e02aaa8c0cf7..922c6d6dfd06b 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,7 +50,7 @@ if ($action == 'setlib' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); + $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', null, 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index a3a6ba51d34c4..c08400b749ea3 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -896,7 +896,7 @@ if (!empty($socid)) { print ''.$langs->trans("ContactByDefaultFor").''; print ''; - $contactType = $object->listeTypeContacts('external', '', 1); + $contactType = $object->listeTypeContacts('external', 0, 1); print img_picto('', 'contact', 'class="pictofixedwidth"').$form->multiselectarray('roles', $contactType, array(), 0, 0, '', 0, '90%'); print ''; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 849b1ebafb24b..5fb5b3676068b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -93,6 +93,8 @@ $object = new Contrat($db); $extrafields = new ExtraFields($db); $ret = 0; +$pu_ht = null; // Init for static analysis +$pu_ttc = null; // Init for static analysis // Load object if ($id > 0 || !empty($ref) && $action != 'add') { diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index e71f68f8ce31f..39b2826e71247 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +35,11 @@ return; } +' +@phan-var-force FormSetup $formSetup +'; + +$upload_dir = null; if ($action == 'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) { $db->begin(); diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 47fd89b165912..5caa21f0cfc26 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -98,6 +98,7 @@ $savemethod = GETPOST('savemethod', 'alpha', 2); $savemethodname = (!empty($savemethod) ? $savemethod : 'setValueFrom'); $newelement = $element; + $subelement = null; $view = ''; $format = 'text'; @@ -203,6 +204,7 @@ dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); $classname = 'Actions'.ucfirst($subelement); $object = new $classname($db); + '@phan-var-force CommonHookActions $object'; $ret = $object->$loadmethodname(); if ($ret > 0) { $loadcache = $object->$loadcachename; diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 6ecfbb387f9b9..251ced7bab9e6 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -132,7 +132,7 @@ $row_array['state_id'] = $row['state_id']; // TODO Use a cache here to avoid to make select_state in each pass (this make a SQL and lot of logs) - $row_array['states'] = $formcompany->select_state('', $row['country_id'], ''); + $row_array['states'] = $formcompany->select_state(0, $row['country_id'], ''); array_push($return_arr, $row_array); } diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 7fe6fb1451314..cf03bf06c78a0 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -65,21 +65,48 @@ class CSMSFile * @var string address to */ public $addr_to; + /** + * @var int + */ public $deferred; + /** + * @var int + */ public $priority; + /** + * @var int + */ public $class; + /** + * @var string + */ public $message; /** * @var bool */ public $nostop; + /** + * @var int + */ public $socid; + /** + * @var int + */ public $contact_id; + /** + * @var int + */ public $member_id; + /** + * @var int + */ public $fk_project; + /** + * @var int + */ public $deliveryreceipt; @@ -169,6 +196,7 @@ public function sendfile() if (class_exists($classname)) { $sms = new $classname($this->db); + '@phan-var-force OvhSms $sms'; // Using original for analysis $sms->expe = $this->addr_from; $sms->dest = $this->addr_to; diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 372e721acda81..9c49e9071b795 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2011 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,14 +44,35 @@ class Canvas */ public $errors = array(); + /** + * @var string + */ public $actiontype; + /** + * @var string Module directory + */ public $dirmodule; // Module directory + /** + * @var string + */ public $targetmodule; // Module concerned by canvas (ex: thirdparty, contact, ...) + /** + * @var string + */ public $canvas; // Name of canvas (ex: company, individual, product, service, ...) + /** + * @var string + */ public $card; // Tab (sub-canvas) - public $template_dir; // Initialized by getCanvas with templates directory + /** + * @var string Initialized by getCanvas with templates directory + */ + public $template_dir; + /** + * @var ActionsContactCardCommon|ActionsAdherentCardCommon|ActionsCardProduct|ActionsCardService|ActionsCardCommon + */ public $control; // Initialized by getCanvas with controller instance diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 56885dfe6c8cc..6fa140f2ea8eb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3676,6 +3676,7 @@ public function update_ref_ext($ref_ext) $sql = "UPDATE ".$this->db->prefix().$this->table_element; $sql .= " SET ref_ext = '".$this->db->escape($ref_ext)."'"; + // @phan-suppress-next-line PhanUndeclaredProperty $sql .= " WHERE ".(isset($this->table_rowid) ? $this->table_rowid : 'rowid')." = ".((int) $this->id); dol_syslog(get_class($this)."::update_ref_ext", LOG_DEBUG); @@ -4036,7 +4037,9 @@ public function update_price($exclspec = 0, $roundingadjust = 'auto', $nodatabas } // Add revenue stamp to total + // @phan-suppress-next-line PhanUndeclaredProperty $this->total_ttc += isset($this->revenuestamp) ? $this->revenuestamp : 0; + // @phan-suppress-next-line PhanUndeclaredProperty $this->multicurrency_total_ttc += isset($this->revenuestamp) ? ($this->revenuestamp * $multicurrency_tx) : 0; // Situations totals @@ -5472,6 +5475,7 @@ public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir //var_dump($line); if (!empty($line->date_start)) { + // @phan-suppress-next-line PhanUndeclaredProperty $date_start = $line->date_start; } else { $date_start = $line->date_debut_prevue; @@ -5480,6 +5484,7 @@ public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir } } if (!empty($line->date_end)) { + // @phan-suppress-next-line PhanUndeclaredProperty $date_end = $line->date_end; } else { $date_end = $line->date_fin_prevue; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eda9c1292e134..c1d2f0ebe5b86 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2097,7 +2097,7 @@ public function select_remises($selected, $htmlname, $filter, $socid, $maxvalue * @param int<0,1> $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int[] $exclude Array list of users id to exclude * @param int<0,1> $disabled If select list must be disabled - * @param int[]|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param int[]|''|'hierarchy'|'hierarchyme' $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me * @param int[]|int $enableonly Array list of users id to be enabled. All other must be disabled * @param string $force_entity '0' or Ids of environment to force * @return void @@ -2120,13 +2120,13 @@ public function select_users($selected = '', $htmlname = 'userid', $show_empty = * @param int<0,1>|string $show_empty 0=list with no empty value, 1=add also an empty value into list * @param int[]|null $exclude Array list of users id to exclude * @param int $disabled If select list must be disabled - * @param int[]|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me - * @param array|string $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled + * @param int[]|''|'hierarchy'|'hierarchyme' $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param int[]|'' $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled * @param string $force_entity '0' or list of Ids of environment to force, separated by a coma, or 'default' = do no extend to all entities allowed to superadmin. * @param int $maxlength Maximum length of string into list (0=no limit) * @param int<-1,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @param string $morefilter Add more filters into sql request (Example: '(employee:=:1)'). This value must not come from user input. - * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list + * @param int<0,1> $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css * @param int<0,1> $notdisabled Show only active users (note: this will also happen, whatever is this option, if USER_HIDE_INACTIVE_IN_COMBOBOX is on). diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b71662f1f8849..30d7a793f7638 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -45,9 +45,9 @@ class FormCompany extends Form /** * Return list of labels (translated) of third parties type * - * @param int $mode 0=Return id+label, 1=Return code+label - * @param string $filter Add a SQL filter to select. Data must not come from user input. - * @return array Array of types + * @param int<0,1> $mode 0=Return id+label, 1=Return code+label + * @param string $filter Add a SQL filter to select. Data must not come from user input. + * @return array Array of types */ public function typent_array($mode = 0, $filter = '') { @@ -96,9 +96,9 @@ public function typent_array($mode = 0, $filter = '') /** * Return the list of entries for staff (no translation, it is number ranges) * - * @param int $mode 0=return id+label, 1=return code+Label - * @param string $filter Add a SQL filter to select. Data must not come from user input. - * @return array Array of types d'effectifs + * @param int<0,1> $mode 0=return id+label, 1=return code+Label + * @param string $filter Add a SQL filter to select. Data must not come from user input. + * @return array Array of types d'effectifs */ public function effectif_array($mode = 0, $filter = '') { @@ -126,13 +126,14 @@ public function effectif_array($mode = 0, $filter = '') $key = $objp->code; } - $effs[$key] = $objp->label != '-' ? $objp->label : ''; + $effs[$key] = $objp->label != '-' ? (string) $objp->label : ''; $i++; } $this->db->free($resql); } //return natural sorted list natsort($effs); + '@phan-var-force array $effs'; return $effs; } @@ -642,7 +643,7 @@ public function select_juridicalstatus($selected = 0, $country_codeid = 0, $filt * @param string $var_id Name of id field * @param int $selected Pre-selected third party * @param string $htmlname Name of HTML form - * @param array $limitto Disable answers that are not id in this array list + * @param int[] $limitto Disable answers that are not id in this array list * @param int $forceid This is to force another object id than object->id * @param string $moreparam String with more param to add into url when noajax search is used. * @param string $morecss More CSS on select component @@ -768,6 +769,7 @@ function(response) { $num = $this->db->num_rows($resql); $i = 0; + $firstCompany = 0; // For static analysis if ($num) { while ($i < $num) { $obj = $this->db->fetch_object($resql); @@ -808,15 +810,15 @@ function(response) { /** * Return a select list with types of contacts * - * @param object $object Object to use to find type of contact + * @param Object $object Object to use to find type of contact * @param string $selected Default selected value * @param string $htmlname HTML select name * @param string $source Source ('internal' or 'external') * @param string $sortorder Sort criteria ('position', 'code', ...) * @param int $showempty 1=Add en empty line * @param string $morecss Add more css to select component - * @param int $output 0=return HTML, 1= direct print - * @param int $forcehidetooltip Force hide tooltip for admin + * @param int<0,1> $output 0=return HTML, 1= direct print + * @param int<0,1> $forcehidetooltip Force hide tooltip for admin * @return string|void Depending on $output param, return the HTML select list (recommended method) or nothing */ public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '', $output = 1, $forcehidetooltip = 0) @@ -825,6 +827,7 @@ public function selectTypeContact($object, $selected, $htmlname = 'type', $sourc $out = ''; if (is_object($object) && method_exists($object, 'liste_type_contact')) { + '@phan-var-force CommonObject $object'; // CommonObject has the method. $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); // List of types into c_type_contact for element=$object->element $out .= ''; } - if (array_key_exists('userauthor', $arraydata)) { + if (array_key_exists('userauthor', $arraydata) && $arraydata['userauthor'] instanceof User) { $return .= '
'.$arraydata['userauthor']->getNomUrl(-1).''; } if (property_exists($this, 'date_debut') && property_exists($this, 'date_fin')) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 64c29099b6bcf..55843f5dced41 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -59,6 +59,9 @@ class Holiday extends CommonObject */ public $fk_user; + /** + * @var int|string + */ public $date_create = ''; /** @@ -161,9 +164,19 @@ class Holiday extends CommonObject public $events = array(); public $logs = array(); + + /** + * @var string + */ public $optName = ''; + /** + * @var string + */ public $optValue = ''; - public $optRowid = ''; + /** + * @var int + */ + public $optRowid = 0; /** * Draft status @@ -204,7 +217,7 @@ public function __construct($db) * Returns the reference to the following non used Order depending on the active numbering module * defined into HOLIDAY_ADDON * - * @param Societe $objsoc third party object + * @param ?Societe $objsoc third party object * @return string Holiday free reference */ public function getNextNumRef($objsoc) @@ -1826,7 +1839,7 @@ public function getCPforUser($user_id, $fk_type = 0) * @param boolean $stringlist If true return a string list of id. If false, return an array with detail. * @param boolean $type If true, read Dolibarr user list, if false, return vacation balance list. * @param string $filters Filters. Warning: This must not contains data from user input. - * @return array{rowid:int,id:int,name:string,lastname:string,firstname:string,gender:string,status:string,employee:string,photo:string,fk_user:int,type?:int,nb_holiday?:int}|string|int<-1,-1> Return an array + * @return array|string|int<-1,-1> Return an array */ public function fetchUsers($stringlist = true, $type = true, $filters = '') { @@ -2037,7 +2050,7 @@ public function fetchUsers($stringlist = true, $type = true, $filters = '') * Return list of people with permission to validate leave requests. * Search for permission "approve leave requests" * - * @return array|int Array of user ids or -1 if error + * @return int[]|int<-1,-1> Array of user ids or -1 if error */ public function fetch_users_approver_holiday() { @@ -2266,9 +2279,9 @@ public function fetchLog($order, $filter) /** * Return array with list of types * - * @param int $active Status of type. -1 = Both - * @param int $affect Filter on affect (a request will change sold or not). -1 = Both - * @return array Return array with list of types + * @param int $active Status of type. -1 = Both + * @param int $affect Filter on affect (a request will change sold or not). -1 = Both + * @return array Return array with list of types */ public function getTypes($active = -1, $affect = -1) { diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index ce154f4af629e..48a2d5eb40505 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Regis Houssin * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -264,7 +265,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($massaction == 'preincreaseholiday') { - $langs->load("holiday", "hrm"); + $langs->loadLangs(array("holiday", "hrm")); require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $staticholiday = new Holiday($db); $arraytypeholidays = $staticholiday->getTypes(1, 1); @@ -364,7 +365,7 @@ // Supervisor if (!empty($arrayfields['cp.fk_user']['checked'])) { print ''; - print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, null, null, 0, 0, 0, '', 0, '', 'maxwidth150'); + print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, array(), '', 0, 0, 0, '', 0, '', 'maxwidth150'); print ''; } // Type of leave request diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 24a10de6b564e..2dd003cc735d5 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -214,7 +214,7 @@ $invoice = new Facture($db); $invoice->date = $now; $invoice->module_source = 'takepos'; - $invoice->pos_source = 1; + $invoice->pos_source = '1'; // Info $htmltooltip = '';