From a21af126527caefbdb95f80c49400a9a72aec23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 16 Jun 2024 11:09:43 +0200 Subject: [PATCH] fix phpstan (#30043) * fix phpstan * fix phpstan * fix phpstan * fix phpdoc --------- Co-authored-by: Laurent Destailleur --- htdocs/core/modules/import/import_csv.modules.php | 8 +------- htdocs/core/modules/import/import_xlsx.modules.php | 8 +------- htdocs/core/modules/import/modules_import.php | 10 +++++++--- htdocs/imports/import.php | 3 ++- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 1 + htdocs/projet/activity/perweek.php | 2 +- 7 files changed, 14 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index d59db6ad759..1c5e913a9aa 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012-2016 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,13 +44,6 @@ class ImportCsv extends ModeleImports */ public $id; - /** - * @var string label - */ - public $label; - - public $extension; // Extension of files imported by driver - /** * Dolibarr version of driver * @var string diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 4a187166dea..8702997ecfb 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012-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 @@ -48,13 +49,6 @@ class ImportXlsx extends ModeleImports */ public $id; - /** - * @var string label - */ - public $label; - - public $extension; // Extension of files imported by driver - /** * Dolibarr version of driver * @var string diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index dc9bc76ac23..5e5a45163a1 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * 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 @@ -59,11 +60,14 @@ class ModeleImports public $id; /** - * @var string label + * @var string label of driver */ public $label; - public $extension; // Extension of files imported by driver + /** + * @var string Extension of files imported by driver + */ + public $extension; /** * Dolibarr version of driver @@ -75,7 +79,7 @@ class ModeleImports * PHP minimal version required by driver * @var array{0:int,1:int} */ - public $phpmin = array(); + public $phpmin = array(7, 0); /** * Label of external lib used by driver diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 5402667a2a3..00d059bc504 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2022 Charlene 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 @@ -476,7 +477,7 @@ if ($step == 2 && $datatoimport) { print ''; print $form->textwithpicto('', $langs->trans("DownloadEmptyExample").'.
'.$langs->trans("StarAreMandatory")); } else { - print dolPrintHtml($objmodelimport->drivererror[$key]); + print dolPrintHTML($objmodelimport->drivererror[$key]); } print ''; // Action button diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 09edf4a9032..24a7d63d36f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois - * 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 diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 60708d7a536..f20a5cd88bf 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois * 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 diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 4f31466ab1d..7d86383e671 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois - * 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