From 0d7bc505d358b53390fec966c3fbc224c7096549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Nov 2024 19:39:46 +0100 Subject: [PATCH 1/2] add phpdoc and clean phpstan baseline (#31702) * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline * add phpdoc and clean phpstan baseline --- build/phpstan/phpstan-baseline.neon | 905 ------------------ htdocs/admin/dav.php | 2 + htdocs/admin/fichinter_xcal.php | 2 + htdocs/admin/limits.php | 10 +- htdocs/admin/oauthlogintokens.php | 2 + htdocs/admin/security.php | 2 + htdocs/admin/system/database.php | 2 + htdocs/admin/ticket_public.php | 2 + htdocs/api/admin/index.php | 2 + htdocs/compta/cashcontrol/report.php | 1 + htdocs/compta/localtax/list.php | 1 + htdocs/compta/prelevement/create.php | 1 + htdocs/compta/resultat/clientfourn.php | 1 + htdocs/compta/resultat/result.php | 1 + htdocs/compta/tva/clients.php | 1 + htdocs/compta/tva/quadri_detail.php | 1 + htdocs/contact/card.php | 1 + htdocs/contrat/card.php | 1 + htdocs/core/actions_addupdatedelete.inc.php | 1 + htdocs/core/actions_comments.inc.php | 1 + htdocs/core/actions_lineupdown.inc.php | 9 +- htdocs/core/actions_linkedfiles.inc.php | 15 +- htdocs/core/actions_massactions.inc.php | 20 +- htdocs/core/actions_sendmails.inc.php | 1 + .../connectors/php/config.inc.php | 9 + htdocs/core/js/timepicker.js.php | 6 +- htdocs/core/lib/format_cards.lib.php | 4 + .../commande/doc/pdf_eratosthene.modules.php | 12 +- .../modules/facture/doc/pdf_crabe.modules.php | 12 +- .../modules/oauth/generic_oauthcallback.php | 10 +- .../modules/oauth/github_oauthcallback.php | 11 +- .../modules/oauth/google_oauthcallback.php | 9 + .../oauth/microsoft2_oauthcallback.php | 11 +- .../modules/oauth/microsoft_oauthcallback.php | 11 +- .../oauth/stripelive_oauthcallback.php | 10 + .../oauth/stripetest_oauthcallback.php | 11 +- htdocs/core/tpl/bloc_showhide.tpl.php | 8 +- htdocs/core/tpl/originproductline.tpl.php | 6 +- htdocs/don/card.php | 1 + .../core/actions_massactions_mail.inc.php | 28 +- htdocs/expedition/shipment.php | 1 + htdocs/expensereport/card.php | 3 + htdocs/fourn/card.php | 1 + htdocs/fourn/commande/card.php | 5 +- htdocs/fourn/commande/list.php | 1 + htdocs/fourn/facture/card-rec.php | 1 + htdocs/fourn/facture/card.php | 1 + htdocs/fourn/facture/document.php | 1 + htdocs/fourn/facture/list.php | 1 + htdocs/fourn/facture/note.php | 1 + htdocs/hrm/establishment/card.php | 1 + htdocs/hrm/evaluation_card.php | 3 +- htdocs/hrm/job_card.php | 1 + htdocs/imports/import.php | 5 +- htdocs/install/check.php | 12 +- htdocs/install/repair.php | 32 +- htdocs/intracommreport/card.php | 1 + htdocs/loan/calcmens.php | 10 +- .../template/core/boxes/mymodulewidget1.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 12 + htdocs/product/admin/product_lot.php | 1 + .../canvas/product/tpl/card_create.tpl.php | 7 +- .../canvas/product/tpl/card_edit.tpl.php | 8 +- .../canvas/product/tpl/card_view.tpl.php | 10 +- .../canvas/service/tpl/card_create.tpl.php | 7 +- .../canvas/service/tpl/card_edit.tpl.php | 8 +- .../canvas/service/tpl/card_view.tpl.php | 8 +- htdocs/product/stock/card.php | 1 + htdocs/projet/activity/perday.php | 1 + htdocs/projet/activity/permonth.php | 1 + htdocs/projet/activity/perweek.php | 1 + htdocs/projet/admin/project.php | 1 + htdocs/projet/element.php | 1 + htdocs/projet/tasks/time.php | 1 + htdocs/public/opensurvey/index.php | 9 + htdocs/societe/admin/societe.php | 1 + htdocs/societe/list.php | 1 + htdocs/societe/price.php | 1 + htdocs/takepos/invoice.php | 1 + htdocs/takepos/phone.php | 8 +- htdocs/takepos/printbox.php | 5 + htdocs/takepos/receipt.php | 10 +- htdocs/takepos/reduction.php | 9 + htdocs/takepos/send.php | 1 + htdocs/takepos/split.php | 7 +- htdocs/theme/eldy/global.inc.php | 3 + htdocs/theme/md/manifest.json.php | 5 +- htdocs/webservices/admin/index.php | 1 + htdocs/webservices/server_actioncomm.php | 5 +- htdocs/webservices/server_category.php | 6 +- htdocs/webservices/server_contact.php | 4 + htdocs/webservices/server_invoice.php | 5 + htdocs/webservices/server_order.php | 5 +- htdocs/webservices/server_other.php | 5 + htdocs/webservices/server_payment.php | 5 + .../webservices/server_productorservice.php | 5 +- htdocs/webservices/server_project.php | 4 + .../webservices/server_supplier_invoice.php | 5 + htdocs/webservices/server_thirdparty.php | 4 + htdocs/webservices/server_user.php | 4 + 100 files changed, 428 insertions(+), 986 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 60e5cbee3d9..92e8952a6a9 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -1130,11 +1130,6 @@ parameters: count: 1 path: ../../htdocs/admin/dav.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/dav.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 3 @@ -1240,11 +1235,6 @@ parameters: count: 18 path: ../../htdocs/admin/fichinter.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/fichinter_xcal.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 1 @@ -1325,11 +1315,6 @@ parameters: count: 2 path: ../../htdocs/admin/limits.php - - - message: "#^Parameter \\#2 \\$pu of function calcul_price_total expects float, string given\\.$#" - count: 3 - path: ../../htdocs/admin/limits.php - - message: "#^Variable \\$aCurrencies in empty\\(\\) always exists and is not falsy\\.$#" count: 2 @@ -1475,11 +1460,6 @@ parameters: count: 1 path: ../../htdocs/admin/oauthlogintokens.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/oauthlogintokens.php - - message: "#^Variable \\$error might not be defined\\.$#" count: 2 @@ -1540,11 +1520,6 @@ parameters: count: 2 path: ../../htdocs/admin/security.php - - - message: "#^Variable \\$dolibarr_main_db_pass might not be defined\\.$#" - count: 2 - path: ../../htdocs/admin/security.php - - message: "#^Variable \\$max in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -1605,11 +1580,6 @@ parameters: count: 1 path: ../../htdocs/admin/system/constall.php - - - message: "#^Variable \\$dolibarr_main_db_pass might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/system/database.php - - message: "#^Variable \\$row might not be defined\\.$#" count: 1 @@ -1690,11 +1660,6 @@ parameters: count: 1 path: ../../htdocs/admin/system/security.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/ticket_public.php - - message: "#^Negated boolean expression is always false\\.$#" count: 1 @@ -1850,11 +1815,6 @@ parameters: count: 1 path: ../../htdocs/ai/admin/setup.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/api/admin/index.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 1 @@ -4970,11 +4930,6 @@ parameters: count: 1 path: ../../htdocs/compta/cashcontrol/report.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 3 - path: ../../htdocs/compta/cashcontrol/report.php - - message: "#^If condition is always true\\.$#" count: 2 @@ -5875,11 +5830,6 @@ parameters: count: 2 path: ../../htdocs/compta/localtax/clients.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 5 - path: ../../htdocs/compta/localtax/clients.php - - message: "#^Variable \\$period might not be defined\\.$#" count: 1 @@ -5920,21 +5870,11 @@ parameters: count: 2 path: ../../htdocs/compta/localtax/index.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 7 - path: ../../htdocs/compta/localtax/index.php - - message: "#^Variable \\$arrayofselected might not be defined\\.$#" count: 1 path: ../../htdocs/compta/localtax/list.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/compta/localtax/list.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 1 @@ -6300,11 +6240,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/create.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/compta/prelevement/create.php - - message: "#^Variable \\$massaction might not be defined\\.$#" count: 1 @@ -6380,11 +6315,6 @@ parameters: count: 1 path: ../../htdocs/compta/resultat/clientfourn.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/compta/resultat/clientfourn.php - - message: "#^Variable \\$name might not be defined\\.$#" count: 1 @@ -6455,11 +6385,6 @@ parameters: count: 1 path: ../../htdocs/compta/resultat/result.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/compta/resultat/result.php - - message: "#^Variable \\$name might not be defined\\.$#" count: 1 @@ -7085,11 +7010,6 @@ parameters: count: 2 path: ../../htdocs/compta/tva/clients.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/compta/tva/clients.php - - message: "#^Variable \\$year_current might not be defined\\.$#" count: 1 @@ -7200,11 +7120,6 @@ parameters: count: 4 path: ../../htdocs/compta/tva/quadri_detail.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/compta/tva/quadri_detail.php - - message: "#^Variable \\$year_current might not be defined\\.$#" count: 1 @@ -7270,11 +7185,6 @@ parameters: count: 4 path: ../../htdocs/contact/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/contact/card.php - - message: "#^Variable \\$objsoc in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -7455,11 +7365,6 @@ parameters: count: 1 path: ../../htdocs/contrat/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 6 - path: ../../htdocs/contrat/card.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 3 @@ -7800,11 +7705,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_addupdatedelete.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 4 - path: ../../htdocs/core/actions_addupdatedelete.inc.php - - message: "#^Variable \\$confirm might not be defined\\.$#" count: 6 @@ -7840,11 +7740,6 @@ parameters: count: 2 path: ../../htdocs/core/actions_comments.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/actions_comments.inc.php - - message: "#^Variable \\$id might not be defined\\.$#" count: 3 @@ -7900,16 +7795,6 @@ parameters: count: 9 path: ../../htdocs/core/actions_fetchobject.inc.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_lineupdown.inc.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_lineupdown.inc.php - - message: "#^Variable \\$hidedesc might not be defined\\.$#" count: 2 @@ -7925,21 +7810,11 @@ parameters: count: 2 path: ../../htdocs/core/actions_lineupdown.inc.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_lineupdown.inc.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 2 path: ../../htdocs/core/actions_lineupdown.inc.php - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 10 - path: ../../htdocs/core/actions_lineupdown.inc.php - - message: "#^Variable \\$permissiontoedit might not be defined\\.$#" count: 2 @@ -7950,51 +7825,11 @@ parameters: count: 6 path: ../../htdocs/core/actions_linkedfiles.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$confirm might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - message: "#^Variable \\$error might not be defined\\.$#" count: 6 path: ../../htdocs/core/actions_linkedfiles.inc.php - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 25 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 8 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$upload_dir might not be defined\\.$#" - count: 5 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - message: "#^Comparison operation \"\\>\" between 0 and 1 is always false\\.$#" count: 2 @@ -8020,16 +7855,6 @@ parameters: count: 14 path: ../../htdocs/core/actions_massactions.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 5 - path: ../../htdocs/core/actions_massactions.inc.php - - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/actions_massactions.inc.php - - message: "#^Variable \\$errors might not be defined\\.$#" count: 1 @@ -8110,11 +7935,6 @@ parameters: count: 5 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: "#^Variable \\$error might not be defined\\.$#" count: 2 @@ -10300,21 +10120,6 @@ parameters: count: 1 path: ../../htdocs/core/filemanagerdol/browser/default/frmupload.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/filemanagerdol/connectors/php/config.inc.php - - - - message: "#^Variable \\$dolibarr_main_data_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/filemanagerdol/connectors/php/config.inc.php - - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/filemanagerdol/connectors/php/config.inc.php - - message: "#^Variable \\$_FILES in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -10335,16 +10140,6 @@ parameters: count: 1 path: ../../htdocs/core/filemanagerdol/connectors/php/connector.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/js/timepicker.js.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 12 - path: ../../htdocs/core/js/timepicker.js.php - - message: "#^Variable \\$var in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -10420,11 +10215,6 @@ parameters: count: 2 path: ../../htdocs/core/lib/files.lib.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/lib/format_cards.lib.php - - message: "#^Parameter \\#1 \\$ftp of function ftp_cdup expects FTP\\\\Connection, resource given\\.$#" count: 1 @@ -11225,11 +11015,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - - message: "#^Parameter \\#2 \\$addpercent of function vatrate expects bool, int given\\.$#" - count: 6 - path: ../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - message: "#^Parameter \\#3 \\$curx of function pdf_bank expects int, float given\\.$#" count: 1 @@ -11695,11 +11480,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php - - - message: "#^Parameter \\#2 \\$addpercent of function vatrate expects bool, int given\\.$#" - count: 6 - path: ../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php - - message: "#^Parameter \\#3 \\$curx of function pdf_bank expects int, float given\\.$#" count: 1 @@ -12625,181 +12405,41 @@ parameters: count: 1 path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 6 - path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 6 - path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - message: "#^Variable \\$state might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/google_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 6 - path: ../../htdocs/core/modules/oauth/google_oauthcallback.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 9 - path: ../../htdocs/core/modules/oauth/google_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/google_oauthcallback.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - message: "#^Else branch is unreachable because previous condition is always true\\.$#" count: 2 path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 4 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 4 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 1 @@ -14215,11 +13855,6 @@ parameters: count: 3 path: ../../htdocs/core/tpl/bloc_comment.tpl.php - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/tpl/bloc_showhide.tpl.php - - message: "#^Variable \\$title might not be defined\\.$#" count: 1 @@ -14990,11 +14625,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/originproductline.tpl.php - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 13 - path: ../../htdocs/core/tpl/originproductline.tpl.php - - message: "#^Variable \\$action might not be defined\\.$#" count: 1 @@ -15715,11 +15345,6 @@ parameters: count: 1 path: ../../htdocs/don/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/don/card.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 1 @@ -16590,16 +16215,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 4 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 6 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: "#^Variable \\$deliveryreceipt might not be defined\\.$#" count: 1 @@ -16625,31 +16240,16 @@ parameters: count: 3 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 26 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: "#^Variable \\$listofobjectref in empty\\(\\) always exists and is always falsy\\.$#" count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: "#^Variable \\$massaction might not be defined\\.$#" - count: 3 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: "#^Variable \\$toselect might not be defined\\.$#" - count: 4 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: "#^Variable \\$triggername in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -17125,11 +16725,6 @@ parameters: count: 2 path: ../../htdocs/expedition/shipment.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/expedition/shipment.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 1 @@ -17190,11 +16785,6 @@ parameters: count: 1 path: ../../htdocs/expensereport/card.php - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 1 - path: ../../htdocs/expensereport/card.php - - message: "#^Variable \\$error might not be defined\\.$#" count: 10 @@ -17205,11 +16795,6 @@ parameters: count: 1 path: ../../htdocs/expensereport/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 13 - path: ../../htdocs/expensereport/card.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 10 @@ -17790,11 +17375,6 @@ parameters: count: 2 path: ../../htdocs/fourn/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/fourn/card.php - - message: "#^Variable \\$num might not be defined\\.$#" count: 1 @@ -18580,11 +18160,6 @@ parameters: count: 3 path: ../../htdocs/fourn/commande/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 21 - path: ../../htdocs/fourn/commande/card.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 7 @@ -18730,11 +18305,6 @@ parameters: count: 3 path: ../../htdocs/fourn/commande/list.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/fourn/commande/list.php - - message: "#^Variable \\$searchCategoryProductList in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -18825,11 +18395,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/card-rec.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 14 - path: ../../htdocs/fourn/facture/card-rec.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 2 @@ -18900,11 +18465,6 @@ parameters: count: 3 path: ../../htdocs/fourn/facture/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 16 - path: ../../htdocs/fourn/facture/card.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 6 @@ -18930,11 +18490,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/document.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/fourn/facture/document.php - - message: "#^Variable \\$upload_dir might not be defined\\.$#" count: 1 @@ -18985,11 +18540,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/list.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 6 - path: ../../htdocs/fourn/facture/list.php - - message: "#^Variable \\$numprlv might not be defined\\.$#" count: 1 @@ -19020,11 +18570,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/note.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/fourn/facture/note.php - - message: "#^Left side of && is always true\\.$#" count: 2 @@ -19745,11 +19290,6 @@ parameters: count: 1 path: ../../htdocs/hrm/establishment/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/hrm/establishment/card.php - - message: "#^Property Establishment\\:\\:\\$entity \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -19765,11 +19305,6 @@ parameters: count: 1 path: ../../htdocs/hrm/evaluation_card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/hrm/evaluation_card.php - - message: "#^Variable \\$upload_dir might not be defined\\.$#" count: 1 @@ -19800,11 +19335,6 @@ parameters: count: 1 path: ../../htdocs/hrm/job_card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/hrm/job_card.php - - message: "#^Variable \\$soc might not be defined\\.$#" count: 1 @@ -19995,11 +19525,6 @@ parameters: count: 1 path: ../../htdocs/imports/import.php - - - message: "#^Variable \\$relativepath might not be defined\\.$#" - count: 1 - path: ../../htdocs/imports/import.php - - message: "#^If condition is always true\\.$#" count: 1 @@ -20060,31 +19585,6 @@ parameters: count: 1 path: ../../htdocs/install/check.php - - - message: "#^Variable \\$dolibarr_main_db_host might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/check.php - - - - message: "#^Variable \\$dolibarr_main_db_name might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/check.php - - - - message: "#^Variable \\$dolibarr_main_db_pass might not be defined\\.$#" - count: 4 - path: ../../htdocs/install/check.php - - - - message: "#^Variable \\$dolibarr_main_db_port might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/check.php - - - - message: "#^Variable \\$dolibarr_main_db_user might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/check.php - - message: "#^If condition is always true\\.$#" count: 1 @@ -20150,11 +19650,6 @@ parameters: count: 1 path: ../../htdocs/install/repair.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/repair.php - - message: "#^Variable \\$conffile might not be defined\\.$#" count: 2 @@ -20175,46 +19670,11 @@ parameters: count: 1 path: ../../htdocs/install/repair.php - - - message: "#^Variable \\$dolibarr_main_db_host might not be defined\\.$#" - count: 3 - path: ../../htdocs/install/repair.php - - - - message: "#^Variable \\$dolibarr_main_db_name might not be defined\\.$#" - count: 7 - path: ../../htdocs/install/repair.php - - - - message: "#^Variable \\$dolibarr_main_db_pass might not be defined\\.$#" - count: 4 - path: ../../htdocs/install/repair.php - - - - message: "#^Variable \\$dolibarr_main_db_port might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/repair.php - - message: "#^Variable \\$dolibarr_main_db_type might not be defined\\.$#" count: 4 path: ../../htdocs/install/repair.php - - - message: "#^Variable \\$dolibarr_main_db_user might not be defined\\.$#" - count: 1 - path: ../../htdocs/install/repair.php - - - - message: "#^Variable \\$dolibarr_main_document_root might not be defined\\.$#" - count: 4 - path: ../../htdocs/install/repair.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 22 - path: ../../htdocs/install/repair.php - - message: "#^Variable \\$methodtofix might not be defined\\.$#" count: 1 @@ -20620,11 +20080,6 @@ parameters: count: 1 path: ../../htdocs/intracommreport/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/intracommreport/card.php - - message: "#^Variable \\$soc might not be defined\\.$#" count: 1 @@ -20785,21 +20240,6 @@ parameters: count: 1 path: ../../htdocs/knowledgemanagement/knowledgerecord_list.php - - - message: "#^Parameter \\#1 \\$mens of function loanCalcMonthlyPayment expects float, string given\\.$#" - count: 1 - path: ../../htdocs/loan/calcmens.php - - - - message: "#^Parameter \\#2 \\$capital of function loanCalcMonthlyPayment expects float, string given\\.$#" - count: 1 - path: ../../htdocs/loan/calcmens.php - - - - message: "#^Parameter \\#3 \\$rate of function loanCalcMonthlyPayment expects float, string given\\.$#" - count: 1 - path: ../../htdocs/loan/calcmens.php - - message: "#^Variable \\$formaccounting might not be defined\\.$#" count: 6 @@ -21950,21 +21390,6 @@ parameters: count: 1 path: ../../htdocs/mrp/tpl/linkedobjectblock.tpl.php - - - message: "#^Variable \\$line might not be defined\\.$#" - count: 9 - path: ../../htdocs/mrp/tpl/originproductline.tpl.php - - - - message: "#^Variable \\$res might not be defined\\.$#" - count: 1 - path: ../../htdocs/mrp/tpl/originproductline.tpl.php - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 20 - path: ../../htdocs/mrp/tpl/originproductline.tpl.php - - message: "#^Method MultiCurrencies\\:\\:delete\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -22440,11 +21865,6 @@ parameters: count: 3 path: ../../htdocs/product/admin/product.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/admin/product_lot.php - - message: "#^Comparison operation \"\\<\" between 0 and 0 is always false\\.$#" count: 1 @@ -22485,11 +21905,6 @@ parameters: count: 2 path: ../../htdocs/product/canvas/product/tpl/card_create.tpl.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 21 - path: ../../htdocs/product/canvas/product/tpl/card_create.tpl.php - - message: "#^Variable \\$refalreadyexists might not be defined\\.$#" count: 1 @@ -22500,21 +21915,6 @@ parameters: count: 2 path: ../../htdocs/product/canvas/product/tpl/card_edit.tpl.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 18 - path: ../../htdocs/product/canvas/product/tpl/card_edit.tpl.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 11 - path: ../../htdocs/product/canvas/product/tpl/card_view.tpl.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/canvas/product/tpl/card_view.tpl.php - - message: "#^Property ActionsCardService\\:\\:\\$field_list has no type specified\\.$#" count: 1 @@ -22535,11 +21935,6 @@ parameters: count: 2 path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 16 - path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - message: "#^Variable \\$refalreadyexists might not be defined\\.$#" count: 1 @@ -22555,21 +21950,6 @@ parameters: count: 2 path: ../../htdocs/product/canvas/service/tpl/card_edit.tpl.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 13 - path: ../../htdocs/product/canvas/service/tpl/card_edit.tpl.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 7 - path: ../../htdocs/product/canvas/service/tpl/card_view.tpl.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/canvas/service/tpl/card_view.tpl.php - - message: "#^Negated boolean expression is always true\\.$#" count: 2 @@ -23615,11 +22995,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/card.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/stock/card.php - - message: "#^Variable \\$pricemin might not be defined\\.$#" count: 1 @@ -24670,11 +24045,6 @@ parameters: count: 1 path: ../../htdocs/projet/activity/perday.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/activity/perday.php - - message: "#^Variable \\$ref might not be defined\\.$#" count: 1 @@ -24735,11 +24105,6 @@ parameters: count: 1 path: ../../htdocs/projet/activity/perweek.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/activity/perweek.php - - message: "#^Variable \\$ref might not be defined\\.$#" count: 1 @@ -24750,11 +24115,6 @@ parameters: count: 4 path: ../../htdocs/projet/admin/project.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 2 - path: ../../htdocs/projet/admin/project.php - - message: "#^Variable \\$obj might not be defined\\.$#" count: 6 @@ -25070,11 +24430,6 @@ parameters: count: 2 path: ../../htdocs/projet/element.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 4 - path: ../../htdocs/projet/element.php - - message: "#^Variable \\$total_time in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -25590,11 +24945,6 @@ parameters: count: 7 path: ../../htdocs/projet/tasks/time.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 7 - path: ../../htdocs/projet/tasks/time.php - - message: "#^Variable \\$result might not be defined\\.$#" count: 1 @@ -25955,31 +25305,6 @@ parameters: count: 1 path: ../../htdocs/public/opensurvey/index.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 10 - path: ../../htdocs/public/opensurvey/index.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 4 - path: ../../htdocs/public/opensurvey/index.php - - - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" - count: 2 - path: ../../htdocs/public/opensurvey/index.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 12 - path: ../../htdocs/public/opensurvey/index.php - - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 3 - path: ../../htdocs/public/opensurvey/index.php - - message: "#^Variable \\$error might not be defined\\.$#" count: 2 @@ -27835,11 +27160,6 @@ parameters: count: 1 path: ../../htdocs/societe/admin/societe.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 6 - path: ../../htdocs/societe/admin/societe.php - - message: "#^Variable \\$sql might not be defined\\.$#" count: 1 @@ -28335,11 +27655,6 @@ parameters: count: 1 path: ../../htdocs/societe/document.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 9 - path: ../../htdocs/societe/list.php - - message: "#^Variable \\$newcardbutton might not be defined\\.$#" count: 1 @@ -28415,11 +27730,6 @@ parameters: count: 1 path: ../../htdocs/societe/price.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 3 - path: ../../htdocs/societe/price.php - - message: "#^Variable \\$prodcustprice might not be defined\\.$#" count: 36 @@ -28435,11 +27745,6 @@ parameters: count: 1 path: ../../htdocs/societe/price.php - - - message: "#^Variable \\$arrayofmassactions might not be defined\\.$#" - count: 1 - path: ../../htdocs/societe/project.php - - message: "#^Variable \\$parameters might not be defined\\.$#" count: 1 @@ -28910,11 +28215,6 @@ parameters: count: 1 path: ../../htdocs/takepos/invoice.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 13 - path: ../../htdocs/takepos/invoice.php - - message: "#^Variable \\$printer might not be defined\\.$#" count: 6 @@ -28960,26 +28260,6 @@ parameters: count: 1 path: ../../htdocs/takepos/pay.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 4 - path: ../../htdocs/takepos/phone.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 6 - path: ../../htdocs/takepos/phone.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 26 - path: ../../htdocs/takepos/phone.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 6 - path: ../../htdocs/takepos/phone.php - - message: "#^Variable \\$user might not be defined\\.$#" count: 1 @@ -28990,61 +28270,11 @@ parameters: count: 1 path: ../../htdocs/takepos/receipt.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 9 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 9 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 23 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 3 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/takepos/receipt.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 3 - path: ../../htdocs/takepos/reduction.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 9 - path: ../../htdocs/takepos/reduction.php - - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 1 - path: ../../htdocs/takepos/reduction.php - - message: "#^Right side of && is always true\\.$#" count: 1 path: ../../htdocs/takepos/send.php - - - message: "#^Variable \\$mysoc might not be defined\\.$#" - count: 1 - path: ../../htdocs/takepos/send.php - - message: "#^Variable \\$user might not be defined\\.$#" count: 1 @@ -29055,36 +28285,16 @@ parameters: count: 1 path: ../../htdocs/takepos/split.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/split.php - - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 9 - path: ../../htdocs/takepos/split.php - - message: "#^Variable \\$invoice might not be defined\\.$#" count: 4 path: ../../htdocs/takepos/split.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 7 - path: ../../htdocs/takepos/split.php - - message: "#^Variable \\$placeid might not be defined\\.$#" count: 2 path: ../../htdocs/takepos/split.php - - - message: "#^Variable \\$user might not be defined\\.$#" - count: 4 - path: ../../htdocs/takepos/split.php - - message: "#^Variable \\$fontlist might not be defined\\.$#" count: 3 @@ -29135,16 +28345,6 @@ parameters: count: 1 path: ../../htdocs/theme/eldy/global.inc.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 17 - path: ../../htdocs/theme/eldy/global.inc.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 1 - path: ../../htdocs/theme/eldy/global.inc.php - - message: "#^Variable \\$theme might not be defined\\.$#" count: 22 @@ -29330,11 +28530,6 @@ parameters: count: 1 path: ../../htdocs/theme/md/manifest.json.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 3 - path: ../../htdocs/theme/md/manifest.json.php - - message: "#^Variable \\$path might not be defined\\.$#" count: 1 @@ -30390,11 +29585,6 @@ parameters: count: 1 path: ../../htdocs/webportal/class/webportalpropal.class.php - - - message: "#^Variable \\$form might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/admin/index.php - - message: "#^Function createActionComm\\(\\) has parameter \\$actioncomm with no value type specified in iterable type array\\.$#" count: 1 @@ -30415,26 +29605,11 @@ parameters: count: 1 path: ../../htdocs/webservices/server_actioncomm.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_actioncomm.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/webservices/server_actioncomm.php - - message: "#^Parameter \\#1 \\$authentication of function check_authentication expects array\\{login\\: string, password\\: string, entity\\: int\\|null, dolibarrkey\\: string\\}, array\\{login\\: string, entity\\: int\\} given\\.$#" count: 1 path: ../../htdocs/webservices/server_category.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/webservices/server_category.php - - message: "#^Function createContact\\(\\) has parameter \\$contact with no value type specified in iterable type array\\.$#" count: 1 @@ -30460,16 +29635,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_contact.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_contact.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 3 - path: ../../htdocs/webservices/server_contact.php - - message: "#^Function createInvoice\\(\\) has parameter \\$invoice with no value type specified in iterable type array\\.$#" count: 1 @@ -30495,11 +29660,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_invoice.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_invoice.php - - message: "#^Variable \\$newobject might not be defined\\.$#" count: 3 @@ -30540,31 +29700,11 @@ parameters: count: 1 path: ../../htdocs/webservices/server_order.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 2 - path: ../../htdocs/webservices/server_order.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_order.php - - message: "#^Variable \\$socid might not be defined\\.$#" count: 1 path: ../../htdocs/webservices/server_order.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_other.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_payment.php - - message: "#^Function createProductOrService\\(\\) has parameter \\$product with no value type specified in iterable type array\\.$#" count: 1 @@ -30605,16 +29745,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_productorservice.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_productorservice.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_productorservice.php - - message: "#^Function createProject\\(\\) has parameter \\$project with no value type specified in iterable type array\\.$#" count: 1 @@ -30635,16 +29765,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_project.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_project.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_project.php - - message: "#^Function getSupplierInvoice\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -30655,11 +29775,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_supplier_invoice.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_supplier_invoice.php - - message: "#^Function createThirdParty\\(\\) has parameter \\$thirdparty with no value type specified in iterable type array\\.$#" count: 1 @@ -30700,16 +29815,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_thirdparty.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_thirdparty.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_thirdparty.php - - message: "#^Function createUserFromThirdparty\\(\\) has parameter \\$thirdpartywithuser with no value type specified in iterable type array\\.$#" count: 1 @@ -30720,16 +29825,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_user.php - - - message: "#^Variable \\$db might not be defined\\.$#" - count: 1 - path: ../../htdocs/webservices/server_user.php - - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 4 - path: ../../htdocs/webservices/server_user.php - - message: "#^Method Website\\:\\:compareFichierModifie\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 0ea933f2e6d..eec23542fba 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/admin/fichinter_xcal.php b/htdocs/admin/fichinter_xcal.php index a8b194a72f7..2b9b7b5590c 100644 --- a/htdocs/admin/fichinter_xcal.php +++ b/htdocs/admin/fichinter_xcal.php @@ -38,6 +38,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ if (!$user->admin) { diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 142e52faec9..a3e9b993621 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -303,7 +303,7 @@ if (empty($mysoc->country_code)) { $localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc); $s = 10 / 3; - $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); + $tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print ' x '.$langs->trans("Quantity").": ".$qty; print ' - '.$langs->trans("VAT").': '.$vat.'%'; @@ -314,13 +314,13 @@ if (empty($mysoc->country_code)) { } if (getDolGlobalString('MAIN_ADD_MORE_EXAMPLE_IN_ACCURANCY_SETUP')) { - $qty = '1.234'; + $qty = 1.234; $vattxt = $vat.($vatarray['code'] ? ' ('.$vatarray['code'].')' : ''); $localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc); $s = 10 / 3; - $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); + $tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print ' x '.$langs->trans("Quantity").": ".$qty; print ' - '.$langs->trans("VAT").': '.$vat.'%'; @@ -340,7 +340,7 @@ if (empty($mysoc->country_code)) { $s = 10 / 3; $qty = 1; $vat = 10; - $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); + $tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print ' x '.$langs->trans("Quantity").": ".$qty; print ' - '.$langs->trans("VAT").": ".$vat.'%'; @@ -349,7 +349,7 @@ if (empty($mysoc->country_code)) { $s = 10 / 3; $qty = 2; $vat = 10; - $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); + $tmparray = calcul_price_total($qty, (float) price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print ' x '.$langs->trans("Quantity").": ".$qty; print ' - '.$langs->trans("VAT").": ".$vat.'%'; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 2e661cfb14e..3067b1b839a 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -41,6 +41,8 @@ $supportedoauth2array = getSupportedOauth2Array(); * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 122fc490b9b..8d38539d65d 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -38,6 +38,8 @@ $action = GETPOST('action', 'aZ09'); * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_db_pass */ // Load translation files required by the page diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 8d1e973e871..ed039b164b7 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -34,6 +34,8 @@ require '../../main.inc.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_db_pass */ $langs->load("admin"); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 861eabc4368..d5df6d50bd7 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -36,6 +36,8 @@ require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php"; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index aa415d073d6..93a6a7e8035 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -38,6 +38,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index dff7e4959cf..34719bd6755 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -53,6 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 43f76e0c01f..44124a27e49 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 2020a00714a..65f175f1c94 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 7885424ffe4..4cd75354d10 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -47,6 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 2cc7f733314..5d20a92b03d 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 814534f514a..0887b7cf2ae 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -46,6 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 3845eec6839..80103961416 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -48,6 +48,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.clas * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 935c7eaed84..866cb459058 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -54,6 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 0352ec06a7b..5c00ce691eb 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -59,6 +59,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 2148730cfff..8fb5b654a62 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -41,6 +41,7 @@ @phan-var-force string $hideref '; /** + * @var Conf $conf * @var CommonObject $object * @var CommonObject $this * @var DoliDB $db diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index 8516dba6e0a..19c79357081 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -24,6 +24,7 @@ * \brief Code for actions on comments pages */ /** + * @var Conf $conf * @var DoliDB $db * @var Translate $langs * @var User $user diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php index 5b168d6e780..4e99c6c3661 100644 --- a/htdocs/core/actions_lineupdown.inc.php +++ b/htdocs/core/actions_lineupdown.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 @@ -27,7 +28,13 @@ // $object must be defined // $langs must be defined // $hidedetails, $hidedesc, $hideref must de defined - +/** + * @var CommonObject $object + * @var Conf $conf + * @var Translate $langs + * + * @var string $action + */ if ($action == 'up' && $permissiontoedit) { $object->line_up(GETPOST('rowid')); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 7703079192d..82c1605937e 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -24,9 +24,18 @@ // Variable $confirm must be defined. // If variable $permissiontoadd is defined, we check it is true. Note: A test on permission should already have been done into the restrictedArea() method called by parent page. -//var_dump($upload_dir); -//var_dump($upload_dirold); - +/** + * @var CommonObject $object + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + * + * @var string $upload_dir + * @var string $upload_dirold + * @var string $confirm + */ // Protection to understand what happen when submitting files larger than post_max_size if (GETPOSTINT('uploadform') && empty($_POST) && empty($_FILES)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6ac811c6075..6712c76b077 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -38,12 +38,14 @@ // $confirm /** * @var CommonObject $object + * @var Conf $conf * @var DoliDB $db * @var ExtraFields $extrafields * @var HookManager $hookmanager * @var Translate $langs * @var User $user * + * @var string $dolibarr_main_url_root * @var ?string $permissiontoread * @var ?string $permissiontodelete * @var ?string $permissiontoclose @@ -151,6 +153,7 @@ if (!$error && $massaction == 'confirm_presend') { foreach ($toselect as $toselectid) { $objecttmp = new $objectclass($db); // we must create new instance because instance is saved into $listofobjectref array for future use '@phan-var-force CommonObject $objecttmp'; + /** @var CommonObject $objecttmp */ $result = $objecttmp->fetch($toselectid); if ($result > 0) { $listofobjectid[$toselectid] = $toselectid; @@ -159,21 +162,27 @@ if (!$error && $massaction == 'confirm_presend') { $tmpobjectid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); if ($objecttmp->element == 'societe') { '@phan-var-force Societe $objecttmp'; + /** @var Societe $objecttmp */ $tmpobjectid = $objecttmp->id; } elseif ($objecttmp->element == 'contact') { '@phan-var-force Contact $objecttmp'; + /** @var Contact $objecttmp */ $tmpobjectid = $objecttmp->id; } elseif ($objecttmp->element == 'expensereport') { '@phan-var-force ExpenseReport $objecttmp'; + /** @var ExpenseReport $objecttmp */ $tmpobjectid = $objecttmp->fk_user_author; } elseif ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { '@phan-var-force Partnership $objecttmp'; + /** @var Partnership $objecttmp */ $tmpobjectid = $objecttmp->fk_member; } elseif ($objecttmp->element == 'holiday') { '@phan-var-force Holiday $objecttmp'; + /** @var Holiday $objecttmp */ $tmpobjectid = $objecttmp->fk_user; } elseif ($objecttmp->element == 'conferenceorboothattendee') { '@phan-var-force ConferenceOrBoothAttendee $objecttmp'; + /** @var ConferenceOrBoothAttendee $objecttmp */ $tmpobjectid = $objecttmp->id; } if (empty($tmpobjectid)) { @@ -182,6 +191,7 @@ if (!$error && $massaction == 'confirm_presend') { if ($objectclass == 'Facture') { '@phan-var-force Facture $objecttmp'; + /** @var Facture $objecttmp */ $tmparraycontact = array(); $tmparraycontact = $objecttmp->liste_contact(-1, 'external', 0, 'BILLING'); if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { @@ -191,6 +201,7 @@ if (!$error && $massaction == 'confirm_presend') { } } elseif ($objectclass == 'CommandeFournisseur') { '@phan-var-force CommandeFournisseur $objecttmp'; + /** @var CommandeFournisseur $objecttmp */ $tmparraycontact = array(); $tmparraycontact = $objecttmp->liste_contact(-1, 'external', 0, 'CUSTOMER'); if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { @@ -299,19 +310,19 @@ if (!$error && $massaction == 'confirm_presend') { foreach ($listofobjectref[$thirdpartyid] as $objectid => $objectobj) { //var_dump($thirdpartyid.' - '.$objectid.' - '.$objectobj->statut); - if ($objectclass == 'Propal' && $objectobj->statut == Propal::STATUS_DRAFT) { + if ($objectclass == 'Propal' && $objectobj->status == Propal::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; $resaction .= '
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction', $objectobj->ref).'

'; continue; // Payment done or started or canceled } - if ($objectclass == 'Commande' && $objectobj->statut == Commande::STATUS_DRAFT) { + if ($objectclass == 'Commande' && $objectobj->status == Commande::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; $resaction .= '
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction', $objectobj->ref).'

'; continue; } - if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT) { + if ($objectclass == 'Facture' && $objectobj->status == Facture::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; $resaction .= '
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction', $objectobj->ref).'

'; @@ -374,10 +385,11 @@ if (!$error && $massaction == 'confirm_presend') { if (empty($sendto)) { if ($objectobj->element == 'societe') { + /** @var Societe $objectobj */ $objectobj->thirdparty = $objectobj; // Hack so following code is compatible when objectobj is a thirdparty } - //print "No recipient for thirdparty ".$objectobj->thirdparty->name; + // print "No recipient for thirdparty ".$objectobj->thirdparty->name; $nbignored++; if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id])) { $resaction .= '
'.$langs->trans('NoRecipientEmail', $objectobj->thirdparty->name).'

'; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 9787f86bfe2..541bc8f9995 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -38,6 +38,7 @@ * @var Societe $mysoc * @var Translate $langs * + * @var string $dolibarr_main_url_root * @var string $action * @var ?string $subject */ diff --git a/htdocs/core/filemanagerdol/connectors/php/config.inc.php b/htdocs/core/filemanagerdol/connectors/php/config.inc.php index bb6fe4c6127..0704d51f615 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.inc.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.inc.php @@ -2,6 +2,7 @@ /* * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2010 Frederico Caldeira Knabben + * Copyright (C) 2024 Frédéric France * * == BEGIN LICENSE == * @@ -32,6 +33,14 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal // is a security hole if anybody can access without // being an authenticated user. require_once '../../../../main.inc.php'; + +/** + * @var Conf $conf + * + * @var string $dolibarr_main_data_root + * @var string $dolibarr_main_url_root + */ + $uri = preg_replace('/^http(s?):\/\//i', '', $dolibarr_main_url_root); $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine if ($pos == '/') { diff --git a/htdocs/core/js/timepicker.js.php b/htdocs/core/js/timepicker.js.php index 92e03085ea3..5db75245711 100644 --- a/htdocs/core/js/timepicker.js.php +++ b/htdocs/core/js/timepicker.js.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Laurent Destailleur + * 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 @@ -46,7 +47,10 @@ if (!defined('NOREQUIREAJAX')) { session_cache_limiter('public'); require_once '../../main.inc.php'; - +/** + * @var DoliDB $db + * @var Translate $langs + */ /* * View */ diff --git a/htdocs/core/lib/format_cards.lib.php b/htdocs/core/lib/format_cards.lib.php index 2f3e48f8b83..1f722315d89 100644 --- a/htdocs/core/lib/format_cards.lib.php +++ b/htdocs/core/lib/format_cards.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin * 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 @@ -27,6 +28,9 @@ global $_Avery_Labels; +/** + * @var DoliDB $db + */ // Unit of metric are defined into field 'metric' in mm. // To get into inch, just /25.4 diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index dafdcd558e3..8fabcbc981d 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1196,7 +1196,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1232,7 +1232,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1261,13 +1261,13 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : ''); $totalvat .= ' '; if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') { - $totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl; + $totalvat .= vatrate($tvaval['vatrate'], true).$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') { $totalvat .= $tvaval['vatcode'].$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; + $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1300,7 +1300,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1338,7 +1338,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index dc54ad4afd3..d0deb123c00 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1472,7 +1472,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1509,7 +1509,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1538,13 +1538,13 @@ class pdf_crabe extends ModelePDFFactures $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : ''); $totalvat .= ' '; if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') { - $totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl; + $totalvat .= vatrate($tvaval['vatrate'], true).$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') { $totalvat .= $tvaval['vatcode'].$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; + $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1576,7 +1576,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1611,7 +1611,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php index 4ebdcc2518f..6916499daf6 100644 --- a/htdocs/core/modules/oauth/generic_oauthcallback.php +++ b/htdocs/core/modules/oauth/generic_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -37,6 +37,14 @@ if (!defined('NOLOGIN') && $forlogin) { // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index ae0464db61e..c2febb3597a 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,15 @@ // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index a39eac8ab6c..741d1137001 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -41,6 +41,15 @@ if (!defined('NOLOGIN') && $forlogin) { // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/microsoft2_oauthcallback.php b/htdocs/core/modules/oauth/microsoft2_oauthcallback.php index 8e980171813..29a494fc467 100644 --- a/htdocs/core/modules/oauth/microsoft2_oauthcallback.php +++ b/htdocs/core/modules/oauth/microsoft2_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,15 @@ // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/microsoft_oauthcallback.php b/htdocs/core/modules/oauth/microsoft_oauthcallback.php index 435f3206b35..6fbee4bc049 100644 --- a/htdocs/core/modules/oauth/microsoft_oauthcallback.php +++ b/htdocs/core/modules/oauth/microsoft_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,15 @@ // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index bd592e42a73..a61dc56161f 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -2,6 +2,7 @@ /* Copyright (C) 2022 Laurent Destailleur * Copyright (C) 2019 Thibault FOUCART * 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 @@ -26,6 +27,15 @@ // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 32338d822eb..2608a7b6fb6 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,15 @@ // Load Dolibarr environment require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_roott + */ + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index cc93012cc06..57deb7b1d4a 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Laurent Destailleur - * 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 @@ -17,7 +17,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var CommonObject $object + * + * @var string $blocname + */ // Protection to avoid direct call of template if (empty($blocname)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index 9bad8c41a25..ff8902fc24d 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2017 Charlie Benke * Copyright (C) 2022 Gauthier VERDOL + * 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 @@ -16,7 +17,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var CommonObject $this + * @var Conf $conf + */ // 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/don/card.php b/htdocs/don/card.php index b1f6055557b..344c9813d81 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -50,6 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index 177623d7398..7e9c7b2a076 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -1,10 +1,10 @@ - * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2021 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2015-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2019-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 @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/actions_massactions.inc.php + * \file htdocs/core/actions_massactions.inc.php * \brief Code for actions done with massaction button (send by email, merge pdf, delete, ...) */ @@ -35,8 +35,18 @@ // $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined - - +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * + * @var string $massaction + * @var string $objectclass + * @var ?string $diroutputmassaction + * @var ?string $uploaddir + * @var string[] $toselect + * @var array $parameters + */ // Protection if (empty($objectclass) || empty($uploaddir)) { dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined'); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 60e03b4686f..db17bc6d43a 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -53,6 +53,7 @@ if (isModEnabled("product") || isModEnabled("service")) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index f546588671e..1fa27d33f34 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -54,8 +54,11 @@ if (isModEnabled('accounting')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 08f97099d85..b1486b6a516 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -55,6 +55,7 @@ if (isModEnabled('accounting')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8e2a6fcaef2..e020d268795 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -70,6 +70,7 @@ if (isModEnabled('variants')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ @@ -84,8 +85,8 @@ if (isModEnabled('incoterm')) { // Get Parameters $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$action = GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 3f669a3bcac..95ed76f15c4 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -54,6 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 3f2e25786cf..fee314d3ff1 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -50,6 +50,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 4318e11a178..f303c8fdd5d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -68,6 +68,7 @@ if (isModEnabled('accounting')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 5cd66192750..ddbf73ccf39 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -44,6 +44,7 @@ if (isModEnabled('project')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 458dcaefca2..e32e0d0057c 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -54,6 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 98f54425de7..0f9d53b18d3 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -39,6 +39,7 @@ if (isModEnabled('project')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 27d15e8f418..edaa432226a 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 749e47c6e4f..84b419a19af 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -45,6 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skillrank.lib.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ @@ -61,7 +62,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'evaluationcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOSTINT('lineid'); +$lineid = GETPOSTINT('lineid'); // Initialize a technical objects $object = new Evaluation($db); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 533a635c672..092309f72a3 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -42,6 +42,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 8d536e85147..845978f19f2 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -148,15 +148,16 @@ $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $step = (GETPOST('step') ? GETPOST('step') : 1); $import_name = GETPOST('import_name'); -$hexa = GETPOST('hexa'); +$hexa = GETPOST('hexa'); $importmodelid = GETPOSTINT('importmodelid'); $excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2); -$endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); +$endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); $separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml', 3) : ''); $enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " $charset = GETPOST('charset', 'aZ09'); $separator_used = str_replace('\t', "\t", $separator); +$relativepath = ''; $objimport = new Import($db); $objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport)); diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 72f109cdf7d..0ea1ec87528 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -7,6 +7,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015-2016 Raphaël Doursenaud * 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 @@ -30,8 +31,15 @@ define('ALLOWED_IF_UPGRADE_UNLOCK_FOUND', 1); include_once 'inc.php'; - -global $langs; +/** + * @var Translate $langs + * + * @var string $dolibarr_main_db_host + * @var string $dolibarr_main_db_port + * @var string $dolibarr_main_db_name + * @var string $dolibarr_main_db_user + * @var string $dolibarr_main_db_pass + */ $err = 0; $allowinstall = 0; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index fb3400578a3..d3d8364b810 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Vincent de Grandpré +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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,6 +31,18 @@ include_once 'inc.php'; if (file_exists($conffile)) { include_once $conffile; } +/** + * @var Conf $conf + * @var Translate $langs + * + * @var string $dolibarr_main_document_root + * @var string $dolibarr_main_db_host + * @var string $dolibarr_main_db_port + * @var string $dolibarr_main_db_name + * @var string $dolibarr_main_db_user + * @var string $dolibarr_main_db_pass + */ + require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; include_once $dolibarr_main_document_root.'/core/lib/images.lib.php'; require_once $dolibarr_main_document_root.'/core/class/extrafields.class.php'; @@ -40,8 +52,8 @@ $step = 2; $ok = 0; -// Cette page peut etre longue. On augmente le delai autorise. -// Ne fonctionne que si on est pas en safe_mode. +// This page may be long. We are increasing the time allowed. +// Only works if not in safe_mode. $err = error_reporting(); error_reporting(0); @set_time_limit(120); diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 8ea8ec2745a..c9b1b8fd032 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -46,6 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/intracommreport/lib/intracommreport.lib.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index 5c6d2f91289..e7f2973f444 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -1,7 +1,7 @@ - * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2015 Florian HENRY + * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -45,9 +45,9 @@ require DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; * @var User $user */ -$mens = price2num(GETPOST('mens')); -$capital = price2num(GETPOST('capital')); -$rate = price2num(GETPOST('rate')); +$mens = (float) price2num(GETPOST('mens')); +$capital = (float) price2num(GETPOST('capital')); +$rate = (float) price2num(GETPOST('rate')); $echance = GETPOSTINT('echeance'); $nbterm = GETPOSTINT('nbterm'); diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 57e548c1ba9..9660c33544d 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) ---Replace with your own copyright and developer email--- * * This program is free software: you can redistribute it and/or modify diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index c6a2cadf4bd..7b6a0436080 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2017 Charlie Benke * 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,14 @@ * along with this program. If not, see . */ +/** + * @var CommonObject $this + * @var Conf $conf + * @var Form $form + * @var MoLine $line + * @var Translate $langs + */ + // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -27,6 +36,8 @@ if (empty($conf) || !is_object($conf)) { global $db, $langs; +/** @var DoliDB $db */ + if (empty($form) || !is_object($form)) { $form = new Form($db); } @@ -42,6 +53,7 @@ if ($line->fk_product > 0) { $tmpproduct->fetch($line->fk_product); } $tmpbom = new BOM($db); +$res = 0; if ($line->fk_bom_child > 0) { $res = $tmpbom->fetch($line->fk_bom_child); } diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index b38085ba0f9..8425ace9b4a 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 9d408437f31..d4344ed3d7a 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -15,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -24,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index 2caf95cd468..839831e8848 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.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 @@ -14,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -23,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php index 1730a75a7c3..b370c02c234 100644 --- a/htdocs/product/canvas/product/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_view.tpl.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 @@ -14,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -23,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ ?> @@ -71,7 +77,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); trans("Nature"); ?> -finished); ?> +finished); ?> diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index aa41af1d35a..68416c2df09 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -15,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -24,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> diff --git a/htdocs/product/canvas/service/tpl/card_edit.tpl.php b/htdocs/product/canvas/service/tpl/card_edit.tpl.php index d67a9cfa964..0e727137da4 100644 --- a/htdocs/product/canvas/service/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_edit.tpl.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 @@ -14,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -23,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> diff --git a/htdocs/product/canvas/service/tpl/card_view.tpl.php b/htdocs/product/canvas/service/tpl/card_view.tpl.php index 402c604d9ff..9707694dd36 100644 --- a/htdocs/product/canvas/service/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_view.tpl.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 @@ -14,7 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var User $user + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -23,6 +28,7 @@ if (empty($conf) || !is_object($conf)) { $object = $GLOBALS['object']; +/** @var Product $object */ ?> diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 44face6073d..7477e386fe7 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -50,6 +50,7 @@ if (isModEnabled('project')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 84a076406d3..814bd3678f1 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 31fdd9d6e9f..804b4afc8f5 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 33cd254af90..a7f799d74aa 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 1a16873f7aa..dc2114cf7b4 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 88204127119..61c051de453 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -112,6 +112,7 @@ if (isModEnabled('stocktransfer')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 816faf3797e..3a933522bff 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -46,6 +46,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/public/opensurvey/index.php b/htdocs/public/opensurvey/index.php index 54d98ebccf5..58df00bdfec 100644 --- a/htdocs/public/opensurvey/index.php +++ b/htdocs/public/opensurvey/index.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 @@ -34,6 +35,14 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } +/** + * @var Conf $conf + * @var DoliDB $db + * @var Societe $mysoc + * @var Translate $langs + * + * @var string $dolibarr_main_url_root + */ // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 7e247f6803c..1cc8ea5bdc6 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 4064f1468ed..00ee9149fa3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -55,6 +55,7 @@ if (isModEnabled('category')) { * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 0c583cf3a66..60a3a5dc971 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 51b66eba985..c5edfa37504 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -57,6 +57,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index f076caa96f0..81659654315 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.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 @@ -45,7 +46,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + */ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // Decode place if it is an order from a customer phone $place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : GETPOST('place', 'aZ09'); diff --git a/htdocs/takepos/printbox.php b/htdocs/takepos/printbox.php index 0f3ea149e8c..0163cf6f5f1 100644 --- a/htdocs/takepos/printbox.php +++ b/htdocs/takepos/printbox.php @@ -1,6 +1,7 @@ * Copyright (C) 2020 Laurent Destailleur + * 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 @@ -42,6 +43,10 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ global $langs, $db; diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index cbce49031ab..7929a4ab5c7 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -6,6 +6,7 @@ * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2021 Nicolas ZABOURI * 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 @@ -49,7 +50,14 @@ if (!isset($action)) { require '../main.inc.php'; // If this file is called from send.php avoid load again } include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ $langs->loadLangs(array("main", "bills", "cashdesk", "companies")); $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 1d38e63977d..047fb89610c 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -1,6 +1,7 @@ * Copyright (C) 2023 Christophe Battarel + * 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 @@ -42,6 +43,14 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 2c585982419..9d85490f77d 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -48,6 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; /** * @var Conf $conf * @var DoliDB $db + * @var Societe $mysoc * @var Translate $langs * @var User $user */ diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php index b499ef0874e..7f6796db0b0 100644 --- a/htdocs/takepos/split.php +++ b/htdocs/takepos/split.php @@ -42,7 +42,12 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * @var User $user + */ $langs->loadLangs(array("main", "bills", "cashdesk", "banks")); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bf01f855f6a..61fb9c01a8d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -29,6 +29,9 @@ $leftmenuwidth = 240; // Variables defined in style.css.php (includes this file). /** + * @var Conf $conf + * @var Translate $langs + * * @var int<0,1> $dol_hide_topmenu * @var int<0,1> $dol_hide_leftmenu * @var int<0,1> $dol_optimize_smallscreen diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index 2703fe873ea..8ba030bf774 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -5,6 +5,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2018 Ferran Marcet + * 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 @@ -54,7 +55,9 @@ if (!defined('NOSESSION')) { } require_once __DIR__.'/../../main.inc.php'; - +/** + * @var Conf $conf + */ top_httphead('text/json'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. if (empty($dolibarr_nocache)) { diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index c1a39edc713..78aff8bf733 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; /** * @var Conf $conf * @var DoliDB $db + * @var Form $form * @var HookManager $hookmanager * @var Translate $langs * @var User $user diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 857adf69a7f..bd85865ceee 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -54,7 +54,10 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"; require_once DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"; require_once DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call ActionComm webservices interfaces"); diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index e4a89f8acd4..e938039ba8b 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2012 JF FERRY * 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 @@ -48,7 +49,10 @@ require '../main.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"; - +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 65541c3296e..294d10f4130 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -51,6 +51,10 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php"; require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"; require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Contact webservices interfaces"); diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index f8507f29abd..ba07779693b 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2016 Juanjo Menent * 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 @@ -53,6 +54,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 7568c59ccc9..a599cb5b2a7 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -52,7 +52,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; - +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index ee3c0bbdeed..e0ebae55a3c 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.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 @@ -50,6 +51,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 610b3eba278..451a57f2162 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.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 @@ -56,6 +57,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index fa674f187c7..8ce21e5ccda 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -56,7 +56,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 4dbd456bcde..f504b7cc16f 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -52,6 +52,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 35b42195e73..102399a28be 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.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 @@ -49,6 +50,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 68c96e94716..9800b86a8b9 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -52,6 +52,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call Dolibarr webservices interfaces"); diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 43ce6b9769c..7567532ba99 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -52,6 +52,10 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ dol_syslog("Call User webservices interfaces"); From 178d748cad1af7f9461eb76d4f305abf531b7321 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 6 Nov 2024 20:15:15 +0100 Subject: [PATCH 2/2] Qual: Fix phan/phpstan notices in class files (part 5) (#31617) * Qual: fix commonstickergen..don.class * Fix notifications for pdf_paiement...cronjob.class * Qual: Fix notifications for emailcollector..price_parser.class * Ensure that NULL is used in the database when fk's are 0/empty * Fix notifications for pdf_paiement...cronjob.class * Cope with updated phpstan, and make fk_origin_stock int in multiple locations --- build/phpstan/phpstan-baseline.neon | 5 + dev/tools/phan/baseline.txt | 95 +++++++------------ dev/tools/phan/config.php | 2 +- htdocs/adherents/list.php | 4 +- .../compta/paiement/class/paiement.class.php | 2 +- htdocs/core/class/commonobject.class.php | 5 +- .../class/commonstickergenerator.class.php | 4 +- .../action/doc/pdf_standard_actions.class.php | 2 +- .../modules/cheque/doc/pdf_blochet.class.php | 11 ++- .../doc/doc_generic_member_odt.class.php | 3 +- .../member/doc/pdf_standard_member.class.php | 2 +- .../doc/pdf_standardlabel.class.php | 4 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 4 +- .../modules/rapport/pdf_paiement.class.php | 44 ++++++++- ..._50_modNotification_Notification.class.php | 5 +- ...terface_50_modTicket_TicketEmail.class.php | 21 ++-- .../interface_80_modStripe_Stripe.class.php | 8 +- htdocs/cron/class/cronjob.class.php | 27 +++++- .../datapolicy/class/datapolicycron.class.php | 6 ++ htdocs/don/class/don.class.php | 8 +- .../class/emailcollector.class.php | 2 + .../class/emailcollectoraction.class.php | 27 ++++++ .../class/emailcollectorfilter.class.php | 24 +++++ .../class/expeditionligne.class.php | 6 +- .../class/expeditionlinebatch.class.php | 40 ++++++-- .../class/paymentexpensereport.class.php | 3 +- .../fichinter/class/fichinterstats.class.php | 15 +++ .../class/api_supplier_invoices.class.php | 2 +- htdocs/fourn/class/fournisseur.class.php | 3 +- .../class/fournisseur.commande.class.php | 54 ++++++++--- .../fourn/class/fournisseur.facture.class.php | 8 +- htdocs/fourn/class/paiementfourn.class.php | 25 +++-- htdocs/fourn/commande/card.php | 12 +-- htdocs/imports/class/import.class.php | 5 +- .../class/intracommreport.class.php | 18 +++- htdocs/loan/class/loan.class.php | 2 +- htdocs/loan/class/loanschedule.class.php | 35 ++++++- htdocs/loan/class/paymentloan.class.php | 10 +- .../mailmanspip/class/mailmanspip.class.php | 8 +- .../class/api_multicurrencies.class.php | 3 +- .../class/multicurrency.class.php | 6 +- htdocs/opensurvey/card.php | 6 +- .../class/opensurveysondage.class.php | 21 ++-- .../class/partnershiputils.class.php | 1 + htdocs/product/class/product.class.php | 29 +++--- htdocs/product/class/productbatch.class.php | 16 +++- .../class/propalmergepdfproduct.class.php | 10 ++ htdocs/product/composition/card.php | 2 +- .../class/price_global_variable.class.php | 11 ++- .../price_global_variable_updater.class.php | 33 ++++++- .../class/price_parser.class.php | 34 +++++-- .../class/html.formcardwebportal.class.php | 2 +- 52 files changed, 510 insertions(+), 225 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 92e8952a6a9..008c94b8dce 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -21470,6 +21470,11 @@ parameters: count: 1 path: ../../htdocs/opensurvey/class/opensurveysondage.class.php + - + message: "#^Property Opensurveysondage\\:\\:\\$status \\(int\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: ../../htdocs/opensurvey/class/opensurveysondage.class.php + - message: "#^Left side of && is always true\\.$#" count: 1 diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index a9276985563..a84e2e28268 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,46 +9,49 @@ */ return [ // # Issue statistics: - // PhanUndeclaredProperty : 560+ occurrences + // PhanUndeclaredProperty : 570+ occurrences // PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanPluginUnknownPropertyType : 330+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 330+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 230+ occurrences - // PhanPossiblyUndeclaredVariable : 180+ occurrences - // PhanPluginUnknownArrayMethodParamType : 160+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 320+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 220+ occurrences + // PhanPluginUnknownPropertyType : 200+ occurrences // PhanTypeMismatchProperty : 160+ occurrences + // PhanPluginUnknownArrayMethodParamType : 140+ occurrences + // PhanPossiblyUndeclaredVariable : 120+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences - // PhanPluginUnknownArrayFunctionParamType : 60+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 60+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences - // PhanPluginEmptyStatementIf : 45+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 50+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences - // PhanTypeInvalidDimOffset : 35+ occurrences + // PhanPluginEmptyStatementIf : 35+ occurrences + // PhanPluginUnknownArrayFunctionParamType : 35+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 30+ occurrences + // PhanTypeInvalidDimOffset : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences - // PhanPluginUnknownArrayPropertyType : 15+ occurrences // PhanPluginUnknownObjectMethodCall : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanEmptyForeach : 10+ occurrences + // PhanPluginUnknownArrayPropertyType : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences - // PhanPluginSuspiciousParamPosition : 9 occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences - // PhanPossiblyNullTypeMismatchProperty : 8 occurrences + // PhanPluginSuspiciousParamPosition : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences - // PhanPluginConstantVariableNull : 6 occurrences // PhanParamTooMany : 5 occurrences + // PhanPossiblyNullTypeMismatchProperty : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences // PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences + // 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 'file_suppressions' => [ @@ -119,7 +122,7 @@ return [ 'htdocs/commande/list.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'], 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -163,7 +166,6 @@ return [ 'htdocs/compta/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/paiement/cheque/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement_charge.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/paiement_vat.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -256,7 +258,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', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], + 'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginRedundantReturnComment', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'], 'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/core/db/sqlite3.class.php' => ['PhanTypeMismatchReturn'], 'htdocs/core/extrafieldsinimport.inc.php' => ['PhanTypeMismatchArgumentNullableInternal'], @@ -269,14 +271,12 @@ return [ 'htdocs/core/lib/images.lib.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/pdf.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanPluginUnknownArrayPropertyType'], + 'htdocs/core/lib/xcal.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/barcode/doc/phpbarcode.modules.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanParamTooFew', 'PhanPluginSuspiciousParamPosition'], 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], @@ -299,8 +299,6 @@ return [ 'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/member/doc/doc_generic_member_odt.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -308,8 +306,6 @@ return [ 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/modules/printing/modules_printing.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'], - 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanParamTooMany'], 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], @@ -318,7 +314,6 @@ return [ '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'], - 'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], @@ -364,14 +359,10 @@ return [ 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_50_modNotification_Notification.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'], - 'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'], 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp'], - 'htdocs/cron/class/cronjob.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -387,7 +378,7 @@ return [ 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], + 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/don/class/paymentdonation.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -403,9 +394,7 @@ return [ 'htdocs/ecm/class/htmlecm.form.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], - 'htdocs/emailcollector/class/emailcollectoraction.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/emailcollector/class/emailcollectorfilter.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -416,7 +405,6 @@ return [ 'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/expedition/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/document.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -425,7 +413,6 @@ return [ 'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -437,17 +424,14 @@ return [ 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/fourn/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/class/fournisseur.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/fourn/class/paiementfourn.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/commande/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/fourn/commande/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimAssignment', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], 'htdocs/fourn/commande/contact.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/commande/dispatch.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/commande/document.php' => ['PhanUndeclaredGlobalVariable'], @@ -486,7 +470,6 @@ return [ 'htdocs/hrm/position_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/hrm/skill_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/imports/class/import.class.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/imports/import.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], @@ -498,21 +481,16 @@ return [ 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'], 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/loan/class/loan.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/class/loanschedule.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/loan/class/paymentloan.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/loan/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/loan/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/loan/note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/loan/schedule.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/mailmanspip/class/mailmanspip.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/margin/customerMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'], @@ -523,18 +501,17 @@ return [ 'htdocs/mrp/mo_production.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/mrp/tpl/originproductline.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'], 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], - 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'], + 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/partnership/class/api_partnerships.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/partnership/class/partnershiputils.class.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'], @@ -544,14 +521,9 @@ return [ 'htdocs/product/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/class/product.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/product/class/productbatch.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], 'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/product/class/propalmergepdfproduct.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/product/document.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/dynamic_price/class/price_global_variable.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], - 'htdocs/product/dynamic_price/class/price_global_variable_updater.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], - 'htdocs/product/dynamic_price/class/price_parser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -634,7 +606,7 @@ return [ 'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], @@ -673,7 +645,6 @@ return [ 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -691,7 +662,7 @@ return [ 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'], + 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'], 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], @@ -718,7 +689,7 @@ return [ 'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'], - 'htdocs/ticket/class/actions_ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/ticket/class/actions_ticket.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'], 'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'], @@ -743,7 +714,7 @@ return [ 'htdocs/webhook/target_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/webportal/class/context.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/webportal/class/controller.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index c0d92b3a75d..9cea818bac6 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -223,7 +223,7 @@ return [ 'simplify_ast' => true, 'analyzed_file_extensions' => ['php','inc'], 'globals_type_map' => [ - '_Avery_Labels' => 'array', + '_Avery_Labels' => 'array', 'action' => 'string', 'actioncode' => 'string', 'badgeStatus0' => 'string', diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0b9441d8e68..0e349810944 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -203,8 +203,8 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), - 'position' => $val['position'], + 'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => (int) $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 93a2a9abf8a..900a9b16101 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -876,7 +876,7 @@ class Paiement extends CommonObject $fac = new Facture($this->db); $fac->fetch($key); $fac->fetch_thirdparty(); - if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) { // Not yet done for this thirdparty + if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) { // Not yet done for this thirdparty @phan-suppress-current-line PhanPossiblyUndeclaredVariable $result = $acc->add_url_line( $bank_line_id, $fac->thirdparty->id, diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0b84bf328e..c12e9dee9c9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -344,7 +344,7 @@ abstract class CommonObject public $newref; /** - * @var int|array The object's status. Use status instead. + * @var null|int|array The object's status. Use status instead. * @deprecated Use $status instead. * @see $status * @see setStatut(), $status @@ -352,9 +352,10 @@ abstract class CommonObject public $statut; /** - * @var int|array The object's status (an int). + * @var null|int|array The object's status (an int). * Or an array listing all the potential status of the object: * array: int of the status => translated label of the status + * In some classes status must be able to be null. * See for example the Account class. * @see setStatut() */ diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 4e722c21dc3..8dc612176d8 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -107,12 +107,12 @@ abstract class CommonStickerGenerator extends CommonDocGenerator protected $_COUNTY = 1; protected $_First = 1; /** - * @var array{name:string,paper-size:string,orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float} + * @var ?array{name:string,paper-size:'custom'|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float} */ public $Tformat; /** - * @var array + * @var array */ public $_Avery_Labels; // phpcs:enable diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index bf3d192070b..83b6a9ec13b 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -104,7 +104,7 @@ class pdf_standard_actions public $marge_basse; /** - * @var array format + * @var array{0:float,1:float} format */ public $format; diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index d9fe8a453f1..a2ce99ae903 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -57,6 +57,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts */ public $line_per_page; + /** + * @var string + */ public $ref_ext; @@ -206,7 +209,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->Body($pdf, $pagenb, $pages, $outputlangs); // Pied de page - $this->_pagefoot($pdf, '', $outputlangs); + $this->_pagefoot($pdf, null, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod } @@ -422,10 +425,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param Object $object Object to show + * @param ?CommonObject $object Object to show * @param Translate $outputlangs Object lang for output - * @param int $hidefreetext 1=Hide free text - * @return mixed + * @param int<0,1> $hidefreetext 1=Hide free text + * @return int */ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index b50619460fe..6834dcfd7e7 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -295,6 +295,7 @@ class doc_generic_member_odt extends ModelePDFMember $result = $object->fetch_contact($arrayidcontact[0]); } + $contactobject = null; // Recipient name if (!empty($usecontact)) { // We can use the company of contact instead of thirdparty company @@ -426,7 +427,7 @@ class doc_generic_member_odt extends ModelePDFMember * @param CommonObject $object member * @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/member/doc/pdf_standard_member.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php index 1842964ea5f..74373fa4e99 100644 --- a/htdocs/core/modules/member/doc/pdf_standard_member.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -67,7 +67,7 @@ class pdf_standard_member extends CommonStickerGenerator * * @param TCPDF $pdf PDF reference * @param Translate $outputlangs Output langs - * @param array $param Associative array containing label content and optional parameters + * @param array $param Associative array containing label content and optional parameters * @return void */ public function addSticker(&$pdf, $outputlangs, $param) diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 01064493aad..d8713404fdc 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -39,7 +39,7 @@ class pdf_standardlabel extends CommonStickerGenerator * * @param TCPDF $pdf PDF reference * @param Translate $outputlangs Output langs - * @param array $param Associative array containing label content and optional parameters + * @param array $param Associative array containing label content and optional parameters * @return void */ public function addSticker(&$pdf, $outputlangs, $param) @@ -228,7 +228,7 @@ class pdf_standardlabel extends CommonStickerGenerator /** * Function to build PDF on disk, then output on HTTP stream. * - * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory for pdf file diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 5caf4e4e2b3..3faa66afc59 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -94,7 +94,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator * * @param TCPDF $pdf PDF reference * @param Translate $outputlangs Output langs - * @param array $param Associative array containing label content and optional parameters + * @param array{textleft:string,textheader:string,textfooter:string,textright:string,code:string,encoding:string,is2d:int<0,1>|bool} $param Associative array containing label content and optional parameters * @return void */ public function addSticker(&$pdf, $outputlangs, $param) @@ -251,7 +251,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator /** * Function to build PDF on disk, then output on HTTP stream. * - * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param array|bool}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory for pdf file diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 99d0d83d13e..f47553703c9 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -37,22 +37,55 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; */ class pdf_paiement extends CommonDocGenerator { + /** + * @var int + */ public $tab_top; + /** + * @var int + */ public $line_height; + /** + * @var int + */ public $line_per_page; + /** + * @var int + */ public $tab_height; + /** + * @var int + */ public $posxdate; + /** + * @var int + */ public $posxpaymenttype; + /** + * @var int + */ public $posxinvoice; + /** + * @var int + */ public $posxbankaccount; + /** + * @var int + */ public $posxinvoiceamount; + /** + * @var int + */ public $posxpaymentamount; + /** + * @var string + */ public $doc_type; /** @@ -208,6 +241,8 @@ class pdf_paiement extends CommonDocGenerator $result = $this->db->query($sql); if ($result) { $numpaiement = $this->db->num_rows($result); + } else { + $numpaiement = 0; } // number of bill @@ -464,7 +499,7 @@ class pdf_paiement extends CommonDocGenerator * * @param TCPDF $pdf PDF object * @param int $page Page - * @param array $lines Array of lines + * @param array> $lines Array of lines * @param Translate $outputlangs Object langs * @return void */ @@ -477,13 +512,14 @@ class pdf_paiement extends CommonDocGenerator $pdf->SetFont('', '', $default_font_size - 1); $oldprowid = 0; $total_page = 0; + $total_mod = 0; + $mod = 0; $total = 0; $pdf->SetFillColor(220, 220, 220); $yp = 0; $numlines = count($lines); if (($this->doc_type == 'client' && getDolGlobalString('PAYMENTS_REPORT_GROUP_BY_MOD')) || ($this->doc_type == 'fourn' && getDolGlobalString('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'))) { $mod = $lines[0][2]; - $total_mod = 0; } for ($j = 0; $j < $numlines; $j++) { $i = $j; @@ -528,9 +564,9 @@ class pdf_paiement extends CommonDocGenerator $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1); $yp += 5; - $total_page += $lines[$j][9]; + $total_page += (float) $lines[$j][9]; if (($this->doc_type == 'client' && getDolGlobalString('PAYMENTS_REPORT_GROUP_BY_MOD')) || ($this->doc_type == 'fourn' && getDolGlobalString('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'))) { - $total_mod += $lines[$j][9]; + $total_mod += (float) $lines[$j][9]; } } diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index b9a009f7c0a..5bbd3995e15 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -33,6 +33,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; */ class InterfaceNotification extends DolibarrTriggers { + /** + * @var string[] + */ public $listofmanagedevents = array(); /** @@ -102,7 +105,7 @@ class InterfaceNotification extends DolibarrTriggers /** * Return list of events managed by notification module * - * @return array Array of events managed by notification module + * @return array Array of events managed by notification module */ public function getListOfManagedEvents() { diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index faa556da235..7576164ae30 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -198,14 +198,15 @@ class InterfaceTicketEmail extends DolibarrTriggers $contactid = empty($object->context['contactid']) ? 0 : $object->context['contactid']; $res = 0; + $contactObj = null; if (!empty($contactid)) { - $contact = new Contact($this->db); - $res = $contact->fetch($contactid); + $contactObj = new Contact($this->db); + $res = $contactObj->fetch($contactid); } - if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) { - $sendto = $contact->email; + if ($contactObj !== null && !empty($contactObj->email) && !empty($contactObj->statut)) { + $sendto = $contactObj->email; } elseif (!empty($object->fk_soc)) { $object->fetch_thirdparty(); $sendto = $object->thirdparty->email; @@ -256,13 +257,14 @@ class InterfaceTicketEmail extends DolibarrTriggers $contactid = empty($object->context['contactid']) ? 0 : $object->context['contactid']; $res = 0; + $contactObj = null; if ($contactid > 0) { // TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty' // Refuse email if not - $contact = new Contact($this->db); - $res = $contact->fetch($contactid); - if (! in_array($contact, $linked_contacts)) { + $contactObj = new Contact($this->db); + $res = $contactObj->fetch($contactid); + if (! in_array($contactObj, $linked_contacts)) { $error_msg = $langs->trans('Error'). ': '; $error_msg .= $langs->transnoentities('TicketWrongContact'); setEventMessages($error_msg, [], 'errors'); @@ -272,8 +274,8 @@ class InterfaceTicketEmail extends DolibarrTriggers } $sendto = ''; - if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) { - $sendto = $contact->email; + if ($contactObj !== null && $res > 0 && !empty($contactObj->email) && !empty($contactObj->statut)) { + $sendto = $contactObj->email; } elseif (!empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) { // if sending to all contacts or sending to contacts while mass closing $temp_emails = []; @@ -350,6 +352,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $trackid = 'tic'.$object->id; + $old_MAIN_MAIL_AUTOCOPY_TO = null; if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) { $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO'); $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 4099ae40390..89ab8a634c4 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -206,10 +206,10 @@ class InterfaceStripe extends DolibarrTriggers } // If payment mode is linked to Stripe, we update/delete Stripe too - if ($action == 'COMPANYPAYMENTMODE_CREATE' && $object->type == 'card') { - // For creation of credit card, we do not create in Stripe automatically - } - if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card' && $object instanceof CompanyPaymentMode) { + //if ($action == 'COMPANYPAYMENTMODE_CREATE' && $object instanceof CompanyPaymentMode && $object->type == 'card') { + // For creation of credit card, we do not create in Stripe automatically + //} + if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object instanceof CompanyPaymentMode && $object->type == 'card') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); if (!empty($object->stripe_card_ref)) { diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index d3dfb5f6b92..b91eb248c34 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -73,12 +73,33 @@ class Cronjob extends CommonObject * @var string Job command */ public $command; + /** + * @var null|string + */ public $classesname; + /** + * @var null|string + */ public $objectname; + /** + * @var null|string + */ public $methodename; + /** + * @var null|string + */ public $params; + /** + * @var null|string + */ public $md5params; + /** + * @var null|string + */ public $module_name; + /** + * @var null|int|string + */ public $priority; /** @@ -515,9 +536,9 @@ class Cronjob extends CommonObject * @param string $sortfield Sort field * @param int $limit Limit page * @param int $offset Offset ppage - * @param int $status Display active or not (-1=no filter, 0=not active, 1=active, 2=archived) - * @param string|array $filter Filter USF. - * @param int $processing Processing or not (-1=all, 0=not in progress, 1=in progress) + * @param int<-1,2> $status Display active or not (-1=no filter, 0=not active, 1=active, 2=archived) + * @param string|array $filter Filter USF. + * @param int<-1,1> $processing Processing or not (-1=all, 0=not in progress, 1=in progress) * @return int if KO: <0 || if OK: >0 */ public function fetchAll(string $sortorder = 'DESC', string $sortfield = 't.rowid', int $limit = 0, int $offset = 0, int $status = 1, $filter = '', int $processing = -1) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index e1d0012f3c1..d2b8d88a1fa 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -34,8 +34,14 @@ class DataPolicyCron */ public $db; + /** + * @var string + */ public $error; + /** + * @var string + */ public $output; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 87860eb2e9f..eac251a8cf0 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -477,10 +477,10 @@ class Don extends CommonObject } } - if (!$error && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_DONATION'))) { - //$res = $this->setValid($user); - //if ($res < 0) $error++; - } + //if (!$error && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_DONATION'))) { + //$res = $this->setValid($user); + //if ($res < 0) $error++; + //} if (!$error) { $this->db->commit(); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 26da8f04930..e4dceae159f 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1179,6 +1179,8 @@ class EmailCollector extends CommonObject return -1; } + $client = null; + $sourcedir = $this->source_directory; $targetdir = ($this->target_directory ? $this->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 9a36b208cda..7cbcd917661 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -84,15 +84,42 @@ class EmailCollectorAction extends CommonObject 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'Enabled')), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $fk_emailcollector; + /** + * @var string + */ public $type; + /** + * @var string + */ public $actionparam; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var int + */ public $position; + /** + * @var string + */ public $import_key; + /** + * @var int + */ public $status; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index fd6495d28e7..cc099cc3240 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -85,14 +85,38 @@ class EmailCollectorFilter extends CommonObject 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '1', 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'Enabled')), ); + /** + * @var int + */ public $rowid; + /** + * @var int + */ public $fk_emailcollector; + /** + * @var string + */ public $type; + /** + * @var string + */ public $rulevalue; + /** + * @var int + */ public $fk_user_creat; + /** + * @var int + */ public $fk_user_modif; + /** + * @var string + */ public $import_key; + /** + * @var int + */ public $status; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/expedition/class/expeditionligne.class.php b/htdocs/expedition/class/expeditionligne.class.php index 888c953f7a3..35d305d3d92 100644 --- a/htdocs/expedition/class/expeditionligne.class.php +++ b/htdocs/expedition/class/expeditionligne.class.php @@ -511,8 +511,8 @@ class ExpeditionLigne extends CommonObjectLine $qty = price2num($this->qty); $remainingQty = 0; $batch = null; - $batch_id = null; - $expedition_batch_id = null; + $batch_id = 0; + $expedition_batch_id = 0; if (is_array($this->detail_batch)) { // array of ExpeditionLineBatch if (count($this->detail_batch) > 1) { dol_syslog(get_class($this).'::update only possible for one batch', LOG_ERR); @@ -605,7 +605,7 @@ class ExpeditionLigne extends CommonObjectLine $shipmentLot->sellby = $lot->sellby; $shipmentLot->entrepot_id = $this->detail_batch->entrepot_id; $shipmentLot->qty = $this->detail_batch->qty; - $shipmentLot->fk_origin_stock = $batch_id; + $shipmentLot->fk_origin_stock = (int) $batch_id; if ($shipmentLot->create($this->id) < 0) { $this->errors = $shipmentLot->errors; $error++; diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php index a1270b3b1c0..7bce8575ff8 100644 --- a/htdocs/expedition/class/expeditionlinebatch.class.php +++ b/htdocs/expedition/class/expeditionlinebatch.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2013-2014 Cedric GROSS + * 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 @@ -38,18 +39,43 @@ class ExpeditionLineBatch extends CommonObject */ public $table_element = 'expeditiondet_batch'; + /** + * @var null|int|string + */ public $sellby; + /** + * @var null|int|string + */ public $eatby; + /** + * @var ?string + */ public $batch; /** * @var float Quantity */ public $qty; - public $dluo_qty; // deprecated, use qty + /** + * @var null|float + * @deprecated Use $qty + */ + public $dluo_qty; + /** + * @var int + */ public $entrepot_id; + /** + * @var int + */ public $fk_origin_stock; // rowid in llx_product_batch table (not useful) + /** + * @var int + */ public $fk_warehouse; // warehouse ID + /** + * @var int + */ public $fk_expeditiondet; @@ -134,10 +160,10 @@ class ExpeditionLineBatch extends CommonObject $sql .= $id_line_expdet; $sql .= ", ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : ("'".$this->db->idate($this->sellby))."'"); $sql .= ", ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : ("'".$this->db->idate($this->eatby))."'"); - $sql .= ", ".(!isset($this->batch) ? 'NULL' : ("'".$this->db->escape($this->batch)."'")); + $sql .= ", ".(!empty($this->batch) ? 'NULL' : ("'".$this->db->escape($this->batch)."'")); $sql .= ", ".(!isset($this->qty) ? ((!isset($this->dluo_qty)) ? 'NULL' : $this->dluo_qty) : $this->qty); // dluo_qty deprecated, use qty - $sql .= ", ".(!isset($this->fk_origin_stock) ? 'NULL' : $this->fk_origin_stock); - $sql .= ", ".(!isset($this->fk_warehouse) ? 'NULL' : $this->fk_warehouse); + $sql .= ", ".((int) $this->fk_origin_stock); + $sql .= ", ".(empty($this->fk_warehouse) ? 'NULL' : $this->fk_warehouse); $sql .= ")"; dol_syslog(__METHOD__, LOG_DEBUG); @@ -195,9 +221,9 @@ class ExpeditionLineBatch extends CommonObject /** * Retrieve all batch number detailed information of a shipment line * - * @param int $id_line_expdet id of shipment line - * @param int $fk_product If provided, load also detailed information of lot - * @return int|array -1 if KO, array of ExpeditionLineBatch if OK + * @param int $id_line_expdet id of shipment line + * @param int $fk_product If provided, load also detailed information of lot + * @return int<-1,-1>|ExpeditionLineBatch[] -1 if KO, array of ExpeditionLineBatch if OK */ public function fetchAll($id_line_expdet, $fk_product = 0) { diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index b3680728043..d8ecfc9962f 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -557,6 +557,7 @@ class PaymentExpenseReport extends CommonObject //Fix me field $total = $this->amount; + $amount = 0; if ($mode == 'payment_expensereport') { $amount = $total; @@ -569,7 +570,7 @@ class PaymentExpenseReport extends CommonObject $label, -$amount, $this->num_payment, - '', + 0, $user, $emetteur_nom, $emetteur_banque diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index c2f7fbd7638..fea319988a1 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -39,11 +39,26 @@ class FichinterStats extends Stats */ public $table_element; + /** + * @var int + */ public $socid; + /** + * @var int + */ public $userid; + /** + * @var string + */ public $from; + /** + * @var string + */ public $field; + /** + * @var string + */ public $where; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 7ad18c62597..06d9efaee2a 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -35,7 +35,7 @@ class SupplierInvoices extends DolibarrApi { /** * - * @var array $FIELDS Mandatory fields, checked when create and update object + * @var string[] $FIELDS Mandatory fields, checked when create and update object */ public static $FIELDS = array( 'socid', diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index cc774bcb1b4..c26b99bfc09 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2006 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * 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 @@ -190,7 +191,7 @@ class Fournisseur extends Societe /** * Return the suppliers list * - * @return array Array of suppliers + * @return array Array of suppliers */ public function ListArray() { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6592eee64a2..26613c10e0d 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -83,7 +83,7 @@ class CommandeFournisseur extends CommonOrder /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user - * @var integer + * @var int<0,1> */ public $restrictiononfksoc = 1; @@ -115,7 +115,7 @@ class CommandeFournisseur extends CommonOrder public $ref_fourn; /** - * @var int + * @var ?int<0,9> */ public $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Ordered/Process running -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially // -> 7=Canceled/Never received -> (reopen) 3=Process running @@ -123,6 +123,9 @@ class CommandeFournisseur extends CommonOrder // -> 9=Refused -> (reopen) 1=Validated // Note: billed or not is on another field "billed" + /** + * @var int<0,1> + */ public $billed; /** @@ -161,9 +164,18 @@ class CommandeFournisseur extends CommonOrder */ public $date_commande; - //For backward compatibility + /** + * @deprecated Provided or backward compatibility + * @var float + */ public $remise_percent; + /** + * @var int + */ public $methode_commande_id; + /** + * @var int + */ public $methode_commande; /** @@ -196,6 +208,9 @@ class CommandeFournisseur extends CommonOrder */ public $total_ttc; + /** + * @var int + */ public $source; /** @@ -259,6 +274,9 @@ class CommandeFournisseur extends CommonOrder */ public $user_approve_id2; + /** + * @var string + */ public $refuse_note; /** @@ -276,8 +294,13 @@ class CommandeFournisseur extends CommonOrder */ public $line; - // Add for supplier_proposal + /** + * @var CommonObject Add for supplier_proposal + */ public $origin; + /** + * @var int + */ public $origin_id; public $linked_objects = array(); @@ -969,7 +992,7 @@ class CommandeFournisseur extends CommonOrder if ($user->hasRight("fournisseur", "commande", "read")) { $datas['picto'] = ''.$langs->trans("SupplierOrder").''; - if (isset($this->statut)) { + if ($this->statut) { $datas['picto'] .= ' '.$this->getLibStatut(5); } if (!empty($this->ref)) { @@ -2523,7 +2546,7 @@ class CommandeFournisseur extends CommonOrder * @since 8.0 Return dispatched quantity (qty). * * @param int $status Filter on stats (-1 = no filter, 0 = lines draft to be approved, 1 = approved lines) - * @return array Array of lines + * @return array Array of lines */ public function getDispachedLines($status = -1) { @@ -2574,8 +2597,8 @@ class CommandeFournisseur extends CommonOrder * Set a delivery in database for this supplier order * * @param User $user User that input data - * @param integer $date Date of reception - * @param string $type Type of receipt ('tot' = total/done, 'par' = partial, 'nev' = never, 'can' = cancel) + * @param int $date Date of reception + * @param 'tot'|'par'|'nev'|'can' $type Type of receipt ('tot' = total/done, 'par' = partial, 'nev' = never, 'can' = cancel) * @param string $comment Comment * @return int Return integer <0 if KO, >0 if OK */ @@ -2586,6 +2609,7 @@ class CommandeFournisseur extends CommonOrder $result = 0; $error = 0; + $dispatchedlinearray = array(); dol_syslog(get_class($this)."::Livraison"); @@ -2925,9 +2949,9 @@ class CommandeFournisseur extends CommonOrder * @param int $info_bits Miscellaneous information * @param int $type Type of line (0=product, 1=service) * @param int $notrigger Disable triggers - * @param integer $date_start Date start of service - * @param integer $date_end Date end of service - * @param array $array_options Extrafields array + * @param int $date_start Date start of service + * @param int $date_end Date end of service + * @param array $array_options Extrafields array * @param int|null $fk_unit Code of the unit to use. Null to use the default one * @param int|float $pu_ht_devise Unit price in currency * @param string $ref_supplier Supplier ref @@ -3379,10 +3403,10 @@ class CommandeFournisseur extends CommonOrder * * @param string $modele Force template to use ('' to not force) * @param Translate $outputlangs Object lang to use for traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information * @return int Return integer < 0 if KO, 0 = no doc generated, > 0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 508ca50485c..d61324e552e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2595,8 +2595,8 @@ class FactureFournisseur extends CommonInvoice * Return list of replaceable invoices * Status valid or abandoned for other reason + not paid + no payment + not already replaced * - * @param int $socid Thirdparty id - * @return array|int Table of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + * @param int $socid Thirdparty id + * @return array|int<-1,-1> Table of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) * <0 if error */ public function list_replacable_supplier_invoices($socid = 0) @@ -2646,7 +2646,7 @@ class FactureFournisseur extends CommonInvoice * (validated + payment in progress) or classified (paid in full or paid in part) + not already replaced + not already having * * @param int $socid Thirdparty id - * @return array|int Table of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) + * @return array,paymentornot:int<0,1>}>|int<-1,-1> Table of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) * <0 if error */ public function list_qualified_avoir_supplier_invoices($socid = 0) @@ -2682,7 +2682,7 @@ class FactureFournisseur extends CommonInvoice } if ($qualified) { $paymentornot = ($obj->fk_paiementfourn ? 1 : 0); - $return[$obj->rowid] = array('ref' => $obj->ref, 'status' => $obj->fk_statut, 'type' => $obj->type, 'paye' => $obj->paye, 'paymentornot' => $paymentornot); + $return[$obj->rowid] = array('ref' => (string) $obj->ref, 'status' => (int) $obj->fk_statut, 'type' => (int) $obj->type, 'paye' => (int) $obj->paye, 'paymentornot' => (int) $paymentornot); } } diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 6afb37552c9..ab4185520ae 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -54,7 +54,10 @@ class PaiementFourn extends Paiement */ public $picto = 'payment'; - public $statut; //Status of payment. 0 = unvalidated; 1 = validated + /** + * @var int Status of payment. 0 = unvalidated; 1 = validated + */ + public $statut; // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement @@ -239,6 +242,8 @@ class PaiementFourn extends Paiement $totalamount = (float) price2num($totalamount); $totalamount_converted = (float) price2num($totalamount_converted); + $mtotal = 0; + $total = 0; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -302,7 +307,7 @@ class PaiementFourn extends Paiement // Insert one discount by VAT rate category require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); - $discount->fetch('', 0, $invoice->id); + $discount->fetch(0, 0, $invoice->id); if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here) $discount->discount_type = 1; // Supplier discount $discount->description = '(DEPOSIT)'; @@ -565,7 +570,7 @@ class PaiementFourn extends Paiement * Return list of supplier invoices the payment point to * * @param string $filter SQL filter. Warning: This value must not come from a user input. - * @return array|int Array of supplier invoice id | <0 si ko + * @return array|int<-1,-1> Array of supplier invoice id | <0 si ko */ public function getBillsArray($filter = '') { @@ -848,13 +853,13 @@ class PaiementFourn extends Paiement /** * Create a document onto disk according to template model. * - * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs Object lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs Object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e020d268795..5700fb86188 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1306,7 +1306,7 @@ if (empty($reshook)) { $object->origin_id = $originid; // Possibility to add external linked objects with hooks - $object->linked_objects [$object->origin] = $object->origin_id; + $object->linked_objects[$object->origin] = $object->origin_id; $other_linked_objects = GETPOST('other_linked_objects', 'array'); if (!empty($other_linked_objects)) { $object->linked_objects = array_merge($object->linked_objects, $other_linked_objects); @@ -1521,7 +1521,7 @@ if (empty($reshook)) { * View */ -$form = new Form($db); +$form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $productstatic = new Product($db); @@ -1934,7 +1934,7 @@ if ($action == 'create') { $text = $langs->trans('ConfirmValidateOrder', $newref); if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; - $notify = new Notify($db); + $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('ORDER_SUPPLIER_VALIDATE', $object->socid, $object); } @@ -1971,7 +1971,7 @@ if ($action == 'create') { $text = $langs->trans("ConfirmApproveThisOrder", $object->ref); if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; - $notify = new Notify($db); + $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid, $object); } @@ -2006,7 +2006,7 @@ if ($action == 'create') { ); if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; - $notify = new Notify($db); + $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('ORDER_SUPPLIER_CANCEL', $object->socid, $object); } @@ -2018,7 +2018,7 @@ if ($action == 'create') { $date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; - $notify = new Notify($db); + $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('ORDER_SUPPLIER_SUBMIT', $object->socid, $object); } diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 5e52c5c24ca..f9156a38115 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -453,16 +453,15 @@ class Import $this->errors[] = "Error ".$this->db->lasterror(); } + /* Not used. This is not a business object. To convert it we must herit from CommonObject if (!$error) { - if (!$notrigger) { - /* Not used. This is not a business object. To convert it we must herit from CommonObject // Call trigger $result=$this->call_trigger('IMPORT_DELETE',$user); if ($result < 0) $error++; // End call triggers - */ } } + */ // Commit or rollback if ($error) { diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 58609f85590..5bca6f0940a 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -142,7 +142,13 @@ class IntracommReport extends CommonObject * @var string */ public $type_export; + /** + * @var int|string + */ public $datec; + /** + * @var int + */ public $tms; // END MODULEBUILDER PROPERTIES @@ -152,8 +158,14 @@ class IntracommReport extends CommonObject */ public $label; + /** + * @var string + */ public $period; + /** + * @var string + */ public $declaration; /** @@ -391,6 +403,7 @@ class IntracommReport extends CommonObject return 0; } + $categ_fraisdeport = null; if ($exporttype == 'deb' && getDolGlobalInt('INTRACOMMREPORT_CATEG_FRAISDEPORT') > 0) { $categ_fraisdeport = new Categorie($this->db); $categ_fraisdeport->fetch(getDolGlobalString('INTRACOMMREPORT_CATEG_FRAISDEPORT')); @@ -530,7 +543,7 @@ class IntracommReport extends CommonObject * This function adds an item by retrieving the customs code of the product with the highest amount in the invoice * * @param SimpleXMLElement $declaration Reference declaration - * @param array $TLinesFraisDePort Data of shipping costs line + * @param Object[] $TLinesFraisDePort Data of shipping costs line * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) * @param Categorie $categ_fraisdeport category of shipping costs * @param int $i Line Id @@ -595,11 +608,12 @@ class IntracommReport extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE exporttype = '".$this->db->escape($this->type_export)."'"; $resql = $this->db->query($sql); + $res = null; if ($resql) { $res = $this->db->fetch_object($resql); } - return (string) ($res->max_declaration_number + 1); + return (string) ($res !== null ? ($res->max_declaration_number + 1) : ''); } /** diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index a4e2c7ed848..97c87aaf641 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -350,7 +350,7 @@ class Loan extends CommonObject // Get bank transaction lines for this loan include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $account = new Account($this->db); - $lines_url = $account->get_url('', $this->id, 'loan'); + $lines_url = $account->get_url(0, $this->id, 'loan'); // Delete bank urls foreach ($lines_url as $line_url) { diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 7e5d2f4f428..87ce150cd23 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -46,7 +46,13 @@ class LoanSchedule extends CommonObject */ public $fk_loan; + /** + * @var int + */ public $bank_account; + /** + * @var int + */ public $bank_line; /** @@ -59,9 +65,21 @@ class LoanSchedule extends CommonObject */ public $datep; + /** + * @var float[] + */ public $amounts = array(); // Array of amounts - public $amount_capital; // Total amount of payment + /** + * @var null|float|string Total amount of payment + */ + public $amount_capital; + /** + * @var null|float|string + */ public $amount_insurance; + /** + * @var null|float|string + */ public $amount_interest; /** @@ -102,12 +120,19 @@ class LoanSchedule extends CommonObject public $lines = array(); /** - * @deprecated + * @deprecated Use $amount, $amounts * @see $amount, $amounts + * @var float */ public $total; + /** + * @var string + */ public $type_code; + /** + * @var string + */ public $type_label; @@ -565,9 +590,9 @@ class LoanSchedule extends CommonObject /** * paimenttorecord * - * @param int $loanid Loan id - * @param int $datemax Date max - * @return array Array of id + * @param int $loanid Loan id + * @param int $datemax Date max + * @return int[] Array of id */ public function paimenttorecord($loanid, $datemax) { diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index d8b461ad7d8..98ba5d2bba2 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -78,7 +78,7 @@ class PaymentLoan extends CommonObject public $amount_insurance; /** - * @var float|int + * @var null|float|int */ public $amount_interest; @@ -116,6 +116,9 @@ class PaymentLoan extends CommonObject * @var string */ public $type_label; + /** + * @var int + */ public $chid; /** * @var string @@ -131,6 +134,9 @@ class PaymentLoan extends CommonObject * @var int */ public $bank_account; + /** + * @var int + */ public $bank_line; @@ -552,7 +558,7 @@ class PaymentLoan extends CommonObject $label, $total, $this->num_payment, - '', + 0, $user, $emetteur_nom, $emetteur_banque diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index c1b3a2aca46..128243ffe37 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -56,22 +56,22 @@ class MailmanSpip public $errors = array(); /** - * @var array + * @var array */ public $mladded_ok; /** - * @var array + * @var array */ public $mladded_ko; /** - * @var array + * @var array */ public $mlremoved_ok; /** - * @var array + * @var array */ public $mlremoved_ko; diff --git a/htdocs/multicurrency/class/api_multicurrencies.class.php b/htdocs/multicurrency/class/api_multicurrencies.class.php index 09ad43b6dbe..50dff7401cc 100644 --- a/htdocs/multicurrency/class/api_multicurrencies.class.php +++ b/htdocs/multicurrency/class/api_multicurrencies.class.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 @@ -144,7 +145,7 @@ class MultiCurrencies extends DolibarrApi public function getByCode($code) { $multicurrency = new MultiCurrency($this->db); - if (!$multicurrency->fetch('', $code)) { + if (!$multicurrency->fetch(0, $code)) { throw new RestException(404, 'Currency not found'); } diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index ebfbe3e433d..b02c662f514 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -713,13 +713,13 @@ class MultiCurrency extends CommonObject /** * Check in database if the current code already exists * - * @param string $code current code to search - * @return boolean True if exists, false if not exists + * @param string $code current code to search + * @return bool True if exists, false if not exists */ public function checkCodeAlreadyExists($code) { $currencytmp = new MultiCurrency($this->db); - if ($currencytmp->fetch('', $code) > 0) { + if ($currencytmp->fetch(0, $code) > 0) { return true; } else { return false; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 9b511e970e2..ef27448e34a 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -97,7 +97,7 @@ if (empty($reshook)) { accessforbidden(); } - $result = $object->delete($user, '', $numsondage); + $result = $object->delete($user, 0, $numsondage); header('Location: '.dol_buildpath('/opensurvey/list.php', 1)); exit(); @@ -217,7 +217,7 @@ $toutsujet = explode(",", $object->sujet); $listofanswers = array(); foreach ($toutsujet as $value) { $tmp = explode('@', $value); - $listofanswers[] = array('label'=>$tmp[0], 'format'=>(!empty($tmp[1]) ? $tmp[1] : 'checkbox')); + $listofanswers[] = array('label' => $tmp[0], 'format' => (!empty($tmp[1]) ? $tmp[1] : 'checkbox')); } $toutsujet = str_replace("@", "
", $toutsujet); $toutsujet = str_replace("°", "'", $toutsujet); @@ -350,7 +350,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai $url = $urlwithroot.'/public/opensurvey/studs.php?sondage='.$object->id_sondage; print ''; //if ($action != 'edit') { - print ajax_autoselect("opensurveyurl", $url, 'image'); +print ajax_autoselect("opensurveyurl", $url, 'image'); //} print ''; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 13327925dcc..3a952452586 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -157,6 +157,9 @@ class Opensurveysondage extends CommonObject * @var int|'' end date of survey */ public $date_fin = ''; + /** + * @var int + */ public $status; /** @@ -393,7 +396,7 @@ class Opensurveysondage extends CommonObject $sql .= " nom_admin=".(isset($this->nom_admin) ? "'".$this->db->escape($this->nom_admin)."'" : "null").","; $sql .= " titre=".(isset($this->title) ? "'".$this->db->escape($this->title)."'" : "null").","; $sql .= " date_fin=".(dol_strlen($this->date_fin) != 0 ? "'".$this->db->idate($this->date_fin)."'" : 'null').","; - $sql .= " status=".(isset($this->status) ? "'".$this->db->escape($this->status)."'" : "null").","; + $sql .= " status=".(!empty($this->status) ? (int) $this->status : "null").","; $sql .= " format=".(isset($this->format) ? "'".$this->db->escape($this->format)."'" : "null").","; $sql .= " mailsonde=".(isset($this->mailsonde) ? ((int) $this->mailsonde) : "null").","; $sql .= " allow_comments=".((int) $this->allow_comments).","; @@ -528,10 +531,10 @@ class Opensurveysondage extends CommonObject /** * Return a link to the object card (with optionally the picto) * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param int<0,1> $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ public function getNomUrl($withpicto = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) @@ -694,10 +697,10 @@ class Opensurveysondage extends CommonObject /** * Adds a comment to the poll * - * @param string $comment Comment content - * @param string $comment_user Comment author - * @param string $user_ip Comment author IP - * @return boolean False in case of the query fails, true if it was successful + * @param string $comment Comment content + * @param string $comment_user Comment author + * @param string $user_ip Comment author IP + * @return bool False in case of the query fails, true if it was successful */ public function addComment($comment, $comment_user, $user_ip = '') { diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index fa158f5b0df..d766fe86d54 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -552,6 +552,7 @@ class PartnershipUtils $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate("//a"); + '@phan-var-force DOMNodeList $hrefs'; for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f60226709c1..f7a21500f85 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -611,47 +611,47 @@ class Product extends CommonObject public $barcode_type_code; /** - * @var array{}|array{customers:int,nb:int,rows:int,qty:int} stats propales + * @var array{}|array{customers:int,nb:int,rows:int,qty:float} stats propales */ public $stats_propale = array(); /** - * @var array{}|array{customers:int,nb:int,rows:int,qty:int} stats orders + * @var array{}|array{customers:int,nb:int,rows:int,qty:float} stats orders */ public $stats_commande = array(); /** - * @var array{}|array{customers:int,nb:int,rows:int,qty:int} stats contracts + * @var array{}|array{customers:int,nb:int,rows:int,qty:float} stats contracts */ public $stats_contrat = array(); /** - * @var array{}|array{customers:int,nb:int,rows:int,qty:int} stats invoices + * @var array{}|array{customers:int,nb:int,rows:int,qty:float} stats invoices */ public $stats_facture = array(); /** - * @var array{}|array{suppliers:int,nb:int,rows:int,qty:int} stats supplier propales + * @var array{}|array{suppliers:int,nb:int,rows:int,qty:float} stats supplier propales */ public $stats_proposal_supplier = array(); /** - * @var array{}|array{suppliers:int,nb:int,rows:int,qty:int|float} stats supplier orders + * @var array{}|array{suppliers:int,nb:int,rows:int,qty:float} stats supplier orders */ public $stats_commande_fournisseur = array(); /** - * @var array{}|array{customers:int,nb:int,rows:int,qty:int} stats shipping + * @var array{}|array{customers:int,nb:int,rows:int,qty:float} stats shipping */ public $stats_expedition = array(); /** - * @var array{}|array{suppliers:int,nb:int,rows:int,qty:int|float} stats receptions + * @var array{}|array{suppliers:int,nb:int,rows:int,qty:float} stats receptions */ public $stats_reception = array(); /** - * @var array{}|array{customers_toconsume:int,nb_toconsume:int,qty_toconsume:int,customers_consumed:int,nb_consumed:int,qty_consumed:int,customers_toproduce:int,nb_toproduce:int,qty_toproduce:int,customers_produced:int,nb_produced:int,qty_produced:int} stats by role toconsume, consumed, toproduce, produced + * @var array{}|array{customers_toconsume:int,nb_toconsume:int,qty_toconsume:float,customers_consumed:int,nb_consumed:int,qty_consumed:float,customers_toproduce:int,nb_toproduce:int,qty_toproduce:float,customers_produced:int,nb_produced:int,qty_produced:float} stats by role toconsume, consumed, toproduce, produced */ public $stats_mo = array(); public $stats_bom = array(); @@ -687,7 +687,9 @@ class Product extends CommonObject */ public $nbphoto = 0; - //! Contains detail of stock of product into each warehouse + /** + * @var array Contains detail of stock of product into each warehouse + */ public $stock_warehouse = array(); /** @@ -1475,7 +1477,7 @@ class Product extends CommonObject $ObjBatch = new Productbatch($this->db); $ObjBatch->batch = $valueforundefinedlot; $ObjBatch->qty = ($ObjW->real - $qty_batch); - $ObjBatch->fk_product_stock = $ObjW->id; + $ObjBatch->fk_product_stock = (int) $ObjW->id; if ($ObjBatch->create($user, 1) < 0) { $error++; @@ -5287,7 +5289,7 @@ class Product extends CommonObject * Function recursive, used only by get_arbo_each_prod(), to build tree of subproducts into ->res * Define value of this->res * - * @param array $prod Products array + * @param array $prod Products array * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level @@ -5459,7 +5461,7 @@ class Product extends CommonObject /** * Return all parent products for current product (first level only) * - * @return array|int Array of product + * @return array,fk_product_type:int,entity:int,status:int,status_buy:int}>|int<-1,-1> Array of product * @see hasFatherOrChild() */ public function getFather() @@ -5476,6 +5478,7 @@ class Product extends CommonObject $prods = array(); while ($record = $this->db->fetch_array($res)) { // $record['id'] = $record['rowid'] = id of father + $prods[$record['id']] = array(); $prods[$record['id']]['id'] = $record['rowid']; $prods[$record['id']]['ref'] = $record['ref']; $prods[$record['id']]['label'] = $record['label']; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 681cac1ed8b..7ffc627d8b0 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -44,8 +44,14 @@ class Productbatch extends CommonObject */ public $element = 'productbatch'; + /** + * @var string + */ private static $_table_element = 'product_batch'; //!< Name of table without prefix where object is stored + /** + * @var ?int + */ public $fk_product_stock; /** @@ -222,8 +228,10 @@ class Productbatch extends CommonObject $this->cleanParam(); // TODO Check qty is ok for stock move. Negative may not be allowed. + /* if ($this->qty < 0) { } + */ // Update request $sql = "UPDATE ".$this->db->prefix().self::$_table_element." SET"; @@ -360,7 +368,7 @@ class Productbatch extends CommonObject $this->id = 0; $this->tms = dol_now(); - $this->fk_product_stock = ''; + $this->fk_product_stock = 0; $this->sellby = ''; $this->eatby = ''; $this->batch = ''; @@ -377,7 +385,7 @@ class Productbatch extends CommonObject private function cleanParam() { if (isset($this->fk_product_stock)) { - $this->fk_product_stock = (int) trim($this->fk_product_stock); + $this->fk_product_stock = (int) trim((string) $this->fk_product_stock); } if (isset($this->batch)) { $this->batch = trim($this->batch); @@ -466,7 +474,7 @@ class Productbatch extends CommonObject * @param int $fk_product_stock id product_stock for object * @param int $with_qty 1 = doesn't return line with 0 quantity * @param int $fk_product If set to a product id, get eatby and sellby from table llx_product_lot - * @return array|int Return integer <0 if KO, array of batch + * @return Productbatch[]|int Return integer <0 if KO, array of batch */ public static function findAll($dbs, $fk_product_stock, $with_qty = 0, $fk_product = 0) { @@ -569,7 +577,7 @@ class Productbatch extends CommonObject * @param int $qty_min [=NULL] Minimum quantity * @param string $sortfield [=NULL] List of sort fields, separated by comma. Example: 't1.fielda,t2.fieldb' * @param string $sortorder [=NULL] Sort order, separated by comma. Example: 'ASC,DESC'; - * @return int|array Return integer <0 if KO, array of batch + * @return int<-1,-1>|Productbatch[] Return integer <0 if KO, array of batch * * @throws Exception */ diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 44a0e5eaf14..cb8219c42d1 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2015 Florian HENRY * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,6 +62,9 @@ class Propalmergepdfproduct extends CommonObject * @var int Id user */ public $fk_user_mod; + /** + * @var int|'' + */ public $datec = ''; /** @@ -601,7 +605,13 @@ class PropalmergepdfproductLine extends CommonObjectLine */ public $fk_user_mod; + /** + * @var int|'' + */ public $datec = ''; + /** + * @var string + */ public $import_key; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 385ee700908..4129687cf59 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -358,7 +358,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''.$productstatic->getNomUrl(1, 'composition').''; print ''.dol_escape_htmltag($productstatic->label).''; - print ''.dol_escape_htmltag($value['qty']).''; + print ''.dol_escape_htmltag((string) $value['qty']).''; print ''; } } else { diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 6b81d780c49..3d92ca2ddd7 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ion Agorria * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,10 +229,10 @@ class PriceGlobalVariable /** * Delete object in database * - * @param int $rowid Row id of global variable - * @param User $user User that deletes - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param int $rowid Row id of global variable + * @param User $user User that deletes + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function delete($rowid, $user, $notrigger = 0) { @@ -239,6 +240,7 @@ class PriceGlobalVariable $this->db->begin(); + /* if (!$error) { if (!$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you @@ -250,6 +252,7 @@ class PriceGlobalVariable //// End call triggers } } + */ if (!$error) { $sql = "DELETE FROM ".$this->db->prefix().$this->table_element; diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index c303e2806c3..46dd34a8562 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -46,7 +46,13 @@ class PriceGlobalVariableUpdater */ public $errors = array(); + /** + * @var int[] + */ public $types = array(0, 1); //!< Updater types + /** + * @var int + */ public $update_min = 5; //!< Minimal update rate /** @@ -54,6 +60,9 @@ class PriceGlobalVariableUpdater */ public $id; + /** + * @var int + */ public $type; /** @@ -61,6 +70,9 @@ class PriceGlobalVariableUpdater */ public $description; + /** + * @var ?string + */ public $parameters; /** @@ -68,8 +80,17 @@ class PriceGlobalVariableUpdater */ public $fk_variable; - public $update_interval; //!< Interval in mins - public $next_update; //!< Next update timestamp + /** + * @var int Interval in mins + */ + public $update_interval; + /** + * @var int Next update timestamp + */ + public $next_update; + /** + * @var ?string + */ public $last_status; /** @@ -126,6 +147,7 @@ class PriceGlobalVariableUpdater if (!$error) { $this->id = $this->db->last_insert_id($this->db->prefix().$this->table_element); + /* if (!$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. @@ -135,6 +157,7 @@ class PriceGlobalVariableUpdater //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } + */ } // Commit or rollback @@ -561,9 +584,9 @@ class PriceGlobalVariableUpdater /** * Update next_update into database * - * @param string $next_update Next update to write - * @param User|null $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param int $next_update Next update to write + * @param ?User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ public function update_next_update($next_update, $user = null, $notrigger = 0) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 138f5927836..f69d63391e0 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.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,16 +33,29 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; */ class PriceParser { + /** + * @var DoliDB + */ protected $db; - // Limit of expressions per price + /** + * @var int Limit of expressions per price + */ public $limit = 100; - // The error that occurred when parsing price + /** + * @var array The error that occurred when parsing price + */ public $error_parser; - // The expression that caused the error + /** + * @var ?string The expression that caused the error + */ public $error_expr; - //The special char + /** + * @var string The special char + */ public $special_chr = "#"; - //The separator char + /** + * @var string The separator char + */ public $separator_chr = ";"; /** @@ -117,8 +131,8 @@ class PriceParser * Calculates price based on expression * * @param Product $product The Product object to get information - * @param String $expression The expression to parse - * @param array $values Strings to replaces + * @param string $expression The expression to parse + * @param array $values Strings to replace * @return int > 0 if OK, < 1 if KO */ public function parseExpression($product, $expression, $values) @@ -246,7 +260,7 @@ class PriceParser * Calculates product price based on product id and associated expression * * @param Product $product The Product object to get information - * @param array $extra_values Any additional values for expression + * @param array $extra_values Any additional values for expression * @return int > 0 if OK, < 1 if KO */ public function parseProduct($product, $extra_values = array()) @@ -293,7 +307,7 @@ class PriceParser * Calculates supplier product price based on product supplier price and associated expression * * @param ProductFournisseur $product_supplier The Product supplier object to get information - * @param array $extra_values Any additional values for expression + * @param array $extra_values Any additional values for expression * @return int > 0 if OK, < 1 if KO */ public function parseProductSupplier($product_supplier, $extra_values = array()) @@ -324,7 +338,7 @@ class PriceParser * * @param int $product_id The Product id to get information * @param string $expression The expression to parse - * @param array $extra_values Any additional values for expression + * @param array $extra_values Any additional values for expression * @return int > 0 if OK, < 1 if KO */ public function testExpression($product_id, $expression, $extra_values = array()) diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 8c2c1c58315..e261d93bbcf 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -207,7 +207,7 @@ class FormCardWebPortal $this->backtopagejsfields = $backtopagejsfields; $this->cancel = $cancel; $this->elementEn = $elementEn; - $this->id = $id; + $this->id = (int) $id; $this->object = $object; $this->permissiontoread = $permissiontoread; $this->permissiontoadd = $permissiontoadd;