From e0a8caec45b9d9dece3ec63a54a484bc7618d357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 7 Feb 2025 10:45:03 +0100 Subject: [PATCH] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/core/class/commondocgenerator.class.php | 6 +++--- .../modules/asset/doc/doc_generic_asset_odt.modules.php | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 4f95b73a9fb..deba1cbbeb2 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -8862,12 +8862,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/commondocgenerator.class.php - - - message: '#^Parameter \#2 \$array_to_fill of method CommonDocGenerator\:\:fill_substitutionarray_with_extrafields\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/commondocgenerator.class.php - - message: '#^Property CommonObject\:\:\$element \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 884639b234e..1f52f57bc31 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García * Copyright (C) 2016-2023 Charlene Benke - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW * Copyright (C) 2024 Mélina Joum @@ -1174,11 +1174,11 @@ abstract class CommonDocGenerator * Note that vars into substitutions array are formatted. * * @param CommonObject $object Object with extrafields (must have $object->array_options filled) - * @param array $array_to_fill Substitution array + * @param array $array_to_fill Substitution array * @param Extrafields $extrafields Extrafields object * @param string $array_key Prefix for name of the keys into returned array * @param Translate $outputlangs Lang object to use for output - * @return array Substitution array + * @return array Substitution array */ public function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) { diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 92792da10e8..9848d61fbbd 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2021 Philippe Grand - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -398,7 +398,7 @@ class doc_generic_asset_odt extends ModelePDFAsset } } // Replace tags of lines - $foundtagforlines = 1; + /*$foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); } catch (OdfExceptionSegmentNotFound $e) { @@ -431,7 +431,7 @@ class doc_generic_asset_odt extends ModelePDFAsset dol_syslog($this->error, LOG_WARNING); return -1; } - } + }*/ // Replace labels translated $tmparray = $outputlangs->get_translations_for_substitutions();