Skip to content

Commit

Permalink
Fix christmas holiday
Browse files Browse the repository at this point in the history
  • Loading branch information
insoutt committed Apr 9, 2024
1 parent febecee commit 883cd14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Countries/Ecuador.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ public function nearestDay(int $year, int $month, int $day)
return $date;
}

public function getChristmasHoliday(int $year)

Check failure on line 40 in src/Countries/Ecuador.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Spatie\Holidays\Countries\Ecuador::getChristmasHoliday() has no return type specified.
{
$date = CarbonImmutable::createFromDate($year, 12, 25);

if($year === 2022) {
return $date->addDay();
}

return $date;
}

/** @return array<string, CarbonImmutable> */
protected function variableHolidays(int $year): array
{
Expand All @@ -55,7 +66,7 @@ protected function variableHolidays(int $year): array
'Independencia de Guayaquil' => $this->nearestDay($year, 10, 9),
'Día de Los Difuntos' => $this->nearestDay($year, 11, 2),
'Independencia de Cuenca' => $this->nearestDay($year, 11, 3),
'Navidad' => $this->nearestDay($year, 12, 25),
'Navidad' => $this->getChristmasHoliday($year),
];
}
}

0 comments on commit 883cd14

Please sign in to comment.