From 4187e87dc483132e4dd8e576b5e735b5f26694a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 5 Jan 2025 18:44:12 +0100 Subject: [PATCH] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/core/lib/pdf.lib.php | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 9650d6771b0..ad06da395d3 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -11526,12 +11526,6 @@ parameters: count: 1 path: ../../../htdocs/core/lib/order.lib.php - - - message: '#^Parameter \#2 \$addpercent of function vatrate expects bool, int given\.$#' - identifier: argument.type - count: 3 - path: ../../../htdocs/core/lib/pdf.lib.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a520e5424fb..23c1a643b54 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -13,7 +13,7 @@ * Copyright (C) 2019 Lenin Rivas * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2021-2022 Anthony Berton - * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2023-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1959,7 +1959,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) if (empty($hidedetails) || $hidedetails > 1) { $tmpresult = ''; - $tmpresult .= vatrate($object->lines[$i]->tva_tx, 0, $object->lines[$i]->info_bits, -1); + $tmpresult .= vatrate($object->lines[$i]->tva_tx, false, $object->lines[$i]->info_bits, -1); if (!getDolGlobalString('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) { if ($object->lines[$i]->total_localtax1 != 0) { if (preg_replace('/[\s0%]/', '', $tmpresult)) { @@ -1967,7 +1967,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) } else { $tmpresult = ''; } - $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax1_tx), 0); + $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax1_tx), false); } } if (!getDolGlobalString('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) { @@ -1977,7 +1977,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) } else { $tmpresult = ''; } - $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax2_tx), 0); + $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax2_tx), false); } } $tmpresult .= '%';