Skip to content

Commit

Permalink
Adding state testing snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
arnebr committed Jan 21, 2024
1 parent a1844ab commit 16c90de
Show file tree
Hide file tree
Showing 18 changed files with 769 additions and 27 deletions.
36 changes: 9 additions & 27 deletions src/Countries/Germany.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ protected function variableHolidays(int $year): array
protected function regionHolidays(int $year): array
{
$easter = $this->easter($year);

switch ($this->region) {
case 'DE-BW':
return [

Check failure on line 67 in src/Countries/Germany.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Germany::regionHolidays() should return array<string, Carbon\CarbonImmutable> but returns array<string, Carbon\CarbonImmutable|string>.
Expand Down Expand Up @@ -129,17 +130,11 @@ protected function regionHolidays(int $year): array
$mvHolidays = [];
if($year >=1990)
{
array_push($mvHolidays, [
'Reformationstag' => '10-31',
]);

$mvHolidays['Reformationstag'] = '10-31';
}
if($year >=2023)
{
array_push($mvHolidays, [
'Internationaler Frauentag'=> '03-08',
]);

$mvHolidays['Internationaler Frauentag'] = '03-08';
}
return $mvHolidays;

Check failure on line 139 in src/Countries/Germany.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Germany::regionHolidays() should return array<string, Carbon\CarbonImmutable> but returns array<string, string>.
case 'DE-NW':
Expand All @@ -159,46 +154,33 @@ protected function regionHolidays(int $year): array
$snHolidays = [];
if($year >=1990)
{
array_push($snHolidays, [
'Reformationstag' => '10-31',
]);
$snHolidays['Reformationstag'] = '10-31';

}
if($year >1994)
{
array_push($snHolidays, [
'Buß- und Bettag' => $this->getRepentanceAndPrayerDay($year)
]);
$snHolidays['Buß- und Bettag'] = $this->getRepentanceAndPrayerDay($year);

}
return $snHolidays;

Check failure on line 165 in src/Countries/Germany.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Germany::regionHolidays() should return array<string, Carbon\CarbonImmutable> but returns array<string, string>.
case 'DE-ST':
$stHolidays = [];
if($year >=1990)
{
array_push($stHolidays, [
'Reformationstag' => '10-31',
]);
$stHolidays['Reformationstag'] = '10-31';

}
if($year >=1991){
array_push($stHolidays, [
'Heilige Drei Könige' => '01-06',
]);
$stHolidays['Weltkindertag'] = '09-20';
}
case 'DE-TH':
$thHolidays = [];
if($year >=1990)
{
array_push($thHolidays, [
'Reformationstag' => '10-31',
]);

$thHolidays['Reformationstag'] = '10-31';
}
if($year >=2019){
array_push($thHolidays, [
'Weltkindertag' => '09-20',
]);
$thHolidays['Weltkindertag'] = '09-20';
}
return $thHolidays;

Check failure on line 185 in src/Countries/Germany.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Germany::regionHolidays() should return array<string, Carbon\CarbonImmutable> but returns array<string, string>.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstsonntag",
"date": "2024-05-19"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "Reformationstag",
"date": "2024-10-31"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Internationaler Frauentag",
"date": "2024-03-08"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Heilige Drei K\u00f6nige",
"date": "2024-01-06"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Fronleichnam",
"date": "2024-05-30"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "Allerheiligen",
"date": "2024-11-01"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Heilige Drei K\u00f6nige",
"date": "2024-01-06"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Fronleichnam",
"date": "2024-05-30"
},
{
"name": "Mari\u00e4 Himmelfahrt",
"date": "2024-08-15"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "Allerheiligen",
"date": "2024-11-01"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "Reformationstag",
"date": "2024-10-31"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostersonntag",
"date": "2024-03-31"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Tag der Arbeit",
"date": "2024-05-01"
},
{
"name": "Himmelfahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Fronleichnam",
"date": "2024-05-30"
},
{
"name": "Tag der deutschen Einheit",
"date": "2024-10-03"
},
{
"name": "1. Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "2. Weihnachtstag",
"date": "2024-12-26"
}
]
Loading

0 comments on commit 16c90de

Please sign in to comment.