From f0ce1c7bd6bea4ea43f6dd3d0e72b13ab5a6f8ac Mon Sep 17 00:00:00 2001 From: Max Hausch Date: Tue, 12 May 2026 10:16:14 +0200 Subject: [PATCH] fix checking for correct formatter in durationDecimal (#5943) --- phpstan.neon | 5 ----- src/Utils/LocaleFormatter.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 8723f7dd..31025561 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3645,11 +3645,6 @@ parameters: count: 1 path: src/Utils/JavascriptFormatConverter.php - - - message: "#^Cannot call method format\\(\\) on NumberFormatter\\|null\\.$#" - count: 1 - path: src/Utils/LocaleFormatter.php - - message: "#^Cannot call method getTimestamp\\(\\) on DateTime\\|null\\.$#" count: 1 diff --git a/src/Utils/LocaleFormatter.php b/src/Utils/LocaleFormatter.php index 8245846e..0006c9e1 100644 --- a/src/Utils/LocaleFormatter.php +++ b/src/Utils/LocaleFormatter.php @@ -75,7 +75,7 @@ final class LocaleFormatter */ public function durationDecimal(Timesheet|int|string|null $duration): string { - if (null === $this->numberFormatter) { + if (null === $this->decimalFormatter) { $this->decimalFormatter = new NumberFormatter($this->locale, NumberFormatter::DECIMAL); $this->decimalFormatter->setAttribute(NumberFormatter::FRACTION_DIGITS, 2); }