diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index a68cbf3f9bd..ca00204a986 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -3220,11 +3220,6 @@ parameters: count: 1 path: ../../htdocs/comm/action/class/api_agendaevents.class.php - - - message: "#^Property AgendaEvents\\:\\:\\$FIELDS type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/comm/action/class/api_agendaevents.class.php - - message: "#^Left side of && is always true\\.$#" count: 1 @@ -5042,12 +5037,7 @@ parameters: - message: "#^Variable \\$i might not be defined\\.$#" - count: 6 - path: ../../htdocs/compta/facture/card.php - - - - message: "#^Variable \\$lines might not be defined\\.$#" - count: 2 + count: 4 path: ../../htdocs/compta/facture/card.php - @@ -8645,11 +8635,6 @@ parameters: count: 1 path: ../../htdocs/core/class/commondocgenerator.class.php - - - message: "#^Property CommonHookActions\\:\\:\\$results type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/class/commonhookactions.class.php - - message: "#^If condition is always true\\.$#" count: 3 @@ -11485,11 +11470,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/mailings/modules_mailings.php - - - message: "#^Property MailingTargets\\:\\:\\$errors type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/mailings/modules_mailings.php - - message: "#^Property MailingTargets\\:\\:\\$evenunsubscribe has no type specified\\.$#" count: 1 @@ -11815,31 +11795,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/payment/mod_payment_cicada.php - - - message: "#^Method PrintingDriver\\:\\:getlistAvailablePrinters\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/printing/modules_printing.php - - - - message: "#^Method printing_printgcp\\:\\:getlistAvailablePrinters\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/printing/printgcp.modules.php - - - - message: "#^Method printing_printgcp\\:\\:sendPrintToPrinter\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/printing/printgcp.modules.php - - - - message: "#^Property printing_printgcp\\:\\:\\$OAUTH_SERVICENAME_GOOGLE has no type specified\\.$#" - count: 1 - path: ../../htdocs/core/modules/printing/printgcp.modules.php - - - - message: "#^Property printing_printgcp\\:\\:\\$conf type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/printing/printgcp.modules.php - - message: "#^Variable \\$response might not be defined\\.$#" count: 2 @@ -12975,31 +12930,11 @@ parameters: count: 1 path: ../../htdocs/core/tpl/document_actions_post_headers.tpl.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - - - message: "#^Variable \\$extrafields might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - message: "#^Variable \\$hookmanager might not be defined\\.$#" count: 2 path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 4 - path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - message: "#^Variable \\$extrafields might not be defined\\.$#" count: 1 @@ -13010,11 +12945,6 @@ parameters: count: 2 path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 1 @@ -13495,11 +13425,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/originproductline.tpl.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - message: "#^Variable \\$db might not be defined\\.$#" count: 1 @@ -13522,7 +13447,7 @@ parameters: - message: "#^Variable \\$langs might not be defined\\.$#" - count: 12 + count: 10 path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - @@ -13530,11 +13455,6 @@ parameters: count: 2 path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - message: "#^Variable \\$title might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - message: "#^Variable \\$urllogo might not be defined\\.$#" count: 1 @@ -13600,11 +13520,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - message: "#^Variable \\$title might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - message: "#^Variable \\$urllogo might not be defined\\.$#" count: 1 @@ -13715,6 +13630,26 @@ parameters: count: 1 path: ../../htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php + - + message: "#^Right side of \\|\\| is always true\\.$#" + count: 1 + path: ../../htdocs/core/upload_page.php + + - + message: "#^Variable \\$accept in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: ../../htdocs/core/upload_page.php + + - + message: "#^Variable \\$capture in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: ../../htdocs/core/upload_page.php + + - + message: "#^Variable \\$perm in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: ../../htdocs/core/upload_page.php + - message: "#^Variable \\$conf might not be defined\\.$#" count: 3 @@ -13975,26 +13910,11 @@ parameters: count: 1 path: ../../htdocs/debugbar/class/DataCollector/DolMemoryCollector.php - - - message: "#^Method PhpCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolPhpCollector.php - - - - message: "#^Method PhpCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolPhpCollector.php - - message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, array\\{\\$this\\(PhpCollector\\), 'errorHandler'\\} given\\.$#" count: 1 path: ../../htdocs/debugbar/class/DataCollector/DolPhpCollector.php - - - message: "#^Property PhpCollector\\:\\:\\$messages type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolPhpCollector.php - - message: "#^Method DolQueryCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -14240,26 +14160,6 @@ parameters: count: 3 path: ../../htdocs/don/class/paymentdonation.class.php - - - message: "#^Property PaymentDonation\\:\\:\\$bank_account has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - - - message: "#^Property PaymentDonation\\:\\:\\$bank_line has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - - - message: "#^Property PaymentDonation\\:\\:\\$chid has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - - - message: "#^Property PaymentDonation\\:\\:\\$datepaid has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - message: "#^Property PaymentDonation\\:\\:\\$fk_bank \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 3 @@ -14290,31 +14190,11 @@ parameters: count: 3 path: ../../htdocs/don/class/paymentdonation.class.php - - - message: "#^Property PaymentDonation\\:\\:\\$total has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - - - message: "#^Property PaymentDonation\\:\\:\\$type_code has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - - - message: "#^Property PaymentDonation\\:\\:\\$type_label has no type specified\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - message: "#^Result of && is always true\\.$#" count: 2 path: ../../htdocs/don/class/paymentdonation.class.php - - - message: "#^Variable \\$amount might not be defined\\.$#" - count: 1 - path: ../../htdocs/don/class/paymentdonation.class.php - - message: "#^Variable \\$maxlength might not be defined\\.$#" count: 1 @@ -14435,46 +14315,6 @@ parameters: count: 1 path: ../../htdocs/don/tpl/linkedobjectblock.tpl.php - - - message: "#^Method EcmDirectory\\:\\:get_full_arbo\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Property EcmDirectory\\:\\:\\$cats type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Property EcmDirectory\\:\\:\\$forbiddenchars type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Property EcmDirectory\\:\\:\\$forbiddencharsdir type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Property EcmDirectory\\:\\:\\$motherof type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Variable \\$file might not be defined\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Variable \\$relativepath might not be defined\\.$#" - count: 2 - path: ../../htdocs/ecm/class/ecmdirectory.class.php - - - - message: "#^Method EcmFiles\\:\\:fetchAll\\(\\) has parameter \\$filter with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - message: "#^Property EcmFiles\\:\\:\\$acl \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 4 @@ -14575,76 +14415,6 @@ parameters: count: 4 path: ../../htdocs/ecm/class/ecmfiles.class.php - - - message: "#^Property EcmFilesLine\\:\\:\\$acl has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$cover has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$date_c has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$date_m has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$extraparams has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$filename has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$filepath has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$fullpath_orig has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$gen_or_uploaded has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$keywords has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$position has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$src_object_id has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Property EcmFilesLine\\:\\:\\$src_object_type has no type specified\\.$#" - count: 1 - path: ../../htdocs/ecm/class/ecmfiles.class.php - - - - message: "#^Method FormEcm\\:\\:selectAllSections\\(\\) has parameter \\$ids_to_ignore with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/ecm/class/htmlecm.form.class.php - - message: "#^Right side of && is always true\\.$#" count: 1 @@ -20775,11 +20545,6 @@ parameters: count: 1 path: ../../htdocs/product/composition/card.php - - - message: "#^Variable \\$resql might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/composition/card.php - - message: "#^If condition is always true\\.$#" count: 1 @@ -20810,31 +20575,16 @@ parameters: count: 4 path: ../../htdocs/product/dynamic_price/class/price_expression.class.php - - - message: "#^Method PriceGlobalVariable\\:\\:listGlobalVariables\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/dynamic_price/class/price_global_variable.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 path: ../../htdocs/product/dynamic_price/class/price_global_variable.class.php - - - message: "#^Property PriceGlobalVariable\\:\\:\\$code has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/dynamic_price/class/price_global_variable.class.php - - message: "#^Property PriceGlobalVariable\\:\\:\\$description \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 3 path: ../../htdocs/product/dynamic_price/class/price_global_variable.class.php - - - message: "#^Property PriceGlobalVariable\\:\\:\\$value has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/dynamic_price/class/price_global_variable.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 @@ -20880,51 +20630,6 @@ parameters: count: 1 path: ../../htdocs/product/inventory/card.php - - - message: "#^Method Inventory\\:\\:getChildWarehouse\\(\\) has parameter \\$TChildWarehouse with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property Inventory\\:\\:\\$date_inventory has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property Inventory\\:\\:\\$title has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$batch has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$datec has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$fk_inventory has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$fk_warehouse has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$pmp_expected has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - - - message: "#^Property InventoryLine\\:\\:\\$pmp_real has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/inventory/class/inventory.class.php - - message: "#^Variable \\$error in empty\\(\\) always exists and is always falsy\\.$#" count: 1 @@ -21280,81 +20985,16 @@ parameters: count: 1 path: ../../htdocs/product/stock/class/api_warehouses.class.php - - - message: "#^Method Entrepot\\:\\:list_array\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/entrepot.class.php - - - - message: "#^Method Entrepot\\:\\:nb_different_products\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/entrepot.class.php - - - - message: "#^Method Entrepot\\:\\:nb_products\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/entrepot.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 2 path: ../../htdocs/product/stock/class/entrepot.class.php - - - message: "#^Method MouvementStock\\:\\:createBatch\\(\\) has parameter \\$dluo with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Property MouvementStock\\:\\:\\$line_id_object_origin has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Property MouvementStock\\:\\:\\$line_id_object_src has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Property MouvementStock\\:\\:\\$line_id_oject_origin has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Property MouvementStock\\:\\:\\$line_id_oject_src has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Property MouvementStock\\:\\:\\$price has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - message: "#^Variable \\$fk_product_stock might not be defined\\.$#" count: 2 path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - message: "#^Variable \\$vbatchnumber might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Variable \\$vfk_product_stock might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/mouvementstock.class.php - - - - message: "#^Method Productlot\\:\\:checkSellOrEatByMandatoryFromProductAndDates\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Method Productlot\\:\\:checkSellOrEatByMandatoryFromProductIdAndDates\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 @@ -21365,11 +21005,6 @@ parameters: count: 4 path: ../../htdocs/product/stock/class/productlot.class.php - - - message: "#^Property Productlot\\:\\:\\$datec has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - message: "#^Property Productlot\\:\\:\\$eatby \\(int\\|string\\) in isset\\(\\) is not nullable\\.$#" count: 2 @@ -21405,21 +21040,11 @@ parameters: count: 4 path: ../../htdocs/product/stock/class/productlot.class.php - - - message: "#^Property Productlot\\:\\:\\$lifetime has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - message: "#^Property Productlot\\:\\:\\$manufacturing_date \\(int\\|string\\) in isset\\(\\) is not nullable\\.$#" count: 2 path: ../../htdocs/product/stock/class/productlot.class.php - - - message: "#^Property Productlot\\:\\:\\$qc_frequency has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - message: "#^Property Productlot\\:\\:\\$scrapping_date \\(int\\|string\\) in isset\\(\\) is not nullable\\.$#" count: 2 @@ -21430,51 +21055,11 @@ parameters: count: 2 path: ../../htdocs/product/stock/class/productlot.class.php - - - message: "#^Property Productlot\\:\\:\\$stats_bom has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Property Productlot\\:\\:\\$stats_facture_fournisseur has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Property Productlot\\:\\:\\$stats_facturerec has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Property Productlot\\:\\:\\$stats_mrptoconsume has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Property Productlot\\:\\:\\$stats_mrptoproduce has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productlot.class.php - - - - message: "#^Method ProductStockEntrepot\\:\\:fetchAll\\(\\) has parameter \\$filter with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - - - message: "#^Method ProductStockEntrepot\\:\\:fetchAll\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - - message: "#^Property ProductStockEntrepot\\:\\:\\$desiredstock has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - message: "#^Property ProductStockEntrepot\\:\\:\\$fk_entrepot \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 4 @@ -21490,11 +21075,6 @@ parameters: count: 4 path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - - message: "#^Property ProductStockEntrepot\\:\\:\\$seuil_stock_alerte has no type specified\\.$#" - count: 1 - path: ../../htdocs/product/stock/class/productstockentrepot.class.php - - message: "#^Variable \\$action might not be defined\\.$#" count: 2 @@ -22095,31 +21675,11 @@ parameters: count: 1 path: ../../htdocs/product/stock/stocktransfer/stocktransfer_list.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - message: "#^Variable \\$extrafields might not be defined\\.$#" count: 1 path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - - - message: "#^Left side of && is always true\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - message: "#^Parameter \\#4 \\$month of function dol_mktime expects int, array\\|string given\\.$#" count: 2 @@ -22140,66 +21700,16 @@ parameters: count: 2 path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - message: "#^Variable \\$backtopage might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 3 path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - message: "#^Variable \\$formproduct might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: "#^Variable \\$formproject might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 19 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: "#^Variable \\$backtopage might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 3 path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - - message: "#^Variable \\$formproduct might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 14 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 12 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 9 @@ -22470,56 +21980,11 @@ parameters: count: 1 path: ../../htdocs/projet/class/project.class.php - - - message: "#^Method ProjectStats\\:\\:getAllProjectByStatus\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Method ProjectStats\\:\\:getTransformRateByMonthWithPrevYear\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Method ProjectStats\\:\\:getWeightedAmountByMonthWithPrevYear\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Property ProjectStats\\:\\:\\$opp_status has no type specified\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Property ProjectStats\\:\\:\\$project has no type specified\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Property ProjectStats\\:\\:\\$socid has no type specified\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Property ProjectStats\\:\\:\\$status has no type specified\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - - - message: "#^Property ProjectStats\\:\\:\\$userid has no type specified\\.$#" - count: 1 - path: ../../htdocs/projet/class/projectstats.class.php - - message: "#^Ternary operator condition is always false\\.$#" count: 1 path: ../../htdocs/projet/class/projectstats.class.php - - - message: "#^Variable \\$filedate might not be defined\\.$#" - count: 2 - path: ../../htdocs/projet/class/projectstats.class.php - - message: "#^Left side of \\|\\| is always false\\.$#" count: 1 @@ -22590,16 +22055,6 @@ parameters: count: 2 path: ../../htdocs/projet/class/task.class.php - - - message: "#^Method TaskStats\\:\\:getAllTaskByStatus\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/projet/class/taskstats.class.php - - - - message: "#^Method TaskStats\\:\\:getAverageByMonth\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/projet/class/taskstats.class.php - - message: "#^Variable \\$mode might not be defined\\.$#" count: 1 @@ -22685,16 +22140,6 @@ parameters: count: 1 path: ../../htdocs/projet/ganttchart.inc.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/ganttchart.inc.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/projet/ganttchart.inc.php - - message: "#^Variable \\$task_dependencies might not be defined\\.$#" count: 2 @@ -22705,11 +22150,6 @@ parameters: count: 5 path: ../../htdocs/projet/ganttchart.inc.php - - - message: "#^Variable \\$arrayofjs might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/ganttview.php - - message: "#^Variable \\$param might not be defined\\.$#" count: 1 @@ -22725,51 +22165,11 @@ parameters: count: 1 path: ../../htdocs/projet/graph_opportunities.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 5 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 7 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$form might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 11 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$listofoppstatus might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/graph_opportunities.inc.php - - message: "#^Variable \\$mine might not be defined\\.$#" count: 1 path: ../../htdocs/projet/graph_opportunities.inc.php - - - message: "#^Variable \\$projectsListId might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$socid might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/graph_opportunities.inc.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/graph_opportunities.inc.php - - message: "#^Comparison operation \"\\>\" between 0 and 0 is always false\\.$#" count: 1 @@ -24935,11 +24335,6 @@ parameters: count: 2 path: ../../htdocs/resource/class/dolresource.class.php - - - message: "#^Property Dolresource\\:\\:\\$objelement has no type specified\\.$#" - count: 1 - path: ../../htdocs/resource/class/dolresource.class.php - - message: "#^Property Dolresource\\:\\:\\$resource_id \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -24955,11 +24350,6 @@ parameters: count: 2 path: ../../htdocs/resource/class/dolresource.class.php - - - message: "#^Property Dolresource\\:\\:\\$type_label has no type specified\\.$#" - count: 1 - path: ../../htdocs/resource/class/dolresource.class.php - - message: "#^Property Dolresource\\:\\:\\$url \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 2 @@ -24980,36 +24370,6 @@ parameters: count: 1 path: ../../htdocs/resource/class/html.formresource.class.php - - - message: "#^Method FormResource\\:\\:select_resource_list\\(\\) has parameter \\$event with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - - - message: "#^Method FormResource\\:\\:select_resource_list\\(\\) has parameter \\$filter with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - - - message: "#^Method FormResource\\:\\:select_resource_list\\(\\) has parameter \\$filterkey with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - - - message: "#^Method FormResource\\:\\:select_resource_list\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - - - message: "#^Property FormResource\\:\\:\\$param has no type specified\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - - - message: "#^Property FormResource\\:\\:\\$substit has no type specified\\.$#" - count: 1 - path: ../../htdocs/resource/class/html.formresource.class.php - - message: "#^If condition is always false\\.$#" count: 2 @@ -25120,11 +24480,6 @@ parameters: count: 3 path: ../../htdocs/salaries/class/paymentsalary.class.php - - - message: "#^Property PaymentSalary\\:\\:\\$amounts type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/salaries/class/paymentsalary.class.php - - message: "#^Property PaymentSalary\\:\\:\\$fk_bank \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 3 @@ -25425,36 +24780,11 @@ parameters: count: 1 path: ../../htdocs/societe/checkvat/checkVatPopup.php - - - message: "#^Method Contacts\\:\\:createUser\\(\\) has parameter \\$request_data with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/societe/class/api_contacts.class.php - - - - message: "#^Method Contacts\\:\\:delete\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/societe/class/api_contacts.class.php - - - - message: "#^Method Contacts\\:\\:post\\(\\) has parameter \\$request_data with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/societe/class/api_contacts.class.php - - - - message: "#^Method Contacts\\:\\:put\\(\\) has parameter \\$request_data with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/societe/class/api_contacts.class.php - - message: "#^Property Contact\\:\\:\\$no_email \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 2 path: ../../htdocs/societe/class/api_contacts.class.php - - - message: "#^Property Contacts\\:\\:\\$FIELDS type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/societe/class/api_contacts.class.php - - message: "#^If condition is always true\\.$#" count: 2 @@ -25690,51 +25020,6 @@ parameters: count: 1 path: ../../htdocs/societe/class/societe.class.php - - - message: "#^Property SocieteAccount\\:\\:\\$date_last_reset_password has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$date_previous_login has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$key_account has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$login has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$pass_crypted has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$pass_encoding has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$pass_temp has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$site has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - - - message: "#^Property SocieteAccount\\:\\:\\$site_account has no type specified\\.$#" - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - message: "#^If condition is always false\\.$#" count: 1 @@ -26710,26 +25995,6 @@ parameters: count: 1 path: ../../htdocs/ticket/card.php - - - message: "#^Property ActionsTicket\\:\\:\\$errno has no type specified\\.$#" - count: 1 - path: ../../htdocs/ticket/class/actions_ticket.class.php - - - - message: "#^Property ActionsTicket\\:\\:\\$mesg has no type specified\\.$#" - count: 1 - path: ../../htdocs/ticket/class/actions_ticket.class.php - - - - message: "#^Property ActionsTicket\\:\\:\\$template has no type specified\\.$#" - count: 1 - path: ../../htdocs/ticket/class/actions_ticket.class.php - - - - message: "#^Property ActionsTicket\\:\\:\\$template_dir has no type specified\\.$#" - count: 1 - path: ../../htdocs/ticket/class/actions_ticket.class.php - - message: "#^Method Tickets\\:\\:_validate\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 @@ -27155,21 +26420,6 @@ parameters: count: 1 path: ../../htdocs/user/class/userbankaccount.class.php - - - message: "#^Method UserGroup\\:\\:_load_ldap_dn\\(\\) has parameter \\$info with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/user/class/usergroup.class.php - - - - message: "#^Method UserGroup\\:\\:_load_ldap_info\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/user/class/usergroup.class.php - - - - message: "#^Method UserGroup\\:\\:generateDocument\\(\\) has parameter \\$moreparams with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/user/class/usergroup.class.php - - message: "#^Property CommonObject\\:\\:\\$lastname \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -27345,11 +26595,6 @@ parameters: count: 1 path: ../../htdocs/variants/class/ProductAttribute.class.php - - - message: "#^Method ProductAttribute\\:\\:attributesAjaxOrder\\(\\) has parameter \\$rows with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/variants/class/ProductAttribute.class.php - - message: "#^Variable \\$url in empty\\(\\) always exists and is not falsy\\.$#" count: 2 @@ -27575,36 +26820,6 @@ parameters: count: 1 path: ../../htdocs/webportal/class/context.class.php - - - message: "#^Method Context\\:\\:getControllerUrl\\(\\) has parameter \\$moreParams with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/context.class.php - - - - message: "#^Method Context\\:\\:getPublicControllerUrl\\(\\) has parameter \\$Tparams with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/context.class.php - - - - message: "#^Method Context\\:\\:getPublicControllerUrl\\(\\) has parameter \\$moreParams with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/context.class.php - - - - message: "#^Method Context\\:\\:getRootUrl\\(\\) has parameter \\$moreParams with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/context.class.php - - - - message: "#^Method Controller\\:\\:hookDoAction\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/controller.class.php - - - - message: "#^Method Controller\\:\\:hookPrintPageView\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/controller.class.php - - message: "#^Result of && is always false\\.$#" count: 1 @@ -27630,36 +26845,11 @@ parameters: count: 1 path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - - message: "#^Property FormListWebPortal\\:\\:\\$arrayfields type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - - - message: "#^Property FormListWebPortal\\:\\:\\$companyStaticList type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - - - message: "#^Property FormListWebPortal\\:\\:\\$search type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - message: "#^Result of && is always false\\.$#" count: 1 path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - - message: "#^Variable \\$nbpages might not be defined\\.$#" - count: 1 - path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - - - message: "#^Variable \\$remaintopay might not be defined\\.$#" - count: 1 - path: ../../htdocs/webportal/class/html.formlistwebportal.class.php - - message: "#^Parameter \\#3 \\$preselectedvalue of method FormWebPortal\\:\\:selectForForms\\(\\) expects int, array\\|string given\\.$#" count: 1 @@ -28220,16 +27410,6 @@ parameters: count: 1 path: ../../htdocs/workstation/class/workstation.class.php - - - message: "#^Method WorkstationResource\\:\\:getAllResourcesOfWorkstation\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/workstation/class/workstationresource.class.php - - - - message: "#^Method WorkstationUserGroup\\:\\:getAllGroupsOfWorkstation\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/workstation/class/workstationusergroup.class.php - - message: "#^Property Workstation\\:\\:\\$status \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 1 diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 985dc297ff5..5ca02d5529c 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -13,20 +13,20 @@ return [ // PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanTypeMismatchArgumentProbablyReal : 320+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 210+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences // PhanTypeMismatchProperty : 160+ occurrences - // PhanPluginUnknownArrayMethodParamType : 130+ occurrences // PhanPluginUnknownPropertyType : 130+ occurrences + // PhanPluginUnknownArrayMethodParamType : 120+ occurrences // PhanPossiblyUndeclaredVariable : 110+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences // PhanTypeMismatchArgumentNullableInternal : 50+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences + // PhanTypeMismatchDimFetch : 40+ occurrences // PhanPluginEmptyStatementIf : 35+ occurrences // PhanPluginUnknownArrayFunctionParamType : 35+ occurrences // PhanPluginUnknownArrayFunctionReturnType : 30+ occurrences // PhanTypeInvalidDimOffset : 30+ occurrences - // PhanTypeMismatchDimFetch : 30+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanEmptyForeach : 10+ occurrences // PhanPluginUnknownObjectMethodCall : 10+ occurrences @@ -39,6 +39,7 @@ return [ // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanParamTooMany : 5 occurrences // PhanPossiblyNullTypeMismatchProperty : 5 occurrences + // PhanTypeMismatchReturn : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences @@ -47,10 +48,7 @@ return [ // PhanTypeMismatchDimAssignment : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanParamTooFew : 1 occurrence - // PhanPluginRedundantReturnComment : 1 occurrence // PhanTypeConversionFromArray : 1 occurrence - // PhanTypeMismatchArgumentReal : 1 occurrence - // PhanTypeMismatchReturn : 1 occurrence // PhanTypeSuspiciousStringExpression : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions @@ -258,7 +256,7 @@ return [ 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/smtps.class.php' => ['PhanTypeConversionFromArray'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginRedundantReturnComment', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], + 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], 'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/db/sqlite3.class.php' => ['PhanTypeMismatchReturn'], 'htdocs/core/extrafieldsinimport.inc.php' => ['PhanTypeMismatchArgumentNullableInternal'], @@ -287,8 +285,8 @@ return [ 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -296,7 +294,6 @@ return [ 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], @@ -308,7 +305,7 @@ return [ 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'], @@ -330,8 +327,8 @@ return [ 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], - 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], @@ -362,13 +359,8 @@ return [ 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'], 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp'], 'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/debugbar/class/DataCollector/DolibarrCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanTypeMismatchReturn'], + 'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanTypeMismatchReturn'], 'htdocs/delivery/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], @@ -709,7 +701,7 @@ return [ 'htdocs/webservices/server_supplier_invoice.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_thirdparty.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_user.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], - 'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/website/class/website.class.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'], diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d966f785303..bb2dcaf25dd 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -912,6 +912,9 @@ abstract class CommonDocGenerator array('line_date_start', 'date_start', 'day', 'auto', null), array('line_date_start_locale', 'date_start', 'day', 'tzserver', $outputlangs), array('line_date_start_rfc', 'date_start', 'dayrfc', 'auto', null), + array('line_date_start_real', 'date_start_real', 'day', 'auto', null), + array('line_date_start_real_locale', 'date_start_real', 'day', 'tzserver', $outputlangs), + array('line_date_start_real_rfc', 'date_start_real', 'dayrfc', 'auto', null), array('line_date_end', 'date_end', 'day', 'auto', null), array('line_date_end_locale', 'date_end', 'day', 'tzserver', $outputlangs), array('line_date_end_rfc', 'date_end', 'dayrfc', 'auto', null) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index fdc2db376a9..54866caf71c 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -349,7 +349,7 @@ function getDefaultDatesForTransfer() * @param Conf $conf Config * @param ?int $from_time [=null] Get current time or set time to find fiscal period * @param 'tzserver'|'gmt' $gm 'gmt' => we return GMT timestamp (recommended), 'tzserver' => we return in the PHP server timezone - * @param int $withenddateonly Do not return period if and date is not defined + * @param int $withenddateonly Do not return period if end date is not defined * @return array{date_start:int,date_end:int} Period of fiscal year : [date_start, date_end] */ function getCurrentPeriodOfFiscalYear($db, $conf, $from_time = null, $gm = 'tzserver', $withenddateonly = 1) @@ -358,6 +358,8 @@ function getCurrentPeriodOfFiscalYear($db, $conf, $from_time = null, $gm = 'tzse $now_arr = dol_getdate($now); if ($from_time === null) { $from_time = $now; + } else { + $now_arr = dol_getdate($from_time); } include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 278b782ed4a..878c4fdfa50 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1024,7 +1024,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', */ function num_between_day($timestampStart, $timestampEnd, $lastday = 0) { - if ($timestampStart < $timestampEnd) { + if ($timestampStart <= $timestampEnd) { if ($lastday == 1) { $bit = 0; } else { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ed77ac897d1..20d3eaa1d37 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12897,7 +12897,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u * @param string $elementType Element type (Value of $object->element or value of $object->element@$object->module). Example: * 'action', 'facture', 'project', 'project_task' or * 'myobject@mymodule' (or old syntax 'mymodule_myobject' like 'project_task') - * @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string,dir_temp:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>, 'dir_temp'=>) + * @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string,dir_temp:string,parent_element:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>, 'dir_temp'=>) * @see fetchObjectByElement(), getMultidirOutput() */ function getElementProperties($elementType) diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 124b0889085..27a295e61e4 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -233,7 +233,7 @@ class doc_generic_contract_odt extends ModelePDFContract $outputlangs->charset_output = 'UTF-8'; // Load translation files required by page - $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); + $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "deliveries")); if ($conf->contract->multidir_output[$object->entity]) { // If $object is id instead of object diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 533ea70e3cd..85f85c194a0 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -96,7 +96,7 @@ class pdf_octopus extends ModelePDFFactures public $heightforfooter; /** - * @var int tab_top + * @var float tab_top */ public $tab_top; @@ -130,7 +130,7 @@ class pdf_octopus extends ModelePDFFactures /** * Situation invoices * - * @var array{derniere_situation:Facture,date_derniere_situation:int,current:array} Data of situation + * @var array{derniere_situation?:Facture,date_derniere_situation?:int,cumul_anterieur:array<'HT'|'HTnet'|'retenue_garantie'|'total_a_payer'|'travaux_sup'|'TTC'|'TVA'|int,mixed>,current:array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int},nouveau_cumul:array} */ public $TDataSituation; @@ -1958,10 +1958,10 @@ class pdf_octopus extends ModelePDFFactures * @param int $tab_height Height of table (rectangle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array + * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom bar of array * @param string $currency Currency code - * @param Translate $outputlangsbis Langs object bis + * @param ?Translate $outputlangsbis Langs object bis * @return void */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null) @@ -2052,10 +2052,10 @@ class pdf_octopus extends ModelePDFFactures * * @param TCPDI|TCPDF $pdf Object PDF * @param Facture $object Object to show - * @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages) + * @param int<0,1> $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages) * @param Translate $outputlangs Object lang for output - * @param Translate $outputlangsbis Object lang for output bis - * @return array top shift of linked object lines + * @param ?Translate $outputlangsbis Object lang for output bis + * @return array{top_shift:float,shipp_shift:float} Top shift of linked object lines */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) { @@ -2755,8 +2755,8 @@ class pdf_octopus extends ModelePDFFactures * @param int $tab_height Height of table (rectangle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array + * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom bar of array * @param string $currency Currency code * @return void */ @@ -2980,7 +2980,7 @@ class pdf_octopus extends ModelePDFFactures * * @param Facture $object Facture * - * @return array + * @return array{derniere_situation?:Facture,date_derniere_situation?:int,cumul_anterieur:array<'HT'|'HTnet'|'retenue_garantie'|'total_a_payer'|'travaux_sup'|'TTC'|'TVA'|int,mixed>,current:array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int},nouveau_cumul:array} * * Details of returned table * @@ -3101,7 +3101,8 @@ class pdf_octopus extends ModelePDFFactures foreach ($TDiffKey as $i) { if (empty($object->lines[$i]->fk_prev_id)) { - $TDataSituation['nouveau_cumul']['travaux_sup'] += $object->lines[$i]->total_ht; + // Next line is useless because 'nouveau_cumul' is overwritten below + // $TDataSituation['nouveau_cumul']['travaux_sup'] += $object->lines[$i]->total_ht; $TDataSituation['current']['travaux_sup'] += $object->lines[$i]->total_ht; } } @@ -3116,10 +3117,10 @@ class pdf_octopus extends ModelePDFFactures /** * Calculates the sum of two arrays, key by key, taking into account nested arrays * - * @param array $a [$a description] - * @param array $b [$b description] + * @param array $a [$a description] + * @param array $b [$b description] * - * @return array [return description] + * @return array [return description] */ public function sumSituation($a, $b) { @@ -3231,8 +3232,8 @@ class pdf_octopus extends ModelePDFFactures * @param float $y Ordinate of first point * @param float $l ?? * @param float $h ?? - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom + * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom * @return void */ /* @@ -3257,8 +3258,8 @@ class pdf_octopus extends ModelePDFFactures * @param float $w Width of the rectangle * @param float $h Height of the rectangle * @param float $r Corner radius (can be an array for different radii per corner) - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom + * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom * @param string $style Draw style (e.g. 'D' for draw, 'F' for fill, 'DF' for both) * @return void */ @@ -3279,10 +3280,10 @@ class pdf_octopus extends ModelePDFFactures /** * Get data about invoice * - * @param int $id invoice id - * @param boolean $forceReadFromDB set to true if you want to force refresh data from SQL + * @param int $id invoice id + * @param bool $forceReadFromDB set to true if you want to force refresh data from SQL * - * @return array [return description] + * @return array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int} */ public function btpGetInvoiceAmounts($id, $forceReadFromDB = false) { @@ -3346,9 +3347,11 @@ class pdf_octopus extends ModelePDFFactures $ret['retenue_garantie'] = $retenue_garantie; //Clean up before keep in "cache" - unset($ret['derniere_situation']->db); - unset($ret['derniere_situation']->fields); - unset($ret['derniere_situation']->lines); + if (array_key_exists('derniere_situation', $ret)) { + unset($ret['derniere_situation']->db); + unset($ret['derniere_situation']->fields); + unset($ret['derniere_situation']->lines); + } // print "

