feat(services): add generator for public holidays in cz

This commit is contained in:
2024-08-07 12:54:55 +02:00
parent ef937530af
commit 24f36c16d0
5 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace App\Services\WorkingDays\PublicHolidays;
use App\Services\WorkingDays\PublicHolidays\Generator\PublicHolidaysCzechGenerator;
use App\Services\WorkingDays\PublicHolidays\Generator\PublicHolidaysGenerator;
/**
* Factory for creating public holidays generators
*/
class PublicHolidaysGeneratorFactory
{
public function createPublicHolidaysGeneratorForCountry(string $countryCode): PublicHolidaysGenerator
{
return match ($countryCode) {
'CZ' => new PublicHolidaysCzechGenerator(),
default => throw new \RuntimeException('Unsupported country code'),
};
}
}