feat(services): add generator for public holidays in cz
This commit is contained in:
@@ -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'),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user