From ec2231cb1faab4a0252dd09c784bc35defb8f1a5 Mon Sep 17 00:00:00 2001 From: Maurice Breit Date: Mon, 19 Sep 2022 00:31:40 +0200 Subject: [PATCH] fix implicit float to int conversion On PHP 8.1, the following deprecation warning is shown: Deprecated: Implicit conversion from float 505.5 to int loses precision in /app/vendor/fgits/carbon-german-holidays/src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php on line 143 --- src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php b/src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php index a499df7..1986e06 100644 --- a/src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php +++ b/src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php @@ -140,7 +140,7 @@ public static function getHolidays($year, $states = self::ALL_STATES) $states = array($states); } - $penanceDay = mktime(0, 0, 0, 11, 22 - ($year - 1 + $year / 4) % 7, $year); + $penanceDay = mktime(0, 0, 0, 11, 22 - ($year - 1 + ((int) ((int) ($year / 4)) % 7)), $year); // For all states