Skip to content

Commit

Permalink
Update CarbonGermanHolidays.php
Browse files Browse the repository at this point in the history
Removed PHP lang warning
  • Loading branch information
micronax authored Sep 20, 2023
1 parent 1f1ca1f commit 8dad51a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Fgits/CarbonGermanHolidays/CarbonGermanHolidays.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function getHolidays($year, $states = self::ALL_STATES)
if (array_intersect([self::BERLIN, self::MECKLENBURG_VORPOMMERN], $states)) {
$holidays['Internationaler Frauentag'] = mktime(0, 0, 0, 3, 8, $year);
}

if (in_array(self::BRANDENBURG, $states)) {
$holidays['Ostersonntag'] = $easterSunday;
$holidays['Pfingstsonntag'] = strtotime('+49 days', $easterSunday);
Expand Down Expand Up @@ -219,14 +219,14 @@ public static function getHolidays($year, $states = self::ALL_STATES)
//$holidays['Walpurgisnacht'] = mktime(0, 0, 0, 4, 30, $year); // WTF
$holidays['Karsamstag'] = strtotime('-1 day', $easterSunday);
$holidays['Allerseelen'] = mktime(0, 0, 0, 11, 2, $year);
$holidays['Erntedankfest'] = mktime(0, 0, 0, 10, 7 - ($year + 5 + $year / 4) % 7, $year);
$holidays['Erntedankfest'] = mktime(0, 0, 0, 10, 7 - intval($year + 5 + $year / 4) % 7, $year);
$holidays['Volkstrauertag'] = strtotime('-3 days', $penanceDay);
$holidays['Totensonntag'] = strtotime('+4 days', $penanceDay);
}

if (in_array(self::SPECIAL_DAYS_4, $states)) {
$holidays['Sommerzeit (+1h)'] = mktime(0, 0, 0, 3, 31 - ($year + 4 + $year / 4) % 7, $year);
$holidays['Winterzeit (-1h)'] = mktime(0, 0, 0, 10, 31 - ($year + 1 + $year / 4) % 7, $year);
$holidays['Sommerzeit (+1h)'] = mktime(0, 0, 0, 3, 31 - intval($year + 4 + $year / 4) % 7, $year);
$holidays['Winterzeit (-1h)'] = mktime(0, 0, 0, 10, 31 - intval($year + 1 + $year / 4) % 7, $year);
}

return array_map(static fn($u) => (new \DateTime())->setTimestamp($u), $holidays);
Expand Down

0 comments on commit 8dad51a

Please sign in to comment.