Store to cache $id : " . json_encode($_cache_btpProrataGetInvoiceAmounts[$id]) . "

"; return $ret; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 30c39d94fb1..4d97c877705 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -94,12 +94,12 @@ class pdf_sponge extends ModelePDFFactures public $heightforfooter; /** - * @var int tab_top + * @var float tab_top */ public $tab_top; /** - * @var int tab_top_newpage + * @var float tab_top_newpage */ public $tab_top_newpage; @@ -2066,10 +2066,10 @@ class pdf_sponge extends ModelePDFFactures * @param float|int $tab_height Height of table (rectangle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array + * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom bar of array * @param string $currency Currency code - * @param Translate $outputlangsbis Langs object bis + * @param ?Translate $outputlangsbis Langs object bis * @return void */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null) @@ -2133,8 +2133,8 @@ class pdf_sponge extends ModelePDFFactures * @param Facture $object Object to show * @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages) * @param Translate $outputlangs Object lang for output - * @param Translate $outputlangsbis Object lang for output bis - * @return array top shift of linked object lines + * @param ?Translate $outputlangsbis Object lang for output bis + * @return array{top_shift:float,shipp_shift:float} Top shift of linked object lines */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) { diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 9546c9953d4..e7903ba6b36 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -98,12 +98,12 @@ class mailing_advthirdparties extends MailingTargets if (!array_key_exists($obj->email, $cibles)) { $cibles[$obj->email] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'name' => $obj->name, 'firstname' => $obj->firstname, 'other' => '', 'source_url' => $this->url($obj->id, 'thirdparty'), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'thirdparty' ); } @@ -151,12 +151,12 @@ class mailing_advthirdparties extends MailingTargets if (!array_key_exists($obj->email, $cibles)) { $cibles[$obj->email] = array( 'email' => $obj->email, - 'fk_contact' => $obj->id, + 'fk_contact' => (int) $obj->id, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'other' => '', 'source_url' => $this->url($obj->id, 'contact'), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'contact' ); } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 10acc659212..00229230540 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -458,7 +458,7 @@ class mailing_contacts1 extends MailingTargets if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'other' => @@ -466,7 +466,7 @@ class mailing_contacts1 extends MailingTargets ($langs->transnoentities("UserTitle").'='.($obj->civility_id ? $langs->transnoentities("Civility".$obj->civility_id) : '')).';'. ($langs->transnoentities("PostOrFunction").'='.$obj->jobposition), 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'contact' ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php index 12a0562ae5d..444b8e8402b 100644 --- a/htdocs/core/modules/mailings/eventorganization.modules.php +++ b/htdocs/core/modules/mailings/eventorganization.modules.php @@ -108,12 +108,12 @@ class mailing_eventorganization extends MailingTargets $otherTxt .= $addDescription; $cibles[$j] = array( 'email' => $obj->email, - 'fk_project' => $obj->fk_project, + 'fk_project' => (int) $obj->fk_project, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'other' => $otherTxt, 'source_url' => $this->url($obj->id, $obj->source), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => $obj->source ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 207f05e2d4c..f8e72582e53 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -301,7 +301,7 @@ class mailing_fraise extends MailingTargets if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'other' => @@ -310,7 +310,7 @@ class mailing_fraise extends MailingTargets ($langs->transnoentities("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin), 'day')).';'. ($langs->transnoentities("Company").'='.$obj->societe), 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'member' ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 8d98e85afd9..8aa20523f7d 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -73,7 +73,10 @@ class MailingTargets // This can't be abstract as it is used for some method public $sql; - public $evenunsubscribe = 0; // Set this to 1 if you want to flag you also want to include email in target that has opt-out. + /** + * @var int<0,1> Set this to 1 if you want to flag you also want to include email in target that has opt-out. + */ + public $evenunsubscribe = 0; /** @@ -190,7 +193,7 @@ class MailingTargets // This can't be abstract as it is used for some method * Add a list of targets into the database * * @param int $mailing_id Id of emailing - * @param array $cibles Array with targets + * @param array $cibles Array with targets * @return int Return integer < 0 if error, nb added if OK */ public function addTargetsToDatabase($mailing_id, $cibles) @@ -199,6 +202,7 @@ class MailingTargets // This can't be abstract as it is used for some method $this->db->begin(); + // Insert emailing targets from array into database $j = 0; $num = count($cibles); @@ -217,7 +221,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql .= "'".$this->db->escape($targetarray['email'])."',"; $sql .= "'".$this->db->escape($targetarray['other'])."',"; $sql .= "'".$this->db->escape($targetarray['source_url'])."',"; - $sql .= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").","; + $sql .= (empty($targetarray['source_id']) ? 'null' : (int) $targetarray['source_id']).","; $sql .= "'".$this->db->escape(dol_hash($conf->file->instance_unique_id.";".$targetarray['email'].";".$targetarray['lastname'].";".((int) $mailing_id).";".getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY'), 'md5'))."',"; $sql .= "'".$this->db->escape($targetarray['source_type'])."')"; dol_syslog(__METHOD__, LOG_DEBUG); @@ -302,8 +306,8 @@ class MailingTargets // This can't be abstract as it is used for some method * Return list of widget. Function used by admin page htdoc/admin/widget. * List is sorted by widget filename so by priority to run. * - * @param array $forcedir null=All default directories. This parameter is used by modulebuilder module only. - * @return array Array list of widget + * @param ?array $forcedir null=All default directories. This parameter is used by modulebuilder module only. + * @return array Array list of widgets */ public static function getEmailingSelectorsList($forcedir = null) { diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php index a2874475f23..0835fc313bd 100644 --- a/htdocs/core/modules/mailings/partnership.modules.php +++ b/htdocs/core/modules/mailings/partnership.modules.php @@ -130,12 +130,12 @@ class mailing_partnership extends MailingTargets $otherTxt .= $addDescription; $cibles[$j] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'lastname' => $obj->name, // For a thirdparty, we must use name 'firstname' => '', // For a thirdparty, lastname is '' 'other' => $otherTxt, 'source_url' => $this->url($obj->id, $obj->source), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => $obj->source ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 4d982621e94..eecf2411887 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -203,7 +203,7 @@ class mailing_pomme extends MailingTargets if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'other' => @@ -211,7 +211,7 @@ class mailing_pomme extends MailingTargets ($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'. ($langs->transnoentities("PhonePro").'='.$obj->office_phone), 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'user' ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 7eda228bb24..51328c68620 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -197,12 +197,12 @@ class mailing_thirdparties extends MailingTargets $otherTxt .= $addDescription; $cibles[$j] = array( 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, + 'fk_contact' => (int) $obj->fk_contact, 'lastname' => $obj->name, // For a thirdparty, we must use name 'firstname' => '', // For a thirdparty, lastname is '' 'other' => $otherTxt, 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'thirdparty' ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 35a728566dd..4a76510e55c 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -141,7 +141,7 @@ class mailing_thirdparties_services_expired extends MailingTargets ('Contract='.$obj->fk_contrat).';'. ('ContactLine='.$obj->cdid), 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'thirdparty' ); $old = $obj->email; diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 5fad7010d05..1e2a4818307 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -173,7 +173,7 @@ class mailing_xinputfile extends MailingTargets 'firstname' => $firstname, 'other' => $other, 'source_url' => '', - 'source_id' => '', + 'source_id' => 0, 'source_type' => 'file' ); $old = $email; diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 3f844ec0d40..3d4ce3cf34e 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -143,7 +143,7 @@ class mailing_xinputuser extends MailingTargets 'firstname' => $firstname, 'other' => $other, 'source_url' => '', - 'source_id' => '', + 'source_id' => 0, 'source_type' => 'file' ); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 35a0dc44ab0..aeb0576cc6f 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -141,7 +141,7 @@ class doc_generic_task_odt extends ModelePDFTask * @param CommonObject $object Main object to use as data source * @param Translate $outputlangs Lang object to use for output * @param string $array_key Name of the key for return array - * @return array Array of substitution + * @return array Array of substitution */ public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { @@ -185,7 +185,7 @@ class doc_generic_task_odt extends ModelePDFTask * @param Task $task Task Object * @param Translate $outputlangs Lang object to use for output * @param string $array_key Name of the key for return array - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_tasks($task, $outputlangs, $array_key = 'task') { @@ -226,9 +226,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $contact Contact array + * @param array{id:int,rowid:int,libelle:string,lastname:string,firstname:string,fullname:string,socname:string,email:string} $contact Contact array * @param Translate $outputlangs Lang object to use for output - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_project_contacts($contact, $outputlangs) { @@ -249,9 +249,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $file file array + * @param array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string} $file file array * @param Translate $outputlangs Lang object to use for output - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_project_file($file, $outputlangs) { @@ -267,9 +267,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $refdetail Reference array + * @param array{type:string,ref:string,date:int,socname:string,amountht:float|string,amountttc:float|string,status:string} $refdetail Reference array * @param Translate $outputlangs Lang object to use for output - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_project_reference($refdetail, $outputlangs) { @@ -289,9 +289,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $taskresource Resource array + * @param array{rowid:int,libelle:string,lastname:string,firstname:string,fullname:string,socname:string,email:string} $taskresource Resource array * @param Translate $outputlangs Lang object to use for output - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_tasksressource($taskresource, $outputlangs) { @@ -313,9 +313,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $tasktime times object + * @param array{rowid:int,task_date:string,task_duration:int,note:string,fk_user:int,lastname:string,firstname:string,fullcivname:string} $tasktime times object * @param Translate $outputlangs Lang object to use for output - * @return array Return a substitution array + * @return array Return a substitution array */ public function get_substitutionarray_taskstime($tasktime, $outputlangs) { diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 1cbb3c916af..c1046c3885a 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -418,7 +418,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket * @param CommonObject $object user * @param Translate $outputlangs translation object * @param string $array_key key for array - * @return array array of substitutions + * @return array array of substitutions */ public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 306ab8a146a..78f9e00ca36 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -449,7 +449,7 @@ class doc_generic_user_odt extends ModelePDFUser * @param CommonObject $object user * @param Translate $outputlangs translation object * @param string $array_key key for array - * @return array array of substitutions + * @return array array of substitutions */ public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index bfb4cf8ada3..87fd49d1f0e 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2017-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 @@ -17,7 +17,7 @@ */ /** - * \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php + * \file htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php * \ingroup zapier * \brief File for Zappier Triggers. */ diff --git a/htdocs/core/upload_page.php b/htdocs/core/upload_page.php index 599e275af13..65b9463349c 100644 --- a/htdocs/core/upload_page.php +++ b/htdocs/core/upload_page.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2017 Laurent Destailleur * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW * diff --git a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php index a71f14a0b86..5cf32548537 100644 --- a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolConfigCollector.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 @@ -32,7 +33,7 @@ class DolConfigCollector extends ConfigCollector /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { @@ -51,7 +52,7 @@ class DolConfigCollector extends ConfigCollector /** * Return collected data * - * @return array Array of collected data + * @return array{count:int,messages:string[]} Array of collected data */ public function collect() { @@ -63,7 +64,7 @@ class DolConfigCollector extends ConfigCollector /** * Returns an array with config data * - * @return array Array of config + * @return array> Array of config */ protected function getConfig() { @@ -93,7 +94,7 @@ class DolConfigCollector extends ConfigCollector * Convert an object to array * * @param mixed $obj Object - * @return array Array + * @return array Array */ protected function objectToArray($obj) { diff --git a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php index 5835bbde179..9e1313086f9 100644 --- a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.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 @@ -32,7 +33,7 @@ class DolExceptionsCollector extends ExceptionsCollector /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index e0a12753fb2..7f29ad3621c 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -66,7 +66,8 @@ class DolLogsCollector extends MessagesCollector /** * Return widget settings * - * @return array Array + * @return array Array + */ public function getWidgets() { diff --git a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php index b848691ff1f..c40249ed59e 100644 --- a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.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 @@ -31,7 +32,7 @@ class DolMemoryCollector extends MemoryCollector /** * Return value of indicator * - * @return array Array + * @return array{peak_usage:string,peak_usage_str:string} Array */ public function collect() { @@ -48,7 +49,7 @@ class DolMemoryCollector extends MemoryCollector /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { diff --git a/htdocs/debugbar/class/DataCollector/DolQueryCollector.php b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php index 29afd74299e..5070d5eb8f3 100644 --- a/htdocs/debugbar/class/DataCollector/DolQueryCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php @@ -55,7 +55,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid /** * Return collected data * - * @return array Array of collected data + * @return array Array of collected data */ public function collect() { @@ -102,7 +102,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { @@ -127,7 +127,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid /** * Return assets * - * @return array Array + * @return array Array */ public function getAssets() { diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index 2885e491f0b..2e457a0e68d 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.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 @@ -32,7 +33,7 @@ class DolRequestDataCollector extends RequestDataCollector /** * Collects the data from the collectors * - * @return array Array of collected data + * @return array Array of collected data */ public function collect() { @@ -68,7 +69,7 @@ class DolRequestDataCollector extends RequestDataCollector /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { diff --git a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php index 4fdbb65c65c..a5b624a3774 100644 --- a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.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 @@ -31,7 +32,7 @@ class DolTimeDataCollector extends TimeDataCollector /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php index da83292cde5..1708a7ad724 100644 --- a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php @@ -45,7 +45,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid /** * Return collected data * - * @return array Array of collected data + * @return array Array of collected data */ public function collect() { @@ -125,7 +125,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid /** * Return widget settings * - * @return array Array + * @return array Array */ public function getWidgets() { @@ -164,9 +164,9 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid } /** - * Return collector assests + * Return collector assets * - * @return array Array + * @return array Array */ public function getAssets() { diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index e5b595720e0..afb73d301a1 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -925,7 +925,7 @@ class EcmFiles extends CommonObject $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; } if (!empty($this->gen_or_uploaded)) { - $datas['gen_or_upload'] .= '
'.$langs->trans('GenOrUpload').': '.$this->gen_or_uploaded; + $datas['gen_or_upload'] = '
'.$langs->trans('GenOrUpload').': '.$this->gen_or_uploaded; } return $datas; @@ -996,7 +996,7 @@ class EcmFiles extends CommonObject if (empty($this->filename)) { $result .= ($linkstart.img_object(($notooltip ? '' : $label), 'label', ($notooltip ? '' : 'class="paddingright"')).$linkend); } else { - $result .= ($linkstart.img_mime($this->filename, ($notooltip ? '' : $label), ($notooltip ? '' : 'class="paddingright"')).$linkend); + $result .= ($linkstart.img_mime($this->filename, ($notooltip ? '' : dol_escape_htmltag($label, 1)), ($notooltip ? '' : ' paddingright')).$linkend); } if ($withpicto != 2) { $result .= ' '; diff --git a/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.key.sql b/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.key.sql new file mode 100644 index 00000000000..01d1272f6c3 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2024 Abbes Bahfir +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_pos_cash_fence_extrafields ADD UNIQUE INDEX uk_pos_cash_fence_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.sql b/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.sql new file mode 100644 index 00000000000..1ed03e9ad16 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_pos_cash_fence_extrafields.sql @@ -0,0 +1,26 @@ +-- =================================================================== +-- Copyright (C) 2024 Abbes Bahfir +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +create table llx_pos_cash_fence_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php index a3c3e32e2f2..a14f339306b 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php @@ -131,13 +131,13 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets $obj = $this->db->fetch_object($result); if ($old != $obj->email) { $target[$j] = array( - 'email' => $obj->email, - 'id' => $obj->id, - 'firstname' => $obj->firstname, - 'lastname' => $obj->lastname, - //'other' => $obj->label, + 'email' => (string) $obj->email, + 'id' => (int) $obj->id, + 'firstname' => (string) $obj->firstname, + 'lastname' => (string) $obj->lastname, + 'other' => '', // (string) $obj->label, 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, + 'source_id' => (int) $obj->id, 'source_type' => 'myobject@mymodule' ); $old = $obj->email; diff --git a/htdocs/printing/lib/printing.lib.php b/htdocs/printing/lib/printing.lib.php index fc038c68c3a..6322f353ae7 100644 --- a/htdocs/printing/lib/printing.lib.php +++ b/htdocs/printing/lib/printing.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -57,22 +57,22 @@ function printingAdminPrepareHead($mode) $h++; } - /** TODO This feature seem to be not ready yet. + /* TODO This feature seem to be not ready yet. $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf"; $head[$h][1] = $langs->trans("UserConf"); $head[$h][2] = 'userconf'; $h++; */ - //$object=new stdClass(); + // $object=new stdClass(); // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - //complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin'); + // complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin'); - //complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove'); + // complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove'); return $head; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 4129687cf59..2c7fd107a9d 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -166,7 +166,7 @@ $form = new Form($db); $formproduct = new FormProduct($db); $product_fourn = new ProductFournisseur($db); $productstatic = new Product($db); - +$resql = false; // action recherche des produits par mot-cle et/ou par categorie if ($action == 'search') { $current_lang = $langs->getDefaultLang(); diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 757805e0130..757e5589c24 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2014 Maxime Kohlhaas + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +26,15 @@ * $cols */ +/** + * @var CommonObject $object + * @var Conf $conf + * @var HookManager $hookmanager + * @var Translate $conf + * + * @var string $action + * @var array $parameters + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index c5a592bd2dd..5349edbf388 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -20,6 +20,16 @@ * $backtopage */ +/** + * @var Conf $conf + * @var DoliDB $db + * @var Product|MouvementStock $object + * @var FormProduct $formproduct + * @var FormProjets $formproject + * @var Translate $langs + * + * @var string $backtopage + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -37,12 +47,10 @@ if (empty($conf) || !is_object($conf)) { element == 'product') { + /** @var Product $object */ $productref = $object->ref; } @@ -152,6 +160,7 @@ print ''; // Warehouse or product print ''; if ($object->element == 'product') { + /** @var Product $object */ print ''; print ''; } if ($object->element == 'stockmouvement') { + /** @var MouvementStock $object */ print ''; print ''; print ''; // If product is a Kit, we ask if we must disable stock change of subproducts if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && $object->element == 'product' && $object->hasFatherOrChild(1)) { + /** @var Product $object */ print ''; print ''; print ''; print 'element == 'stockmouvement' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
'.$langs->trans("Warehouse").''; $ident = (GETPOST("dwid") ? GETPOSTINT("dwid") : (GETPOST('id_entrepot') ? GETPOSTINT('id_entrepot') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))); @@ -162,6 +171,7 @@ if ($object->element == 'product') { print ''.$langs->trans("Product").''; print img_picto('', 'product'); @@ -171,6 +181,7 @@ if ($object->element == 'stockmouvement') { print ''.$langs->trans("NumberOfUnit").''; if ($object->element == 'product' || $object->element == 'stockmouvement') { + /** @var Product|MouvementStock $object */ print '
'; @@ -197,6 +209,7 @@ if (isModEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stockmouvement')) ) { + /** @var Product|MouvementStock $object */ print '
'; if ($pdluoid > 0) { diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index e5c9b2333aa..f4e8c8741fc 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -20,6 +20,16 @@ * $backtopage */ +/** + * @var Conf $conf + * @var DoliDB $db + * @var Product|MouvementStock $object + * @var FormProduct $formproduct + * @var Translate $langs + * + * @var string $backtopage + */ + // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -38,6 +48,7 @@ if (empty($conf) || !is_object($conf)) { element == 'product') { + /** @var Product $object */ $productref = $object->ref; } @@ -77,6 +88,7 @@ print ''; // Source warehouse or product print ''; if ($object->element == 'product') { + /** @var Product $object */ print ''; print ''; } if ($object->element == 'stockmouvement') { + /** @var MouvementStock $object */ print ''; print ''; print 'element == 'stockmouvement' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
'.$langs->trans("WarehouseSource").''; print img_picto('', 'stock'); @@ -86,6 +98,7 @@ if ($object->element == 'product') { print ''.$langs->trans("Product").''; print img_picto('', 'product'); @@ -104,6 +117,7 @@ if (isModEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stockmouvement')) ) { + /** @var Product|MouvementStock $object */ print '
'; if ($pdluoid > 0) { diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index bc55ffd671c..204e383f98c 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -20,7 +21,10 @@ * \ingroup projet * \brief Gantt diagram of a project */ - +/** + * @var DoliDB $db + * @var Translate $langs + */ ?>
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 5ad44680ea1..26d05849d15 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -84,12 +84,12 @@ $contactstatic = new Contact($db); $task = new Task($db); $arrayofcss = array('/includes/jsgantt/jsgantt.css'); - +$arrayofjs = []; if (!empty($conf->use_javascript_ajax)) { - $arrayofjs = array( - '/includes/jsgantt/jsgantt.js', - '/projet/jsgantt_language.js.php?lang='.$langs->defaultlang - ); + $arrayofjs = [ + '/includes/jsgantt/jsgantt.js', + '/projet/jsgantt_language.js.php?lang='.$langs->defaultlang + ]; } //$title=$langs->trans("Gantt").($object->ref?' - '.$object->ref.' '.$object->name:''); diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 336a50191ff..9d976d9aba7 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -17,6 +18,17 @@ */ // variable $listofopplabel and $listofoppstatus should be defined +/** + * @var Conf $conf + * @var Form $form + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $projectsListId + * @var int $socid + * @var string[] $listofoppstatus + */ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 478b36627f0..1ba1c2c15c5 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -370,9 +370,9 @@ class Website extends CommonObject * @param string $sortfield Sort field * @param int $limit limit * @param int $offset offset limit - * @param string|array $filter filter array + * @param string|array $filter filter array * @param string $filtermode filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @return Website[]|int<-1,-1> int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -1516,7 +1516,7 @@ class Website extends CommonObject /** * Component to select language inside a container (Full CSS Only) * - * @param array|string $languagecodes 'auto' to show all languages available for page, or language codes array like array('en','fr','de','es') + * @param string[]|'auto' $languagecodes 'auto' to show all languages available for page, or language codes array like array('en','fr','de','es') * @param Translate $weblangs Language Object * @param string $morecss More CSS class on component * @param string $htmlname Suffix for HTML name @@ -1854,7 +1854,7 @@ class Website extends CommonObject /** * Save state for File * @param mixed $etat state - * @param mixed $pathname path of file + * @param string $pathname path of file * @return int|false */ public function saveState($etat, $pathname) @@ -1866,8 +1866,8 @@ class Website extends CommonObject * Compare two files has not same name but same content * @param string $dossierSource filepath of folder source * @param string $dossierDestination filepath of folder dest - * @param mixed $fichierModifie files modified - * @return array empty if KO, array if OK + * @param array{fullname:string} $fichierModifie files modified + * @return array empty if KO, array if OK */ public function compareFichierModifie($dossierSource, $dossierDestination, $fichierModifie) { @@ -1966,8 +1966,8 @@ class Website extends CommonObject * show difference between to string * @param string $str1 first string * @param string $str2 second string - * @param array $exceptNumPge num of page files we don't want to change - * @return array|int<-1,-1> -1 if KO, array if OK + * @param int[] $exceptNumPge num of page files we don't want to change + * @return array Array */ protected function showDifferences($str1, $str2, $exceptNumPge = array()) { @@ -1985,8 +1985,8 @@ class Website extends CommonObject for ($i = 0;$i < $countNumPage; $i++) { $linefound[$i] = array(); - $linefound[$i]['meta'] = '/content="' . preg_quote($exceptNumPge[$i], '/') . '" \/>/'; - $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/'; + $linefound[$i]['meta'] = '/content="' . preg_quote((string) $exceptNumPge[$i], '/') . '" \/>/'; + $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote((string) $exceptNumPge[$i], '/') . '\);/'; } if (isset($linefound[1])) { @@ -2059,8 +2059,8 @@ class Website extends CommonObject * Replace line by line in file using numbers of the lines * * @param string $inplaceFile path of file to modify in place - * @param array $differences array of differences between files - * @return int Return 0 if we can replace, <0 if not (-2=not writable) + * @param array> $differences array of differences between files + * @return int<-2,0> Return 0 if we can replace, <0 if not (-2=not writable) */ protected function replaceLineUsingNum($inplaceFile, $differences) {