From 80ef3041697991510743d474b23874a82bf7f440 Mon Sep 17 00:00:00 2001 From: Mr-Wolf-GB Date: Mon, 12 Feb 2024 10:28:38 +0100 Subject: [PATCH] Fix phpstan fail test --- src/Countries/Tunisia.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Countries/Tunisia.php b/src/Countries/Tunisia.php index bc6fccb19..5675a8926 100644 --- a/src/Countries/Tunisia.php +++ b/src/Countries/Tunisia.php @@ -3,6 +3,7 @@ namespace Spatie\Holidays\Countries; use Carbon\CarbonImmutable; +use RuntimeException; class Tunisia extends Country { @@ -388,7 +389,7 @@ protected function getIslamicHolidays( $currentYearHolidays = is_array($holidays[$year]) ? $holidays[$year] : [$holidays[$year]]; foreach ($currentYearHolidays as $currentYearHoliday) { - $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}") + $currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "$year-$currentYearHoliday") ?: throw new RuntimeException('Date could not be created.'); $islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays(