Skip to content

Commit

Permalink
Simplify function by using class constant and removing intermediate v…
Browse files Browse the repository at this point in the history
…ariable.

Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
  • Loading branch information
stelgenhof committed Dec 5, 2023
1 parent 3499515 commit e46b9d3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Yasumi/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,8 @@ private static function compareDates(\DateTimeInterface $dateA, \DateTimeInterfa
*/
private function anotherTime(int $year, string $key): ?Holiday
{
$this->isHolidayKeyNotEmpty($key); // Validate if key is not empty

// Get calling class name
$hReflectionClass = new \ReflectionClass(\get_class($this));
$this->isHolidayKeyNotEmpty($key);

return Yasumi::create($hReflectionClass->getName(), $year, $this->locale)->getHoliday($key);
return Yasumi::create(static::class, $year, $this->locale)->getHoliday($key);
}
}

0 comments on commit e46b9d3

Please sign in to comment.