Skip to content

Commit

Permalink
style: Simplify the code for selecting holidays before and after 2013…
Browse files Browse the repository at this point in the history
… making it more concise

Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
  • Loading branch information
stelgenhof committed Jan 2, 2024
1 parent 15998c9 commit c7506f4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Yasumi/Provider/SouthKorea.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,7 @@ public function initialize(): void
return;
}

if ($this->year < 2013) {
// Holidays in used from 1949 until 2012
$officialHolidays = $this->calculateBefore2013($this->year);
} else {
// Holidays in use from 2013
$officialHolidays = $this->calculateCurrent();
}
$officialHolidays = $this->year < 2013 ? $this->calculateBefore2013($this->year) : $this->calculateCurrent();

foreach ($officialHolidays as $holiday) {
$this->addHoliday($this->{$holiday}($this->year, $this->timezone, $this->locale));
Expand Down

0 comments on commit c7506f4

Please sign in to comment.