From 5e711bc019862c7f2d604da02c1eb3462c5cc30d Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 21:32:21 +0900 Subject: [PATCH 001/115] Changed DateTime to DateTimeImmutable as dates should be that: immutable (by default) Altered the comparison into a strong assertion (previous check is simply a weak assumption). Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/CommonHolidays.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index a5481722e..b2b0e2c68 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -455,7 +455,7 @@ public function summerTime($year, $timezone, $locale, $type = null): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, true); - if ($date) { + if ($date instanceof \DateTimeImmutable) { return new Holiday( 'summerTime', [], @@ -485,11 +485,11 @@ public function summerTime($year, $timezone, $locale, $type = null): ?Holiday * @param string $timezone the timezone in which Easter is celebrated * @param bool $summer whether to calculate the start of summer or winter time * - * @return DateTime|null A DateTime object representing the summer or winter transition time for the given + * @return \DateTimeImmutable|null A DateTime object representing the summer or winter transition time for the given * timezone. If no transition time is found, a null value is returned. * @throws \Exception */ - protected function calculateSummerWinterTime($year, $timezone, $summer): ?DateTime + protected function calculateSummerWinterTime($year, $timezone, $summer): ?\DateTimeImmutable { $zone = new DateTimeZone($timezone); @@ -500,7 +500,7 @@ protected function calculateSummerWinterTime($year, $timezone, $summer): ?DateTi foreach ($transitions as $transition) { if ($transition['isdst'] !== $dst && $transition['isdst'] === $summer) { - return new DateTime(\substr($transition['time'], 0, 10), $zone); + return new \DateTimeImmutable(\substr($transition['time'], 0, 10), $zone); } $dst = $transition['isdst']; } @@ -529,7 +529,7 @@ public function winterTime($year, $timezone, $locale, $type = null): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, false); - if ($date) { + if ($date instanceof \DateTimeImmutable) { return new Holiday( 'winterTime', [], From e9187bfbf6969b8b1d159c227339198aa73d018c Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 21:43:13 +0900 Subject: [PATCH 002/115] Removed unused variable. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Japan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index 60f187909..c15ed325f 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -537,7 +537,7 @@ private function calculateSubstituteHolidays(): void $dates = $this->getHolidayDates(); // Loop through all holidays - foreach ($this->getHolidays() as $shortName => $holiday) { + foreach ($this->getHolidays() as $holiday) { $date = clone $holiday; // If holidays falls on a Sunday From 6ef3440246541abf1ea35d9bf184eb7aa736b0db Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 22:47:45 +0900 Subject: [PATCH 003/115] Remove unnecessary brackets. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 2 +- src/Yasumi/Provider/Finland.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 427b975a3..00ed19e81 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -140,7 +140,7 @@ private static function compareDates(\DateTimeInterface $dateA, \DateTimeInterfa return 0; } - return ($dateA < $dateB) ? -1 : 1; + return $dateA < $dateB ? -1 : 1; } /** diff --git a/src/Yasumi/Provider/Finland.php b/src/Yasumi/Provider/Finland.php index 00f861a9c..f93ea1330 100644 --- a/src/Yasumi/Provider/Finland.php +++ b/src/Yasumi/Provider/Finland.php @@ -85,7 +85,7 @@ public function initialize(): void */ private function calculateStJohnsDay(): void { - $stJohnsDay = ($this->year < 1955) ? "$this->year-6-24" : "$this->year-6-20 this saturday"; + $stJohnsDay = $this->year < 1955 ? "$this->year-6-24" : "$this->year-6-20 this saturday"; $this->addHoliday(new Holiday( 'stJohnsDay', From 3294d05434ad87f6b2aa1eabd2f4d4709499acce Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 22:54:20 +0900 Subject: [PATCH 004/115] Set nullable parameters as such. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 2 +- src/Yasumi/Provider/UnitedKingdom.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 00ed19e81..d3592aaf1 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -106,7 +106,7 @@ abstract class AbstractProvider implements ProviderInterface, Countable, Iterato * represented * @param TranslationsInterface|null $globalTranslations global translations */ - public function __construct($year, $locale = null, TranslationsInterface $globalTranslations = null) + public function __construct($year, $locale = null, ?TranslationsInterface $globalTranslations = null) { $this->clearHolidays(); diff --git a/src/Yasumi/Provider/UnitedKingdom.php b/src/Yasumi/Provider/UnitedKingdom.php index e1f4c0417..d89a95c82 100644 --- a/src/Yasumi/Provider/UnitedKingdom.php +++ b/src/Yasumi/Provider/UnitedKingdom.php @@ -268,7 +268,7 @@ protected function calculateSummerBankHoliday(): void * * @throws \Exception */ - protected function calculateChristmasHolidays(string $type = null): void + protected function calculateChristmasHolidays(?string $type = null): void { $christmasDay = $this->christmasDay($this->year, $this->timezone, $this->locale, $type ?? Holiday::TYPE_OFFICIAL); $secondChristmasDay = $this->secondChristmasDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_BANK); From 4982af8d04ddbd76d3dfb707100b103f2fd4065f Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 23:03:53 +0900 Subject: [PATCH 005/115] Minor formatting. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Translations.php | 1 + src/Yasumi/Yasumi.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Translations.php b/src/Yasumi/Translations.php index ec4abe1d5..f0db6aeeb 100644 --- a/src/Yasumi/Translations.php +++ b/src/Yasumi/Translations.php @@ -89,6 +89,7 @@ public function loadTranslations(string $directoryPath): void * @param string $locale locale the locale to be validated * * @return true upon success, otherwise an UnknownLocaleException is thrown + * * @throws UnknownLocaleException An UnknownLocaleException is thrown if the given locale is not * valid/available. * diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index e9280365a..6b614a5a2 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -78,7 +78,6 @@ class Yasumi * @throws InvalidDateException * * @TODO we should accept a timezone so we can accept int/string for $startDate - * */ public static function nextWorkingDay( string $class, From d7e6132bb17d444281adb667b166f543e77676c6 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 23:18:05 +0900 Subject: [PATCH 006/115] Simplified conditional structure. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Australia/ACT.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index 4fc035f2e..270364e49 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -161,12 +161,16 @@ private function calculateLabourDay(): void */ private function calculateCanberraDay(): void { - if ($this->year < 2007) { - $date = new DateTime("third monday of march $this->year", new DateTimeZone($this->timezone)); - } else { - $date = new DateTime("second monday of march $this->year", new DateTimeZone($this->timezone)); - } - $this->addHoliday(new Holiday('canberraDay', ['en' => 'Canberra Day'], $date, $this->locale)); + $datePattern = $this->year < 2007 ? "third monday of march $this->year" : "second monday of march $this->year"; + + $this->addHoliday( + new Holiday( + 'canberraDay', + ['en' => 'Canberra Day'], + new DateTime($datePattern, new DateTimeZone($this->timezone)), + $this->locale + ) + ); } /** From d304a1d2b7859486836cf25d8bbf8e8735007fc2 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 7 Oct 2019 23:40:22 +0900 Subject: [PATCH 007/115] Added missing return type Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 4 ++-- src/Yasumi/ProviderInterface.php | 2 +- src/Yasumi/SubstituteHoliday.php | 2 +- src/Yasumi/Yasumi.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index d3592aaf1..77155c2a4 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -120,7 +120,7 @@ public function __construct($year, $locale = null, ?TranslationsInterface $globa /** * Clear all holidays. */ - protected function clearHolidays() + protected function clearHolidays(): void { $this->holidays = []; } @@ -149,7 +149,7 @@ private static function compareDates(\DateTimeInterface $dateA, \DateTimeInterfa * @param Holiday $holiday Holiday instance (representing a holiday) to be added to the internal list * of holidays of this country. */ - public function addHoliday(Holiday $holiday) + public function addHoliday(Holiday $holiday): void { if ($this->globalTranslations instanceof TranslationsInterface) { $holiday->mergeGlobalTranslations($this->globalTranslations); diff --git a/src/Yasumi/ProviderInterface.php b/src/Yasumi/ProviderInterface.php index 9c52175f3..89a46f947 100755 --- a/src/Yasumi/ProviderInterface.php +++ b/src/Yasumi/ProviderInterface.php @@ -24,5 +24,5 @@ interface ProviderInterface /** * Initialize country holidays. */ - public function initialize(); + public function initialize(): void; } diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index 1b2559dc5..371dc62be 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -102,7 +102,7 @@ public function getName(): string * * @param TranslationsInterface $globalTranslations global translations */ - public function mergeGlobalTranslations(TranslationsInterface $globalTranslations) + public function mergeGlobalTranslations(TranslationsInterface $globalTranslations): void { $this->substituteHolidayTranslations = $globalTranslations->getTranslations('substituteHoliday'); diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 6b614a5a2..033748572 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -115,7 +115,7 @@ public static function nextWorkingDay( * between 1000 and 9999. * @param string $locale The locale to use. If empty we'll use the default locale (en_US) * - * @return AbstractProvider An instance of class $class is created and returned + * @return ProviderInterface An instance of class $class is created and returned * * @throws RuntimeException If no such holiday provider is found * @throws InvalidYearException if the year parameter is not between 1000 and 9999 From fd97b5c732a66366858a4ae57fda6e9669e060d1 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 8 Oct 2019 22:27:21 +0900 Subject: [PATCH 008/115] Removed the assertion of the instance type as it is already defined by the return type. Signed-off-by: Sacha Telgenhof --- tests/Base/YasumiTest.php | 4 +--- tests/Finland/stJohnsDayTest.php | 1 - tests/Sweden/StJohnsDayTest.php | 1 - tests/Sweden/StJohnsEveTest.php | 1 - tests/YasumiBase.php | 5 ----- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index f65159114..c29071318 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -27,6 +27,7 @@ use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\AbstractProvider; +use Yasumi\ProviderInterface; use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; @@ -108,7 +109,6 @@ public function testCreateWithAbstractExtension(): void $class, Factory::create()->numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND) ); - $this->assertInstanceOf($class, $instance); } /** @@ -138,7 +138,6 @@ public function testGetIterator(): void Factory::create()->numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND) ); - $this->assertInstanceOf(ArrayIterator::class, $holidays->getIterator()); } /** @@ -579,7 +578,6 @@ public function testCreateByISO3166_2(): void $year ); - $this->assertInstanceOf(AbstractProvider::class, $provider); $this->assertEquals($year, $provider->getYear()); } diff --git a/tests/Finland/stJohnsDayTest.php b/tests/Finland/stJohnsDayTest.php index e1c63bc21..c9c28ced9 100644 --- a/tests/Finland/stJohnsDayTest.php +++ b/tests/Finland/stJohnsDayTest.php @@ -67,7 +67,6 @@ public function testHolidayAfterAdjustment() $holiday = $holidays->getHoliday(self::HOLIDAY); // Some basic assertions - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', self::REGION), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); diff --git a/tests/Sweden/StJohnsDayTest.php b/tests/Sweden/StJohnsDayTest.php index 6e68e55e3..b97fa24a0 100644 --- a/tests/Sweden/StJohnsDayTest.php +++ b/tests/Sweden/StJohnsDayTest.php @@ -39,7 +39,6 @@ public function testHoliday() $holiday = $holidays->getHoliday(self::HOLIDAY); // Some basic assertions - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', self::REGION), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); diff --git a/tests/Sweden/StJohnsEveTest.php b/tests/Sweden/StJohnsEveTest.php index 9279cdec7..5677d4b51 100644 --- a/tests/Sweden/StJohnsEveTest.php +++ b/tests/Sweden/StJohnsEveTest.php @@ -39,7 +39,6 @@ public function testHoliday() $holiday = $holidays->getHoliday(self::HOLIDAY); // Some basic assertions - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', self::REGION), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index 8677c9116..c99c40d5b 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -104,7 +104,6 @@ public function assertHoliday($provider, $shortName, $year, $expected): void $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', $provider), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); $this->assertEquals($expected, $holiday); @@ -132,7 +131,6 @@ public function assertNotHoliday($provider, $shortName, $year): void $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', $provider), $holidays); $this->assertNull($holiday); unset($holiday, $holidays); @@ -157,7 +155,6 @@ public function assertTranslatedHolidayName($provider, $shortName, $year, $trans $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', $provider), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); $this->assertTrue($holidays->isHoliday($holiday)); @@ -205,7 +202,6 @@ public function assertHolidayType($provider, $shortName, $year, $type): void $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', $provider), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); $this->assertEquals($type, $holiday->getType()); @@ -233,7 +229,6 @@ public function assertDayOfWeek($provider, $shortName, $year, $expectedDayOfWeek $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); - $this->assertInstanceOf('Yasumi\Provider\\' . \str_replace('/', '\\', $provider), $holidays); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertNotNull($holiday); $this->assertTrue($holidays->isHoliday($holiday)); From c93be03e14d00a1218985b8044463e678f39d719 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 8 Oct 2019 22:57:02 +0900 Subject: [PATCH 009/115] Set proper return type (equal to createISO3166_2 method). Signed-off-by: Sacha Telgenhof --- src/Yasumi/Yasumi.php | 4 ++-- tests/Base/YasumiExternalProvider.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 033748572..ff5bdf16f 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -115,7 +115,7 @@ public static function nextWorkingDay( * between 1000 and 9999. * @param string $locale The locale to use. If empty we'll use the default locale (en_US) * - * @return ProviderInterface An instance of class $class is created and returned + * @return AbstractProvider An instance of class $class is created and returned * * @throws RuntimeException If no such holiday provider is found * @throws InvalidYearException if the year parameter is not between 1000 and 9999 @@ -123,7 +123,7 @@ public static function nextWorkingDay( * @throws ProviderNotFoundException if the holiday provider for the given country does not exist * @throws \ReflectionException */ - public static function create(string $class, int $year = 0, string $locale = self::DEFAULT_LOCALE): ProviderInterface + public static function create(string $class, int $year = 0, string $locale = self::DEFAULT_LOCALE): AbstractProvider { // Find and return holiday provider instance $providerClass = \sprintf('Yasumi\Provider\%s', \str_replace('/', '\\', $class)); diff --git a/tests/Base/YasumiExternalProvider.php b/tests/Base/YasumiExternalProvider.php index 2dccb5642..40ab9c0e9 100644 --- a/tests/Base/YasumiExternalProvider.php +++ b/tests/Base/YasumiExternalProvider.php @@ -12,14 +12,14 @@ namespace Yasumi\tests\Base; -use Yasumi\ProviderInterface; +use Yasumi\Provider\AbstractProvider; /** * Class YasumiExternalProvider. * * Class for testing the use of an external holiday provider class. */ -class YasumiExternalProvider implements ProviderInterface +class YasumiExternalProvider extends AbstractProvider { /** * Initialize country holidays. From 3a96bce45d34fe7ba165010da41cb1d0534b90cd Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 8 Oct 2019 23:09:38 +0900 Subject: [PATCH 010/115] Removed empty tests. Reverted/corrected previous assertion for ExternalProvider classes. Signed-off-by: Sacha Telgenhof --- tests/Base/YasumiTest.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index c29071318..bc149f30d 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -12,7 +12,6 @@ namespace Yasumi\tests\Base; -use ArrayIterator; use DateTime; use DateTimeImmutable; use Exception; @@ -26,8 +25,6 @@ use Yasumi\Exception\ProviderNotFoundException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; -use Yasumi\Provider\AbstractProvider; -use Yasumi\ProviderInterface; use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; @@ -109,6 +106,7 @@ public function testCreateWithAbstractExtension(): void $class, Factory::create()->numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND) ); + $this->assertInstanceOf(YasumiExternalProvider::class, $instance); } /** @@ -127,19 +125,6 @@ public function testCreateWithInvalidLocale(): void ); } - /** - * Tests that the getIterator function returns an ArrayIterator object - * @throws ReflectionException - */ - public function testGetIterator(): void - { - $holidays = Yasumi::create( - 'Japan', - Factory::create()->numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND) - ); - - } - /** * Tests that the count function returns an integer and a correct count for the test holiday provider * @throws ReflectionException From 2150a710f612338da7ece455c5a842a85e388423 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 8 Oct 2019 23:51:34 +0900 Subject: [PATCH 011/115] Refactored if-then-else constructs as the else construct is often not necessary. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Australia/Queensland.php | 29 ++++++--------- src/Yasumi/Provider/Australia/SA.php | 26 ++++++------- src/Yasumi/Provider/Australia/WA.php | 37 +++++++------------ .../Provider/UnitedKingdom/Scotland.php | 3 +- 4 files changed, 38 insertions(+), 57 deletions(-) diff --git a/src/Yasumi/Provider/Australia/Queensland.php b/src/Yasumi/Provider/Australia/Queensland.php index 0e954878b..007d3e375 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -64,23 +64,19 @@ public function initialize(): void */ private function calculateQueensBirthday(): void { + $birthDay = 'first monday of october ' . $this->year; + if ($this->year < 2012 || 2013 === $this->year || 2014 === $this->year || 2015 === $this->year) { - $this->calculateHoliday( - 'queensBirthday', - ['en' => "Queen's Birthday"], - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - false, - false - ); - } else { - $this->calculateHoliday( - 'queensBirthday', - ['en' => "Queen's Birthday"], - new DateTime('first monday of october ' . $this->year, new DateTimeZone($this->timezone)), - false, - false - ); + $birthDay = 'second monday of june ' . $this->year; } + + $this->calculateHoliday( + 'queensBirthday', + ['en' => "Queen's Birthday"], + new DateTime($birthDay, new DateTimeZone($this->timezone)), + false, + false + ); } /** @@ -90,10 +86,9 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { + $date = new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone)); if (2013 === $this->year || 2014 === $this->year || 2015 === $this->year) { $date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone)); - } else { - $date = new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index 1f337c229..06d5a9eda 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -139,23 +139,19 @@ private function calculateLabourDay(): void private function calculateAdelaideCupDay(): void { if ($this->year >= 1973) { + $cupDay = 'second monday of march ' . $this->year; + if ($this->year < 2006) { - $this->calculateHoliday( - 'adelaideCup', - ['en' => 'Adelaide Cup'], - new DateTime('third monday of may ' . $this->year, new DateTimeZone($this->timezone)), - false, - false - ); - } else { - $this->calculateHoliday( - 'adelaideCup', - ['en' => 'Adelaide Cup'], - new DateTime('second monday of march ' . $this->year, new DateTimeZone($this->timezone)), - false, - false - ); + $cupDay = 'third monday of may ' . $this->year; } + + $this->calculateHoliday( + 'adelaideCup', + ['en' => 'Adelaide Cup'], + new DateTime($cupDay, new DateTimeZone($this->timezone)), + false, + false + ); } } diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WA.php index 74649e098..1eaf91a3f 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WA.php @@ -65,31 +65,22 @@ public function initialize(): void */ private function calculateQueensBirthday(): void { + $birthDay = 'last monday of september ' . $this->year; if (2011 === $this->year) { - $this->calculateHoliday( - 'queensBirthday', - ['en' => "Queen's Birthday"], - new DateTime('2011-10-28', new DateTimeZone($this->timezone)), - false, - false - ); - } elseif (2012 === $this->year) { - $this->calculateHoliday( - 'queensBirthday', - ['en' => "Queen's Birthday"], - new DateTime('2012-10-01', new DateTimeZone($this->timezone)), - false, - false - ); - } else { - $this->calculateHoliday( - 'queensBirthday', - ['en' => "Queen's Birthday"], - new DateTime('last monday of september ' . $this->year, new DateTimeZone($this->timezone)), - false, - false - ); + $birthDay = '2011-10-28'; } + + if (2012 === $this->year) { + $birthDay = '2012-10-01'; + } + + $this->calculateHoliday( + 'queensBirthday', + ['en' => "Queen's Birthday"], + new DateTime($birthDay, new DateTimeZone($this->timezone)), + false, + false + ); } /** diff --git a/src/Yasumi/Provider/UnitedKingdom/Scotland.php b/src/Yasumi/Provider/UnitedKingdom/Scotland.php index 91782564f..0427de3d9 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Scotland.php +++ b/src/Yasumi/Provider/UnitedKingdom/Scotland.php @@ -90,10 +90,9 @@ protected function calculateNewYearsHolidays(): void return; } + $type = Holiday::TYPE_BANK; if ($this->year <= 1974) { $type = Holiday::TYPE_OBSERVANCE; - } else { - $type = Holiday::TYPE_BANK; } $newYearsDay = $this->newYearsDay($this->year, $this->timezone, $this->locale, $type); From 9f1c93fd2c726232865a366f785a3aa7436c8de7 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 9 Oct 2019 00:08:59 +0900 Subject: [PATCH 012/115] Added missing return type. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Holiday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index f611cc9e6..fa7f1f7c1 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -181,7 +181,7 @@ public function getName(): string * * @param TranslationsInterface $globalTranslations global translations */ - public function mergeGlobalTranslations(TranslationsInterface $globalTranslations) + public function mergeGlobalTranslations(TranslationsInterface $globalTranslations): void { $holidayGlobalTranslations = $globalTranslations->getTranslations($this->shortName); $this->translations = \array_merge($holidayGlobalTranslations, $this->translations); From 1f8b0294094aabbc9fe1cc6562ba8cc0600ddc40 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Tue, 8 Oct 2019 17:12:01 +0200 Subject: [PATCH 013/115] Fix locale fallback for substitute holiday (#180) --- src/Yasumi/Holiday.php | 25 +++++++++++++++++-------- src/Yasumi/SubstituteHoliday.php | 11 ++++++----- tests/Base/SubstituteHolidayTest.php | 25 ++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index fa7f1f7c1..ee36b4a9d 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -160,14 +160,7 @@ public function jsonSerialize(): self */ public function getName(): string { - $locales = [$this->displayLocale]; - $parts = \explode('_', $this->displayLocale); - while (\array_pop($parts) && $parts) { - $locales[] = \implode('_', $parts); - } - $locales[] = self::DEFAULT_LOCALE; - - foreach ($locales as $locale) { + foreach ($this->getLocales() as $locale) { if (isset($this->translations[$locale])) { return $this->translations[$locale]; } @@ -176,6 +169,22 @@ public function getName(): string return $this->shortName; } + /** + * Returns the display locale and its fallback locales. + * + * @return array + */ + protected function getLocales(): array + { + $locales = [$this->displayLocale]; + $parts = \explode('_', $this->displayLocale); + while (\array_pop($parts) && $parts) { + $locales[] = \implode('_', $parts); + } + $locales[] = self::DEFAULT_LOCALE; + return $locales; + } + /** * Merges local translations (preferred) with global translations. * diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index 371dc62be..d9d789c24 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -87,11 +87,12 @@ public function getName(): string $name = parent::getName(); if ($name === $this->shortName) { - $pattern = $this->substituteHolidayTranslations[$this->displayLocale] - ?? $this->substituteHolidayTranslations[self::DEFAULT_LOCALE] - ?? $this->shortName; - - $name = \str_replace('{0}', $this->substitutedHoliday->getName(), $pattern); + foreach ($this->getLocales() as $locale) { + $pattern = $this->substituteHolidayTranslations[$locale] ?? null; + if ($pattern) { + return \str_replace('{0}', $this->substitutedHoliday->getName(), $pattern); + } + } } return $name; diff --git a/tests/Base/SubstituteHolidayTest.php b/tests/Base/SubstituteHolidayTest.php index 9937835d3..9fd7ddc83 100644 --- a/tests/Base/SubstituteHolidayTest.php +++ b/tests/Base/SubstituteHolidayTest.php @@ -138,7 +138,7 @@ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): v $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn([$locale => 'foo']); $translationsStub->expects($this->at(1))->method('getTranslations')->with($this->equalTo('substituteHoliday:testHoliday'))->willReturn([$locale => 'foo']); - $translationsStub->expects($this->at(2))->method('getTranslations')->with($this->equalTo('testHoliday'))->willReturn([$locale => 'foo']); + $translationsStub->expects($this->at(2))->method('getTranslations')->with($this->equalTo('testHoliday'))->willReturn(['en' => 'foo']); $substitute->mergeGlobalTranslations($translationsStub); @@ -146,6 +146,29 @@ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): v $this->assertEquals($translation, $substitute->getName()); } + /** + * Tests the getName function of the SubstituteHoliday object when substitute holiday pattern uses fallback. + * @throws \Exception + */ + public function testSubstituteHolidayGetNameWithPatternFallback(): void + { + $name = 'testHoliday'; + $translation = 'My Holiday'; + $locale = 'en_US'; + $holiday = new Holiday($name, [], new DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); + + $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); + $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn(['en' => '{0} obs']); + $translationsStub->expects($this->at(1))->method('getTranslations')->with($this->equalTo('substituteHoliday:testHoliday'))->willReturn([]); + $translationsStub->expects($this->at(2))->method('getTranslations')->with($this->equalTo('testHoliday'))->willReturn([$locale => $translation]); + + $substitute->mergeGlobalTranslations($translationsStub); + + $this->assertIsString($substitute->getName()); + $this->assertEquals('My Holiday obs', $substitute->getName()); + } + /** * Tests the getName function of the SubstituteHoliday object when it has a global translation. * @throws \Exception From 7e49d1f2800541f56244a7439c3194641654835a Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 12 Oct 2019 17:48:33 +0900 Subject: [PATCH 014/115] Formatting fixes. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 1 - src/Yasumi/Provider/Ukraine.php | 2 ++ src/Yasumi/data/translations/allSaintsDay.php | 1 + src/Yasumi/data/translations/allSaintsEve.php | 1 + src/Yasumi/data/translations/annunciation.php | 1 + src/Yasumi/data/translations/anzacDay.php | 1 + src/Yasumi/data/translations/armisticeDay.php | 1 + src/Yasumi/data/translations/ascensionDay.php | 1 + src/Yasumi/data/translations/ashWednesday.php | 1 + src/Yasumi/data/translations/assumptionOfMary.php | 1 + src/Yasumi/data/translations/australiaDay.php | 1 + src/Yasumi/data/translations/carnationRevolutionDay.php | 1 + src/Yasumi/data/translations/christmasDay.php | 1 + src/Yasumi/data/translations/christmasEve.php | 1 + src/Yasumi/data/translations/corpusChristi.php | 1 + src/Yasumi/data/translations/dayAfterNewYearsDay.php | 1 + src/Yasumi/data/translations/dayOfReformation.php | 1 + src/Yasumi/data/translations/easter.php | 1 + src/Yasumi/data/translations/easterMonday.php | 1 + src/Yasumi/data/translations/epiphany.php | 1 + src/Yasumi/data/translations/epiphanyEve.php | 1 + src/Yasumi/data/translations/fathersDay.php | 1 + src/Yasumi/data/translations/goodFriday.php | 1 + src/Yasumi/data/translations/immaculateConception.php | 1 + src/Yasumi/data/translations/internationalWomensDay.php | 1 + src/Yasumi/data/translations/internationalWorkersDay.php | 1 + src/Yasumi/data/translations/labourDay.php | 1 + src/Yasumi/data/translations/maundyThursday.php | 1 + src/Yasumi/data/translations/mothersDay.php | 1 + src/Yasumi/data/translations/newYearsDay.php | 1 + src/Yasumi/data/translations/newYearsEve.php | 1 + src/Yasumi/data/translations/pentecost.php | 1 + src/Yasumi/data/translations/pentecostMonday.php | 1 + src/Yasumi/data/translations/portugalDay.php | 1 + src/Yasumi/data/translations/portugueseRepublicDay.php | 1 + src/Yasumi/data/translations/reformationDay.php | 1 + src/Yasumi/data/translations/restorationOfIndepence.php | 1 + src/Yasumi/data/translations/secondChristmasDay.php | 1 + src/Yasumi/data/translations/secondNewYearsDay.php | 1 + src/Yasumi/data/translations/stAndrewsDay.php | 1 + src/Yasumi/data/translations/stDavidsDay.php | 1 + src/Yasumi/data/translations/stGeorgesDay.php | 1 + src/Yasumi/data/translations/stJohnsDay.php | 1 + src/Yasumi/data/translations/stJohnsEve.php | 1 + src/Yasumi/data/translations/stJosephsDay.php | 1 + src/Yasumi/data/translations/stMartinsDay.php | 1 + src/Yasumi/data/translations/stStephensDay.php | 1 + src/Yasumi/data/translations/substituteHoliday.php | 1 + src/Yasumi/data/translations/summerTime.php | 1 + src/Yasumi/data/translations/valentinesDay.php | 1 + src/Yasumi/data/translations/victoryInEuropeDay.php | 1 + src/Yasumi/data/translations/waitangiDay.php | 1 + src/Yasumi/data/translations/walpurgisEve.php | 1 + src/Yasumi/data/translations/winterTime.php | 1 + src/Yasumi/data/translations/worldAnimalDay.php | 1 + 55 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 77155c2a4..82b4fcc69 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -265,7 +265,6 @@ public function whenIs($shortName): string * * @return true upon success, otherwise an InvalidArgumentException is thrown * @throws InvalidArgumentException An InvalidArgumentException is thrown if the given holiday parameter is empty. - * */ protected function isHolidayNameNotEmpty($shortName): bool { diff --git a/src/Yasumi/Provider/Ukraine.php b/src/Yasumi/Provider/Ukraine.php index 4a18bfe6d..7476a27ac 100644 --- a/src/Yasumi/Provider/Ukraine.php +++ b/src/Yasumi/Provider/Ukraine.php @@ -22,6 +22,7 @@ * * Class Ukraine * @package Yasumi\Provider + * * @author Dmitry Machin */ class Ukraine extends AbstractProvider @@ -214,6 +215,7 @@ private function calculateDefenderOfUkraineDay(): void * @param string $timezone * * @return \DateTime + * * @throws \Exception */ public function calculateEaster($year, $timezone): \DateTime diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php index b7e2f2cc7..84060ac5f 100755 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -1,4 +1,5 @@ Date: Sat, 12 Oct 2019 18:14:01 +0900 Subject: [PATCH 015/115] Changed variables to camelCase. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Filters/BetweenFilter.php | 20 ++++++++++---------- src/Yasumi/Provider/AbstractProvider.php | 16 ++++++++-------- src/Yasumi/Provider/ChristianHolidays.php | 6 +++--- src/Yasumi/Provider/Japan.php | 6 +++--- src/Yasumi/Provider/Romania.php | 12 ++++++------ src/Yasumi/Provider/Sweden.php | 6 +++--- src/Yasumi/Yasumi.php | 10 +++++----- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Yasumi/Filters/BetweenFilter.php b/src/Yasumi/Filters/BetweenFilter.php index 73d556d64..8e6dae7ce 100644 --- a/src/Yasumi/Filters/BetweenFilter.php +++ b/src/Yasumi/Filters/BetweenFilter.php @@ -30,12 +30,12 @@ class BetweenFilter extends AbstractFilter /** * @var string start date of the time frame to check against */ - private $start_date; + private $startDate; /** * @var string end date of the time frame to check against */ - private $end_date; + private $endDate; /** * @var bool indicates whether the start and end dates should be included in the comparison @@ -46,21 +46,21 @@ class BetweenFilter extends AbstractFilter * Construct the Between FilterIterator Object * * @param Iterator $iterator Iterator object of the Holidays Provider - * @param \DateTimeInterface $start_date Start date of the time frame to check against - * @param \DateTimeInterface $end_date End date of the time frame to check against + * @param \DateTimeInterface $startDate Start date of the time frame to check against + * @param \DateTimeInterface $endDate End date of the time frame to check against * @param bool $equal Indicate whether the start and end dates should be included in the * comparison */ public function __construct( Iterator $iterator, - \DateTimeInterface $start_date, - \DateTimeInterface $end_date, + \DateTimeInterface $startDate, + \DateTimeInterface $endDate, $equal = true ) { parent::__construct($iterator); $this->equal = $equal; - $this->start_date = $start_date->format('Y-m-d'); - $this->end_date = $end_date->format('Y-m-d'); + $this->startDate = $startDate->format('Y-m-d'); + $this->endDate = $endDate->format('Y-m-d'); } /** @@ -70,10 +70,10 @@ public function accept(): bool { $holiday = $this->getInnerIterator()->current()->format('Y-m-d'); - if ($this->equal && $holiday >= $this->start_date && $holiday <= $this->end_date) { + if ($this->equal && $holiday >= $this->startDate && $holiday <= $this->endDate) { return true; } - return $holiday > $this->start_date && $holiday < $this->end_date; + return $holiday > $this->startDate && $holiday < $this->endDate; } } diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 82b4fcc69..b2624539f 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -200,10 +200,10 @@ public function isWorkingDay(\DateTimeInterface $date): bool // Check if given date is a falls in the weekend or not // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. // @TODO Ideally avoid late static binding here (static::ID) - $weekend_data = self::WEEKEND_DATA; - $weekend_days = $weekend_data[$this::ID] ?? [0, 6]; + $weekendData = self::WEEKEND_DATA; + $weekendDays = $weekendData[$this::ID] ?? [0, 6]; - if (\in_array((int)$date->format('w'), $weekend_days, true)) { + if (\in_array((int)$date->format('w'), $weekendDays, true)) { $isWorkingDay = false; } @@ -434,8 +434,8 @@ public function previous($shortName): ?Holiday * timezone for these parameters versus the instantiated Holiday Provider, the outcome might be unexpected (but * correct). * - * @param \DateTimeInterface $start_date Start date of the time frame to check against - * @param \DateTimeInterface $end_date End date of the time frame to check against + * @param \DateTimeInterface $startDate Start date of the time frame to check against + * @param \DateTimeInterface $endDate End date of the time frame to check against * @param bool $equals indicate whether the start and end dates should be included in the * comparison * @@ -444,13 +444,13 @@ public function previous($shortName): ?Holiday * date. * */ - public function between(\DateTimeInterface $start_date, \DateTimeInterface $end_date, $equals = null): BetweenFilter + public function between(\DateTimeInterface $startDate, \DateTimeInterface $endDate, $equals = null): BetweenFilter { - if ($start_date > $end_date) { + if ($startDate > $endDate) { throw new InvalidArgumentException('Start date must be a date before the end date.'); } - return new BetweenFilter($this->getIterator(), $start_date, $end_date, $equals ?? true); + return new BetweenFilter($this->getIterator(), $startDate, $endDate, $equals ?? true); } /** diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index 17fe0aa28..e2490bd13 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -81,7 +81,7 @@ public function easter(int $year, string $timezone, string $locale, string $type protected function calculateEaster(int $year, string $timezone): DateTime { if (\extension_loaded('calendar')) { - $easter_days = \easter_days($year); + $easterDays = \easter_days($year); } else { $golden = ($year % 19) + 1; // The Golden Number @@ -124,11 +124,11 @@ protected function calculateEaster(int $year, string $timezone): DateTime $tmp += 7; } - $easter_days = $pfm + $tmp + 1; // Easter as the number of days after 21st March + $easterDays = $pfm + $tmp + 1; // Easter as the number of days after 21st March } $easter = new DateTime("$year-3-21", new DateTimeZone($timezone)); - $easter->add(new DateInterval('P' . $easter_days . 'D')); + $easter->add(new DateInterval('P' . $easterDays . 'D')); return $easter; } diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index c15ed325f..16d7ab1f9 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -468,15 +468,15 @@ private function calculateSportsDay(): void $date = new DateTime("$this->year-10-10", new DateTimeZone($this->timezone)); } - $holiday_name = ['en' => 'Health And Sports Day', 'ja' => '体育の日']; + $holidayName = ['en' => 'Health And Sports Day', 'ja' => '体育の日']; if ($this->year >= 2020) { - $holiday_name = ['en' => 'Sports Day', 'ja' => 'スポーツの日']; + $holidayName = ['en' => 'Sports Day', 'ja' => 'スポーツの日']; } if ($date instanceof DateTimeInterface) { $this->addHoliday(new Holiday( 'sportsDay', - $holiday_name, + $holidayName, $date, $this->locale )); diff --git a/src/Yasumi/Provider/Romania.php b/src/Yasumi/Provider/Romania.php index 41f069077..450bcacbd 100755 --- a/src/Yasumi/Provider/Romania.php +++ b/src/Yasumi/Provider/Romania.php @@ -164,26 +164,26 @@ private function calculateStAndrewDay(): void */ private function calculateNationalDay(): void { - $national_day = null; + $nationalDay = null; //@link https://en.wikipedia.org/wiki/Great_Union_Day if ($this->year >= 1990) { - $national_day = "$this->year-12-01"; + $nationalDay = "$this->year-12-01"; } if ($this->year >= 1948 && $this->year <= 1989) { - $national_day = "$this->year-08-23"; + $nationalDay = "$this->year-08-23"; } if ($this->year >= 1866 && $this->year <= 1947) { - $national_day = "$this->year-05-10"; + $nationalDay = "$this->year-05-10"; } - if (\is_string($national_day)) { + if (\is_string($nationalDay)) { $this->addHoliday(new Holiday('nationalDay', [ 'en' => 'National Day', 'ro' => 'Ziua Națională', - ], new DateTime($national_day, new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime($nationalDay, new DateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Sweden.php b/src/Yasumi/Provider/Sweden.php index 6df730215..5916e043e 100644 --- a/src/Yasumi/Provider/Sweden.php +++ b/src/Yasumi/Provider/Sweden.php @@ -224,16 +224,16 @@ private function calculateNationalDay(): void return; } - $holiday_name = 'Svenska flaggans dag'; + $holidayName = 'Svenska flaggans dag'; // Since 1983 this day was named 'Sveriges nationaldag' if ($this->year >= 1983) { - $holiday_name = 'Sveriges nationaldag'; + $holidayName = 'Sveriges nationaldag'; } $this->addHoliday(new Holiday( 'nationalDay', - ['sv' => $holiday_name], + ['sv' => $holidayName], new DateTime("$this->year-6-6", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index ff5bdf16f..c8616fd9c 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -177,7 +177,7 @@ public static function getAvailableLocales(): array * already with Yasumi, or your own provider by giving the 'const ID', corresponding to the ISO3166-2 Code, set in * your class in the first parameter. Your provider class needs to implement the 'ProviderInterface' class. * - * @param string $iso3166_2 ISO3166-2 Coded region, holiday provider will be searched for + * @param string $isoCode ISO3166-2 Coded region, holiday provider will be searched for * @param int $year year for which the country provider needs to be created. Year needs to be a valid * integer between 1000 and 9999. * @param string $locale The locale to use. If empty we'll use the default locale (en_US) @@ -191,20 +191,20 @@ public static function getAvailableLocales(): array * @throws \ReflectionException */ public static function createByISO3166_2( - string $iso3166_2, + string $isoCode, int $year = 0, string $locale = self::DEFAULT_LOCALE ): AbstractProvider { $availableProviders = self::getProviders(); - if (false === isset($availableProviders[$iso3166_2])) { + if (false === isset($availableProviders[$isoCode])) { throw new ProviderNotFoundException(\sprintf( 'Unable to find holiday provider by ISO3166-2 "%s".', - $iso3166_2 + $isoCode )); } - return self::create($availableProviders[$iso3166_2], $year, $locale); + return self::create($availableProviders[$isoCode], $year, $locale); } /** From 1a0992e4893644e62d227a4fb75d2e71f19bf2fd Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 2 Nov 2019 13:45:45 +0900 Subject: [PATCH 016/115] Refactored check so it checks the instance type. A boolean as the initial data type is not correct in this situation. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Yasumi.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index c8616fd9c..6576e3883 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -88,11 +88,11 @@ public static function nextWorkingDay( // Setup start date, if its an instance of \DateTime, clone to prevent modification to original $date = $startDate instanceof \DateTime ? clone $startDate : $startDate; - $provider = false; + $provider = null; while ($workingDays > 0) { $date = $date->add(new \DateInterval('P1D')); - if (!$provider || $provider->getYear() !== \getdate()['year']) { + if (! $provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { @@ -282,11 +282,11 @@ public static function prevWorkingDay( // Setup start date, if its an instance of \DateTime, clone to prevent modification to original $date = $startDate instanceof \DateTime ? clone $startDate : $startDate; - $provider = false; + $provider = null; while ($workingDays > 0) { $date = $date->sub(new \DateInterval('P1D')); - if (!$provider || $provider->getYear() !== \getdate()['year']) { + if (! $provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { From 0b8e899d59fa9a26f640173c4000be343d207e2d Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 2 Nov 2019 13:56:21 +0900 Subject: [PATCH 017/115] Changed method signature as parameters with defaults should come after required parameters. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Australia.php | 28 +++++++++---------- src/Yasumi/Provider/Australia/ACT.php | 2 +- src/Yasumi/Provider/Australia/NSW.php | 4 +-- src/Yasumi/Provider/Australia/NT.php | 4 +-- src/Yasumi/Provider/Australia/Queensland.php | 2 +- src/Yasumi/Provider/Australia/SA.php | 18 ++++++------ src/Yasumi/Provider/Australia/Tasmania.php | 4 +-- .../Australia/Tasmania/KingIsland.php | 2 +- .../Australia/Tasmania/South/Southeast.php | 2 +- src/Yasumi/Provider/Australia/Victoria.php | 2 +- src/Yasumi/Provider/Australia/WA.php | 4 +-- tests/NewZealand/AnzacDayTest.php | 2 +- tests/NewZealand/WaitangiDayTest.php | 2 +- tests/YasumiBase.php | 8 +++--- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index 2f87b0e78..aba89681c 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -71,15 +71,15 @@ public function initialize(): void private function calculateNewYearHolidays(): void { $newyearsday = new DateTime("$this->year-01-01", new DateTimeZone($this->timezone)); - $this->calculateHoliday('newYearsDay', [], $newyearsday, false, false); + $this->calculateHoliday('newYearsDay', $newyearsday, [], false, false); switch ($newyearsday->format('w')) { case 0: // sunday $newyearsday->add(new DateInterval('P1D')); - $this->calculateHoliday('newYearsHoliday', ['en' => 'New Year\'s Holiday'], $newyearsday, false, false); + $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year\'s Holiday'], false, false); break; case 6: // saturday $newyearsday->add(new DateInterval('P2D')); - $this->calculateHoliday('newYearsHoliday', ['en' => 'New Year\'s Holiday'], $newyearsday, false, false); + $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year\'s Holiday'], false, false); break; } } @@ -88,8 +88,8 @@ private function calculateNewYearHolidays(): void * Function to simplify moving holidays to mondays if required * * @param string $shortName - * @param array $names * @param DateTime $date + * @param array $names * @param bool $moveFromSaturday * @param bool $moveFromSunday * @param string $type @@ -101,8 +101,8 @@ private function calculateNewYearHolidays(): void */ public function calculateHoliday( string $shortName, - array $names = [], $date, + array $names = [], $moveFromSaturday = null, $moveFromSunday = null, $type = null @@ -137,7 +137,7 @@ private function calculateAustraliaDay(): void { $date = new DateTime("$this->year-01-26", new DateTimeZone($this->timezone)); - $this->calculateHoliday('australiaDay', ['en' => 'Australia Day'], $date); + $this->calculateHoliday('australiaDay', $date, ['en' => 'Australia Day']); } /** @@ -163,7 +163,7 @@ private function calculateAnzacDay(): void } $date = new DateTime("$this->year-04-25", new DateTimeZone($this->timezone)); - $this->calculateHoliday('anzacDay', [], $date, false, false); + $this->calculateHoliday('anzacDay', $date, [], false, false); $easter = $this->calculateEaster($this->year, $this->timezone); $easterMonday = $this->calculateEaster($this->year, $this->timezone); @@ -172,7 +172,7 @@ private function calculateAnzacDay(): void $fDate = $date->format('Y-m-d'); if ($fDate === $easter->format('Y-m-d') || $fDate === $easterMonday->format('Y-m-d')) { $easterMonday->add(new DateInterval('P1D')); - $this->calculateHoliday('easterTuesday', ['en' => 'Easter Tuesday'], $easterMonday, false, false); + $this->calculateHoliday('easterTuesday', $easterMonday, ['en' => 'Easter Tuesday'], false, false); } unset($fDate); } @@ -193,23 +193,23 @@ private function calculateChristmasDay(): void { $christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone)); $boxingDay = new DateTime("$this->year-12-26", new DateTimeZone($this->timezone)); - $this->calculateHoliday('christmasDay', [], $christmasDay, false, false); - $this->calculateHoliday('secondChristmasDay', [], $boxingDay, false, false); + $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); + $this->calculateHoliday('secondChristmasDay', $boxingDay, [], false, false); switch ($christmasDay->format('w')) { case 0: // sunday $christmasDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', ['en' => 'Christmas Holiday'], $christmasDay, false, false); + $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); break; case 5: // friday $boxingDay->add(new DateInterval('P2D')); - $this->calculateHoliday('secondChristmasHoliday', ['en' => 'Boxing Day Holiday'], $boxingDay, false, false); + $this->calculateHoliday('secondChristmasHoliday', $boxingDay, ['en' => 'Boxing Day Holiday'], false, false); break; case 6: // saturday $christmasDay->add(new DateInterval('P2D')); $boxingDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', ['en' => 'Christmas Holiday'], $christmasDay, false, false); - $this->calculateHoliday('secondChristmasHoliday', ['en' => 'Boxing Day Holiday'], $boxingDay, false, false); + $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); + $this->calculateHoliday('secondChristmasHoliday', $boxingDay, ['en' => 'Boxing Day Holiday'], false, false); break; } } diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index 270364e49..ca14089c7 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -135,8 +135,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NSW.php index df5c7567e..0ccbf52b4 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NSW.php @@ -102,8 +102,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); @@ -131,8 +131,8 @@ private function calculateBankHoliday(): void { $this->calculateHoliday( 'bankHoliday', - ['en' => 'Bank Holiday'], new DateTime('first monday of august ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Bank Holiday'], false, false, Holiday::TYPE_BANK diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NT.php index 53444460c..8e9d7c80c 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NT.php @@ -101,8 +101,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); @@ -132,8 +132,8 @@ private function calculatePicnicDay(): void { $this->calculateHoliday( 'picnicDay', - ['en' => 'Picnic Day'], new DateTime('first monday of august ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Picnic Day'], false, false ); diff --git a/src/Yasumi/Provider/Australia/Queensland.php b/src/Yasumi/Provider/Australia/Queensland.php index 007d3e375..dddd00be9 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -72,8 +72,8 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime($birthDay, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index 06d5a9eda..ba86477ac 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -109,8 +109,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); @@ -147,8 +147,8 @@ private function calculateAdelaideCupDay(): void $this->calculateHoliday( 'adelaideCup', - ['en' => 'Adelaide Cup'], new DateTime($cupDay, new DateTimeZone($this->timezone)), + ['en' => 'Adelaide Cup'], false, false ); @@ -163,27 +163,27 @@ private function calculateAdelaideCupDay(): void private function calculateProclamationDay(): void { $christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone)); - $this->calculateHoliday('christmasDay', [], $christmasDay, false, false); + $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); switch ($christmasDay->format('w')) { case 0: // sunday $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('christmasHoliday', ['en' => 'Christmas Holiday'], $christmasDay, false, false); + $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', ['en' => 'Proclamation Day'], $proclamationDay, false, false); + $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); break; case 5: // friday $proclamationDay = $christmasDay->add(new DateInterval('P3D')); - $this->calculateHoliday('proclamationDay', ['en' => 'Proclamation Day'], $proclamationDay, false, false); + $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); break; case 6: // saturday $christmasDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', ['en' => 'Christmas Holiday'], $christmasDay, false, false); + $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', ['en' => 'Proclamation Day'], $proclamationDay, false, false); + $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); break; default: // monday-thursday $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', ['en' => 'Proclamation Day'], $proclamationDay, false, false); + $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); break; } } diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index bf53bbe03..01b22f009 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -79,8 +79,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => 'Queen\'s Birthday'], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Queen\'s Birthday'], false, false ); @@ -98,8 +98,8 @@ private function calculateRecreationDay(): void { $this->calculateHoliday( 'recreationDay', - ['en' => 'Recreation Day'], new DateTime('first monday of november ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Recreation Day'], false, false ); diff --git a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php index f26bdd06d..a43466f02 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php @@ -53,8 +53,8 @@ private function calculateKingIslandShow(): void { $this->calculateHoliday( 'kingIslandShow', - ['en' => 'King Island Show'], new DateTime('first tuesday of march ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'King Island Show'], false, false ); diff --git a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php index c1ae91d3c..73e672226 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php @@ -56,8 +56,8 @@ private function calculateHobartRegatta(): void { $this->calculateHoliday( 'hobartRegatta', - ['en' => 'Royal Hobart Regatta'], new DateTime('second monday of february ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Royal Hobart Regatta'], false, false ); diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index 88a9a2ccf..b4b4445bd 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -147,8 +147,8 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - ['en' => 'Queen\'s Birthday'], new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Queen\'s Birthday'], false, false ); diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WA.php index 1eaf91a3f..1ef868f6a 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WA.php @@ -76,8 +76,8 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', - ['en' => "Queen's Birthday"], new DateTime($birthDay, new DateTimeZone($this->timezone)), + ['en' => "Queen's Birthday"], false, false ); @@ -107,8 +107,8 @@ private function calculateWesternAustraliaDay(): void { $this->calculateHoliday( 'westernAustraliaDay', - ['en' => 'Western Australia Day'], new DateTime('first monday of june ' . $this->year, new DateTimeZone($this->timezone)), + ['en' => 'Western Australia Day'], false, false ); diff --git a/tests/NewZealand/AnzacDayTest.php b/tests/NewZealand/AnzacDayTest.php index 06fdfbd2b..24afcbf3e 100644 --- a/tests/NewZealand/AnzacDayTest.php +++ b/tests/NewZealand/AnzacDayTest.php @@ -77,7 +77,7 @@ public function HolidayDataProvider(): array if ($year >= 2015 && $this->isWeekend($date)) { $date->modify('next monday'); } - }, self::TIMEZONE, 100, self::ESTABLISHMENT_YEAR); + }, 100, self::ESTABLISHMENT_YEAR, self::TIMEZONE); } /** diff --git a/tests/NewZealand/WaitangiDayTest.php b/tests/NewZealand/WaitangiDayTest.php index d2ca5b388..f24ac8088 100644 --- a/tests/NewZealand/WaitangiDayTest.php +++ b/tests/NewZealand/WaitangiDayTest.php @@ -105,6 +105,6 @@ public function HolidayDataProvider(): array if ($year >= 2015 && $this->isWeekend($date)) { $date->modify('next monday'); } - }, self::TIMEZONE, 100, self::ESTABLISHMENT_YEAR); + }, 100, self::ESTABLISHMENT_YEAR, self::TIMEZONE); } } diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index c99c40d5b..330a36b2c 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -479,7 +479,7 @@ public function generateRandomDatesWithHolidayMovedToMonday( if ($this->isWeekend($date)) { $date->modify('next monday'); } - }, $timezone ?? 'UTC', $iterations ?? 10, $range); + }, $iterations ?? 10, $range, $timezone ?? 'UTC'); } /** @@ -488,10 +488,10 @@ public function generateRandomDatesWithHolidayMovedToMonday( * @param int $month month (number) for which the test date needs to be generated * @param int $day day (number) for which the test date needs to be generated * @param callable $callback callback(int $year, \DateTime $dateTime) to modify $dateTime by custom rules - * @param string $timezone name of the timezone for which the dates need to be generated * @param int $iterations number of iterations (i.e. samples) that need to be generated (default: 10) * @param int $range year range from which dates will be generated (default: 1000) * + * @param string $timezone name of the timezone for which the dates need to be generated * @return array list of random test dates used for assertion of holidays with applied callback. * @throws Exception */ @@ -499,9 +499,9 @@ public function generateRandomDatesWithModifier( $month, $day, callable $callback, - $timezone = null, $iterations, - $range + $range, + $timezone = null ): array { $data = []; From 9b48946cc9a45e7c9997f11669b33d211827f6ec Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 2 Nov 2019 20:23:21 +0900 Subject: [PATCH 018/115] Added parameter data types. Signed-off-by: Sacha Telgenhof --- tests/YasumiBase.php | 125 +++++++++++++++++++++++++++++-------------- 1 file changed, 85 insertions(+), 40 deletions(-) diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index 330a36b2c..f2e58b30a 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -54,8 +54,12 @@ trait YasumiBase * @throws UnknownLocaleException * @throws ReflectionException */ - public function assertDefinedHolidays($expectedHolidays, $provider, $year, $type): void - { + public function assertDefinedHolidays( + array $expectedHolidays, + string $provider, + int $year, + string $type + ): void { $holidays = Yasumi::create($provider, $year); switch ($type) { @@ -99,8 +103,12 @@ public function assertDefinedHolidays($expectedHolidays, $provider, $year, $type * @throws AssertionFailedError * @throws ReflectionException */ - public function assertHoliday($provider, $shortName, $year, $expected): void - { + public function assertHoliday( + string $provider, + string $shortName, + int $year, + DateTime $expected + ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); @@ -126,8 +134,11 @@ public function assertHoliday($provider, $shortName, $year, $expected): void * @throws AssertionFailedError * @throws ReflectionException */ - public function assertNotHoliday($provider, $shortName, $year): void - { + public function assertNotHoliday( + string $provider, + string $shortName, + int $year + ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); @@ -150,8 +161,12 @@ public function assertNotHoliday($provider, $shortName, $year): void * @throws AssertionFailedError * @throws ReflectionException */ - public function assertTranslatedHolidayName($provider, $shortName, $year, $translations): void - { + public function assertTranslatedHolidayName( + string $provider, + string $shortName, + int $year, + array $translations + ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); @@ -197,8 +212,12 @@ public function assertTranslatedHolidayName($provider, $shortName, $year, $trans * @throws UnknownLocaleException * @throws ReflectionException */ - public function assertHolidayType($provider, $shortName, $year, $type): void - { + public function assertHolidayType( + string $provider, + string $shortName, + int $year, + string $type + ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); @@ -224,8 +243,12 @@ public function assertHolidayType($provider, $shortName, $year, $type): void * @throws UnknownLocaleException * @throws ReflectionException */ - public function assertDayOfWeek($provider, $shortName, $year, $expectedDayOfWeek): void - { + public function assertDayOfWeek( + string $provider, + string $shortName, + int $year, + string $expectedDayOfWeek + ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($shortName); @@ -249,8 +272,13 @@ public function assertDayOfWeek($provider, $shortName, $year, $expectedDayOfWeek * @return array list of random test dates used for assertion of holidays. * @throws Exception */ - public function generateRandomDates($month, $day, $timezone = null, $iterations = null, $range = null): array - { + public function generateRandomDates( + int $month, + int $day, + string $timezone = null, + int $iterations = null, + int $range = null + ): array { $data = []; $range = $range ?? 1000; for ($y = 1; $y <= ($iterations ?? 10); $y++) { @@ -271,8 +299,11 @@ public function generateRandomDates($month, $day, $timezone = null, $iterations * @return array list of random easter test dates used for assertion of holidays. * @throws Exception */ - public function generateRandomEasterDates($timezone = null, $iterations = null, $range = null): array - { + public function generateRandomEasterDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { $data = []; $range = $range ?? 1000; @@ -376,8 +407,11 @@ protected function calculateEaster(int $year, string $timezone): DateTime * * @throws Exception */ - public function generateRandomEasterMondayDates($timezone = null, $iterations = null, $range = null): array - { + public function generateRandomEasterMondayDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { $range = $range ?? 1000; return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { $date->add(new DateInterval('P1D')); @@ -397,9 +431,9 @@ public function generateRandomEasterMondayDates($timezone = null, $iterations = */ public function generateRandomModifiedEasterDates( callable $cb, - $timezone = null, - $iterations = null, - $range = null + string $timezone = null, + int $iterations = null, + int $range = null ): array { $data = []; $range = $range ?? 1000; @@ -426,8 +460,11 @@ public function generateRandomModifiedEasterDates( * * @throws Exception */ - public function generateRandomGoodFridayDates($timezone = null, $iterations = null, $range = null): array - { + public function generateRandomGoodFridayDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { $range = $range ?? 1000; return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { @@ -446,8 +483,11 @@ public function generateRandomGoodFridayDates($timezone = null, $iterations = nu * * @throws Exception */ - public function generateRandomPentecostDates($timezone = null, $iterations = null, $range = null): array - { + public function generateRandomPentecostDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { $range = $range ?? 1000; return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { @@ -469,11 +509,11 @@ public function generateRandomPentecostDates($timezone = null, $iterations = nul * @throws Exception */ public function generateRandomDatesWithHolidayMovedToMonday( - $month, - $day, - $timezone = null, - $iterations = null, - $range = null + int $month, + int $day, + string $timezone = null, + int $iterations = null, + int $range = null ): array { return $this->generateRandomDatesWithModifier($month, $day, function ($range, DateTime $date) { if ($this->isWeekend($date)) { @@ -490,18 +530,19 @@ public function generateRandomDatesWithHolidayMovedToMonday( * @param callable $callback callback(int $year, \DateTime $dateTime) to modify $dateTime by custom rules * @param int $iterations number of iterations (i.e. samples) that need to be generated (default: 10) * @param int $range year range from which dates will be generated (default: 1000) - * * @param string $timezone name of the timezone for which the dates need to be generated + * * @return array list of random test dates used for assertion of holidays with applied callback. + * * @throws Exception */ public function generateRandomDatesWithModifier( - $month, - $day, + int $month, + int $day, callable $callback, - $iterations, - $range, - $timezone = null + int $iterations, + int $range, + string $timezone = null ): array { $data = []; @@ -525,8 +566,10 @@ public function generateRandomDatesWithModifier( * * @return int a year number */ - public function generateRandomYear($lowerLimit = null, $upperLimit = null): int - { + public function generateRandomYear( + int $lowerLimit = null, + int $upperLimit = null + ): int { return (int)Faker::create()->numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); } @@ -538,8 +581,10 @@ public function generateRandomYear($lowerLimit = null, $upperLimit = null): int * * @return bool true if $dateTime is a weekend, false otherwise */ - public function isWeekend(DateTimeInterface $dateTime, array $weekendDays = [0, 6]): bool - { + public function isWeekend( + DateTimeInterface $dateTime, + array $weekendDays = [0, 6] + ): bool { return \in_array((int)$dateTime->format('w'), $weekendDays, true); } } From 9044e9f706fb608819e9324ef626f45a73e46060 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 2 Nov 2019 22:11:37 +0900 Subject: [PATCH 019/115] Added missing parameter types. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Filters/BetweenFilter.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 30 +++++++++++++--------- src/Yasumi/Provider/Australia.php | 8 +++--- src/Yasumi/Provider/Australia/ACT.php | 16 +++++++++--- src/Yasumi/Provider/Australia/NSW.php | 8 ++++-- src/Yasumi/Provider/Australia/NT.php | 8 ++++-- src/Yasumi/Provider/Australia/SA.php | 8 ++++-- src/Yasumi/Provider/Australia/Victoria.php | 16 +++++++++--- src/Yasumi/Provider/ChristianHolidays.php | 8 ++++-- src/Yasumi/Provider/CommonHolidays.php | 23 ++++++++++++----- src/Yasumi/Provider/Greece.php | 2 +- src/Yasumi/Provider/Romania.php | 2 +- src/Yasumi/Provider/Ukraine.php | 2 +- tests/Base/YasumiTest.php | 10 ++++---- 14 files changed, 96 insertions(+), 47 deletions(-) diff --git a/src/Yasumi/Filters/BetweenFilter.php b/src/Yasumi/Filters/BetweenFilter.php index 8e6dae7ce..709d027d9 100644 --- a/src/Yasumi/Filters/BetweenFilter.php +++ b/src/Yasumi/Filters/BetweenFilter.php @@ -55,7 +55,7 @@ public function __construct( Iterator $iterator, \DateTimeInterface $startDate, \DateTimeInterface $endDate, - $equal = true + bool $equal = true ) { parent::__construct($iterator); $this->equal = $equal; diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index b2624539f..4f05c02a0 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -106,8 +106,11 @@ abstract class AbstractProvider implements ProviderInterface, Countable, Iterato * represented * @param TranslationsInterface|null $globalTranslations global translations */ - public function __construct($year, $locale = null, ?TranslationsInterface $globalTranslations = null) - { + public function __construct( + int $year, + ?string $locale = null, + ?TranslationsInterface $globalTranslations = null + ) { $this->clearHolidays(); $this->year = $year ?: \getdate()['year']; @@ -170,7 +173,7 @@ public function addHoliday(Holiday $holiday): void * * @return void */ - public function removeHoliday($shortName): void + public function removeHoliday(string $shortName): void { unset($this->holidays[$shortName]); } @@ -251,7 +254,7 @@ public function getHolidayDates(): array * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function whenIs($shortName): string + public function whenIs(string $shortName): string { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty @@ -266,7 +269,7 @@ public function whenIs($shortName): string * @return true upon success, otherwise an InvalidArgumentException is thrown * @throws InvalidArgumentException An InvalidArgumentException is thrown if the given holiday parameter is empty. */ - protected function isHolidayNameNotEmpty($shortName): bool + protected function isHolidayNameNotEmpty(string $shortName): bool { if (empty($shortName)) { throw new InvalidArgumentException('Holiday name can not be blank.'); @@ -287,7 +290,7 @@ protected function isHolidayNameNotEmpty($shortName): bool * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function whatWeekDayIs($shortName): int + public function whatWeekDayIs(string $shortName): int { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty @@ -357,7 +360,7 @@ public function getYear(): int * * @covers AbstractProvider::anotherTime */ - public function next($shortName): ?Holiday + public function next(string $shortName): ?Holiday { return $this->anotherTime($this->year + 1, $shortName); } @@ -375,7 +378,7 @@ public function next($shortName): ?Holiday * @throws UnknownLocaleException * @throws \RuntimeException */ - private function anotherTime($year, $shortName): ?Holiday + private function anotherTime(int $year, string $shortName): ?Holiday { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty @@ -394,7 +397,7 @@ private function anotherTime($year, $shortName): ?Holiday * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function getHoliday($shortName): ?Holiday + public function getHoliday(string $shortName): ?Holiday { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty @@ -417,7 +420,7 @@ public function getHoliday($shortName): ?Holiday * * @covers AbstractProvider::anotherTime */ - public function previous($shortName): ?Holiday + public function previous(string $shortName): ?Holiday { return $this->anotherTime($this->year - 1, $shortName); } @@ -444,8 +447,11 @@ public function previous($shortName): ?Holiday * date. * */ - public function between(\DateTimeInterface $startDate, \DateTimeInterface $endDate, $equals = null): BetweenFilter - { + public function between( + \DateTimeInterface $startDate, + \DateTimeInterface $endDate, + ?bool $equals = null + ): BetweenFilter { if ($startDate > $endDate) { throw new InvalidArgumentException('Start date must be a date before the end date.'); } diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index aba89681c..4ae67a501 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -101,11 +101,11 @@ private function calculateNewYearHolidays(): void */ public function calculateHoliday( string $shortName, - $date, + DateTime $date, array $names = [], - $moveFromSaturday = null, - $moveFromSunday = null, - $type = null + ?bool $moveFromSaturday = null, + ?bool $moveFromSunday = null, + ?string $type = null ): void { $day = (int)$date->format('w'); if ((0 === $day && ($moveFromSunday ?? true)) || (6 === $day && ($moveFromSaturday ?? true))) { diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index ca14089c7..da3e00cd1 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -73,8 +73,12 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSunday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSunday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easter', ['en' => 'Easter Sunday'], @@ -105,8 +109,12 @@ private function easterSunday($year, $timezone, $locale, $type = null): Holiday * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSaturday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSaturday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NSW.php index 0ccbf52b4..c46be04e1 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NSW.php @@ -72,8 +72,12 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSaturday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSaturday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NT.php index 8e9d7c80c..b49798eb2 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NT.php @@ -71,8 +71,12 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSaturday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSaturday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index ba86477ac..425437e22 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -79,8 +79,12 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSaturday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSaturday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index b4b4445bd..e158d9e6e 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -73,8 +73,12 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSunday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSunday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easter', ['en' => 'Easter Sunday'], @@ -105,8 +109,12 @@ private function easterSunday($year, $timezone, $locale, $type = null): Holiday * @throws \InvalidArgumentException * @throws \Exception */ - private function easterSaturday($year, $timezone, $locale, $type = null): Holiday - { + private function easterSaturday( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): Holiday { return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index e2490bd13..5d79316ea 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -49,8 +49,12 @@ trait ChristianHolidays * @throws \InvalidArgumentException * @throws \Exception */ - public function easter(int $year, string $timezone, string $locale, string $type = Holiday::TYPE_OFFICIAL): Holiday - { + public function easter( + int $year, + string $timezone, + string $locale, + string $type = Holiday::TYPE_OFFICIAL + ): Holiday { return new Holiday('easter', [], $this->calculateEaster($year, $timezone), $locale, $type); } diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index b2b0e2c68..09c8b87f7 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -451,8 +451,12 @@ public function internationalWomensDay( * @throws \InvalidArgumentException * @throws \Exception */ - public function summerTime($year, $timezone, $locale, $type = null): ?Holiday - { + public function summerTime( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, true); if ($date instanceof \DateTimeImmutable) { @@ -489,8 +493,11 @@ public function summerTime($year, $timezone, $locale, $type = null): ?Holiday * timezone. If no transition time is found, a null value is returned. * @throws \Exception */ - protected function calculateSummerWinterTime($year, $timezone, $summer): ?\DateTimeImmutable - { + protected function calculateSummerWinterTime( + int $year, + string $timezone, + bool $summer + ): ?\DateTimeImmutable { $zone = new DateTimeZone($timezone); $transitions = $zone->getTransitions(\mktime(0, 0, 0, 1, 1, $year), \mktime(23, 59, 59, 12, 31, $year)); @@ -525,8 +532,12 @@ protected function calculateSummerWinterTime($year, $timezone, $summer): ?\DateT * @throws \InvalidArgumentException * @throws \Exception */ - public function winterTime($year, $timezone, $locale, $type = null): ?Holiday - { + public function winterTime( + int $year, + string $timezone, + string $locale, + ?string $type = null + ): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, false); if ($date instanceof \DateTimeImmutable) { diff --git a/src/Yasumi/Provider/Greece.php b/src/Yasumi/Provider/Greece.php index c29132560..64e0fcefe 100644 --- a/src/Yasumi/Provider/Greece.php +++ b/src/Yasumi/Provider/Greece.php @@ -126,7 +126,7 @@ private function calculateCleanMonday(): void * * @throws \Exception */ - private function calculateEaster($year, $timezone): DateTime + private function calculateEaster(int $year, string $timezone): DateTime { return $this->calculateOrthodoxEaster($year, $timezone); } diff --git a/src/Yasumi/Provider/Romania.php b/src/Yasumi/Provider/Romania.php index 450bcacbd..dbb0e510e 100755 --- a/src/Yasumi/Provider/Romania.php +++ b/src/Yasumi/Provider/Romania.php @@ -258,7 +258,7 @@ private function calculateChildrensDay(): void * * @throws \Exception */ - public function calculateEaster($year, $timezone): DateTime + public function calculateEaster(int $year, string $timezone): DateTime { return $this->calculateOrthodoxEaster($year, $timezone); } diff --git a/src/Yasumi/Provider/Ukraine.php b/src/Yasumi/Provider/Ukraine.php index 7476a27ac..5485d3a0c 100644 --- a/src/Yasumi/Provider/Ukraine.php +++ b/src/Yasumi/Provider/Ukraine.php @@ -218,7 +218,7 @@ private function calculateDefenderOfUkraineDay(): void * * @throws \Exception */ - public function calculateEaster($year, $timezone): \DateTime + public function calculateEaster(int $year, string $timezone): \DateTime { return $this->calculateOrthodoxEaster($year, $timezone); } diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index bc149f30d..43ab30899 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -193,7 +193,7 @@ public function testNextWithBlankName(): void 'Netherlands', Factory::create()->numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND - 1) ); - $holidays->next(null); + $holidays->next(''); } /** @@ -231,7 +231,7 @@ public function testPreviousWithBlankName(): void 'Netherlands', Factory::create()->numberBetween(self::YEAR_LOWER_BOUND + 1, self::YEAR_UPPER_BOUND) ); - $holidays->previous(null); + $holidays->previous(''); } /** @@ -272,7 +272,7 @@ public function testWhenIsWithBlankName(): void $this->expectException(InvalidArgumentException::class); $holidays = Yasumi::create('Japan', 2010); - $holidays->whenIs(null); + $holidays->whenIs(''); } /** @@ -285,7 +285,7 @@ public function testGetHolidayWithBlankName(): void $this->expectException(InvalidArgumentException::class); $holidays = Yasumi::create('Netherlands', 1999); - $holidays->getHoliday(null); + $holidays->getHoliday(''); } /** @@ -312,7 +312,7 @@ public function testWhatWeekDayIsWithBlankName(): void $this->expectException(InvalidArgumentException::class); $holidays = Yasumi::create('Netherlands', 2388); - $holidays->whatWeekDayIs(null); + $holidays->whatWeekDayIs(''); } /** From 05b1688193fda57f8081c3626f8f2ebd3135568b Mon Sep 17 00:00:00 2001 From: aprog Date: Sat, 9 Nov 2019 10:52:16 +0200 Subject: [PATCH 020/115] Holiday providers for states of Austria (#182) * Added holiday providers for states of Austria. * Implemented tests for holiday providers that belong to states of Austria. * Added translations for holidays that belong to states of Austria. --- src/Yasumi/Provider/Austria.php | 30 +++++ src/Yasumi/Provider/Austria/Burgenland.php | 47 ++++++++ src/Yasumi/Provider/Austria/Carinthia.php | 79 +++++++++++++ src/Yasumi/Provider/Austria/LowerAustria.php | 47 ++++++++ src/Yasumi/Provider/Austria/Salzburg.php | 80 +++++++++++++ src/Yasumi/Provider/Austria/Styria.php | 47 ++++++++ src/Yasumi/Provider/Austria/Tyrol.php | 47 ++++++++ src/Yasumi/Provider/Austria/UpperAustria.php | 81 ++++++++++++++ src/Yasumi/Provider/Austria/Vienna.php | 47 ++++++++ src/Yasumi/Provider/Austria/Vorarlberg.php | 47 ++++++++ .../data/translations/plebisciteDay.php | 18 +++ .../data/translations/stFloriansDay.php | 18 +++ .../data/translations/stLeopoldsDay.php | 18 +++ src/Yasumi/data/translations/stMartinsDay.php | 1 + src/Yasumi/data/translations/stRupertsDay.php | 18 +++ tests/Austria/AustriaBaseTestCase.php | 11 +- .../Burgenland/BurgenlandBaseTestCase.php | 29 +++++ tests/Austria/Burgenland/stMartinsDayTest.php | 80 +++++++++++++ .../Carinthia/CarinthiaBaseTestCase.php | 29 +++++ tests/Austria/Carinthia/PlebisciteDayTest.php | 105 ++++++++++++++++++ tests/Austria/Carinthia/StJosephsDayTest.php | 79 +++++++++++++ .../LowerAustria/LowerAustriaBaseTestCase.php | 29 +++++ .../LowerAustria/StLeopoldsDayTest.php | 105 ++++++++++++++++++ .../Austria/Salzburg/SalzburgBaseTestCase.php | 29 +++++ tests/Austria/Salzburg/StRupertsDayTest.php | 79 +++++++++++++ tests/Austria/Styria/StJosephsDayTest.php | 79 +++++++++++++ tests/Austria/Styria/StyriaBaseTestCase.php | 29 +++++ tests/Austria/Tyrol/StJosephsDayTest.php | 79 +++++++++++++ tests/Austria/Tyrol/TyrolBaseTestCase.php | 29 +++++ .../UpperAustria/StFloriansDayTest.php | 79 +++++++++++++ .../UpperAustria/UpperAustriaBaseTestCase.php | 29 +++++ tests/Austria/Vienna/StLeopoldsDayTest.php | 105 ++++++++++++++++++ tests/Austria/Vienna/ViennaBaseTestCase.php | 29 +++++ tests/Austria/Vorarlberg/StJosephsDayTest.php | 79 +++++++++++++ .../Vorarlberg/VorarlbergBaseTestCase.php | 29 +++++ 35 files changed, 1763 insertions(+), 3 deletions(-) create mode 100755 src/Yasumi/Provider/Austria/Burgenland.php create mode 100755 src/Yasumi/Provider/Austria/Carinthia.php create mode 100755 src/Yasumi/Provider/Austria/LowerAustria.php create mode 100755 src/Yasumi/Provider/Austria/Salzburg.php create mode 100755 src/Yasumi/Provider/Austria/Styria.php create mode 100755 src/Yasumi/Provider/Austria/Tyrol.php create mode 100755 src/Yasumi/Provider/Austria/UpperAustria.php create mode 100755 src/Yasumi/Provider/Austria/Vienna.php create mode 100755 src/Yasumi/Provider/Austria/Vorarlberg.php create mode 100644 src/Yasumi/data/translations/plebisciteDay.php create mode 100644 src/Yasumi/data/translations/stFloriansDay.php create mode 100644 src/Yasumi/data/translations/stLeopoldsDay.php create mode 100644 src/Yasumi/data/translations/stRupertsDay.php create mode 100644 tests/Austria/Burgenland/BurgenlandBaseTestCase.php create mode 100644 tests/Austria/Burgenland/stMartinsDayTest.php create mode 100644 tests/Austria/Carinthia/CarinthiaBaseTestCase.php create mode 100644 tests/Austria/Carinthia/PlebisciteDayTest.php create mode 100644 tests/Austria/Carinthia/StJosephsDayTest.php create mode 100644 tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php create mode 100644 tests/Austria/LowerAustria/StLeopoldsDayTest.php create mode 100644 tests/Austria/Salzburg/SalzburgBaseTestCase.php create mode 100644 tests/Austria/Salzburg/StRupertsDayTest.php create mode 100644 tests/Austria/Styria/StJosephsDayTest.php create mode 100644 tests/Austria/Styria/StyriaBaseTestCase.php create mode 100644 tests/Austria/Tyrol/StJosephsDayTest.php create mode 100644 tests/Austria/Tyrol/TyrolBaseTestCase.php create mode 100644 tests/Austria/UpperAustria/StFloriansDayTest.php create mode 100644 tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php create mode 100644 tests/Austria/Vienna/StLeopoldsDayTest.php create mode 100644 tests/Austria/Vienna/ViennaBaseTestCase.php create mode 100644 tests/Austria/Vorarlberg/StJosephsDayTest.php create mode 100644 tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php diff --git a/src/Yasumi/Provider/Austria.php b/src/Yasumi/Provider/Austria.php index 0d31900db..001f77a78 100644 --- a/src/Yasumi/Provider/Austria.php +++ b/src/Yasumi/Provider/Austria.php @@ -93,4 +93,34 @@ private function calculateNationalDay(): void $this->locale )); } + + /** + * Saint Leopold's Day. + * + * Saint Leopold III, known as Leopold the Good, was the Margrave of Austria + * from 1095 to his death in 1136. He was a member of the House of + * Babenberg. He was canonized on 6 January 1485 and became the patron saint + * of Austria, Lower Austria, Upper Austria, and Vienna. His feast day is 15 + * November. + * + * @link https://en.wikipedia.org/wiki/Leopold_III,_Margrave_of_Austria + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateStLeopoldsDay(): void + { + if ($this->year < 1136) { + return; + } + + $this->addHoliday(new Holiday( + 'stLeopoldsDay', + [], + new DateTime($this->year . '-11-15', new \DateTimeZone($this->timezone)), + $this->locale + )); + } } diff --git a/src/Yasumi/Provider/Austria/Burgenland.php b/src/Yasumi/Provider/Austria/Burgenland.php new file mode 100755 index 000000000..bea27c489 --- /dev/null +++ b/src/Yasumi/Provider/Austria/Burgenland.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Burgenland (Austria). + * + * @link https://en.wikipedia.org/wiki/Burgenland + */ +class Burgenland extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-1'; + + /** + * Initialize holidays for Burgenland (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom Common holidays. + $this->addHoliday($this->stMartinsDay($this->year, $this->timezone, $this->locale)); + } +} diff --git a/src/Yasumi/Provider/Austria/Carinthia.php b/src/Yasumi/Provider/Austria/Carinthia.php new file mode 100755 index 000000000..4532877cb --- /dev/null +++ b/src/Yasumi/Provider/Austria/Carinthia.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Carinthia (Austria). + * + * @link https://en.wikipedia.org/wiki/Carinthia + */ +class Carinthia extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-2'; + + /** + * Initialize holidays for Carinthia (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom Common holidays. + $this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); + $this->calculatePlebisciteDay(); + } + + /** + * Plebiscite Day. + * + * The Carinthian plebiscite was held on 10 October 1920 in the area + * predominantly settled by Carinthian Slovenes. It determined the final + * southern border between the Republic of Austria and the newly formed + * Kingdom of Serbs, Croats and Slovenes (Yugoslavia) after World War I. + * + * @link https://en.wikipedia.org/wiki/1920_Carinthian_plebiscite + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculatePlebisciteDay(): void + { + if ($this->year < 1920) { + return; + } + + $this->addHoliday(new Holiday( + 'plebisciteDay', + [], + new DateTime($this->year . '-10-10', new \DateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Austria/LowerAustria.php b/src/Yasumi/Provider/Austria/LowerAustria.php new file mode 100755 index 000000000..82182e671 --- /dev/null +++ b/src/Yasumi/Provider/Austria/LowerAustria.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Lower Austria (Austria). + * + * @link https://en.wikipedia.org/wiki/Lower_Austria + */ +class LowerAustria extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-3'; + + /** + * Initialize holidays for Lower Austria (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom holidays. + $this->calculateStLeopoldsDay(); + } +} diff --git a/src/Yasumi/Provider/Austria/Salzburg.php b/src/Yasumi/Provider/Austria/Salzburg.php new file mode 100755 index 000000000..f0c1d1b26 --- /dev/null +++ b/src/Yasumi/Provider/Austria/Salzburg.php @@ -0,0 +1,80 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Salzburg (Austria). + * + * @link https://en.wikipedia.org/wiki/Salzburg_(state) + */ +class Salzburg extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-5'; + + /** + * Initialize holidays for Salzburg (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom holidays. + $this->calculateStRupertsDay(); + } + + /** + * Saint Rupert's Day. + * + * Rupert of Salzburg was Bishop of Worms as well as the first Bishop of + * Salzburg and abbot of St. Peter's in Salzburg. He was a contemporary of + * the Frankish king Childebert III and is venerated as a saint in the + * Roman Catholic and Eastern Orthodox Churches. Rupert is also patron + * saint of the Austrian state of Salzburg. His feast day in Austria is + * September 24 (since 710). + * + * @link https://en.wikipedia.org/wiki/Rupert_of_Salzburg + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateStRupertsDay(): void + { + if ($this->year < 710) { + return; + } + + $this->addHoliday(new Holiday( + 'stRupertsDay', + [], + new DateTime($this->year . '-9-24', new \DateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Austria/Styria.php b/src/Yasumi/Provider/Austria/Styria.php new file mode 100755 index 000000000..3d6d2b4ca --- /dev/null +++ b/src/Yasumi/Provider/Austria/Styria.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Styria (Austria). + * + * @link https://en.wikipedia.org/wiki/Styria + */ +class Styria extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-6'; + + /** + * Initialize holidays for Styria (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom Common holidays. + $this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); + } +} diff --git a/src/Yasumi/Provider/Austria/Tyrol.php b/src/Yasumi/Provider/Austria/Tyrol.php new file mode 100755 index 000000000..e3e4eed66 --- /dev/null +++ b/src/Yasumi/Provider/Austria/Tyrol.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Tyrol (Austria). + * + * @link https://en.wikipedia.org/wiki/Tyrol_(state) + */ +class Tyrol extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-7'; + + /** + * Initialize holidays for Tyrol (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom Common holidays. + $this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); + } +} diff --git a/src/Yasumi/Provider/Austria/UpperAustria.php b/src/Yasumi/Provider/Austria/UpperAustria.php new file mode 100755 index 000000000..969ec4044 --- /dev/null +++ b/src/Yasumi/Provider/Austria/UpperAustria.php @@ -0,0 +1,81 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Upper Austria (Austria). + * + * @link https://en.wikipedia.org/wiki/Upper_Austria + */ +class UpperAustria extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-4'; + + /** + * Initialize holidays for Upper Austria (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom holidays. + $this->calculateStFloriansDay(); + } + + /** + * Saint Florian's Day. + * + * St. Florian was born around 250 AD in the ancient Roman city of Aelium + * Cetium, present-day Sankt Pölten, Austria. He joined the Roman Army and + * advanced in the ranks, rising to commander of the imperial army in the + * Roman province of Noricum. In addition to his military duties, he was + * also responsible for organizing and leading firefighting brigades. + * Florian organized and trained an elite group of soldiers whose sole duty + * was to fight fires. His feast day is May 4 (since 304). + * + * @link https://en.wikipedia.org/wiki/Saint_Florian + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateStFloriansDay(): void + { + if ($this->year < 304) { + return; + } + + $this->addHoliday(new Holiday( + 'stFloriansDay', + [], + new DateTime($this->year . '-5-4', new \DateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Austria/Vienna.php b/src/Yasumi/Provider/Austria/Vienna.php new file mode 100755 index 000000000..1607d541e --- /dev/null +++ b/src/Yasumi/Provider/Austria/Vienna.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Vienna (Austria). + * + * @link https://en.wikipedia.org/wiki/Vienna + */ +class Vienna extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-9'; + + /** + * Initialize holidays for Vienna (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom holidays. + $this->calculateStLeopoldsDay(); + } +} diff --git a/src/Yasumi/Provider/Austria/Vorarlberg.php b/src/Yasumi/Provider/Austria/Vorarlberg.php new file mode 100755 index 000000000..983e97975 --- /dev/null +++ b/src/Yasumi/Provider/Austria/Vorarlberg.php @@ -0,0 +1,47 @@ + + */ + +namespace Yasumi\Provider\Austria; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Provider\Austria; + +/** + * Provider for all holidays in Vorarlberg (Austria). + * + * @link https://en.wikipedia.org/wiki/Vorarlberg + */ +class Vorarlberg extends Austria +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'AT-8'; + + /** + * Initialize holidays for Vorarlberg (Austria). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + // Add custom Common holidays. + $this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); + } +} diff --git a/src/Yasumi/data/translations/plebisciteDay.php b/src/Yasumi/data/translations/plebisciteDay.php new file mode 100644 index 000000000..7e4767a9e --- /dev/null +++ b/src/Yasumi/data/translations/plebisciteDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Plebiscite Day. +return [ + 'en' => 'Plebiscite Day', + 'de_AT' => 'Tag der Volksabstimmung', +]; diff --git a/src/Yasumi/data/translations/stFloriansDay.php b/src/Yasumi/data/translations/stFloriansDay.php new file mode 100644 index 000000000..a8fbe48ba --- /dev/null +++ b/src/Yasumi/data/translations/stFloriansDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Saint Florian's Day. +return [ + 'en' => 'Saint Florian\'s Day', + 'de_AT' => 'Florian', +]; diff --git a/src/Yasumi/data/translations/stLeopoldsDay.php b/src/Yasumi/data/translations/stLeopoldsDay.php new file mode 100644 index 000000000..ff64801b0 --- /dev/null +++ b/src/Yasumi/data/translations/stLeopoldsDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Saint Leopold's Day. +return [ + 'en' => 'Saint Leopold\'s Day', + 'de_AT' => 'Leopold', +]; diff --git a/src/Yasumi/data/translations/stMartinsDay.php b/src/Yasumi/data/translations/stMartinsDay.php index 89eb38b11..38f598277 100644 --- a/src/Yasumi/data/translations/stMartinsDay.php +++ b/src/Yasumi/data/translations/stMartinsDay.php @@ -15,4 +15,5 @@ return [ 'en' => 'St. Martin\'s Day', 'nl' => 'Sint Maarten', + 'de_AT' => 'Martin', ]; diff --git a/src/Yasumi/data/translations/stRupertsDay.php b/src/Yasumi/data/translations/stRupertsDay.php new file mode 100644 index 000000000..19d3f76fa --- /dev/null +++ b/src/Yasumi/data/translations/stRupertsDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Saint Rupert's Day. +return [ + 'en' => 'Saint Rupert\'s Day', + 'de_AT' => 'Rupert', +]; diff --git a/tests/Austria/AustriaBaseTestCase.php b/tests/Austria/AustriaBaseTestCase.php index 53c3ddf37..0e5f35d2c 100644 --- a/tests/Austria/AustriaBaseTestCase.php +++ b/tests/Austria/AustriaBaseTestCase.php @@ -23,17 +23,22 @@ abstract class AustriaBaseTestCase extends TestCase use YasumiBase; /** - * Name of the region (e.g. country / state) to be tested + * Name of the region (e.g. country / state) to be tested. */ public const REGION = 'Austria'; /** - * Timezone in which this provider has holidays defined + * Timezone in which this provider has holidays defined. */ public const TIMEZONE = 'Europe/Vienna'; /** - * Locale that is considered common for this provider + * Locale that is considered common for this provider. */ public const LOCALE = 'de_AT'; + + /** + * Number of iterations to be used for the various unit tests of this provider. + */ + public const TEST_ITERATIONS = 50; } diff --git a/tests/Austria/Burgenland/BurgenlandBaseTestCase.php b/tests/Austria/Burgenland/BurgenlandBaseTestCase.php new file mode 100644 index 000000000..e0380a93b --- /dev/null +++ b/tests/Austria/Burgenland/BurgenlandBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Burgenland; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Burgenland (Austria) holiday provider. + */ +abstract class BurgenlandBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Burgenland'; +} diff --git a/tests/Austria/Burgenland/stMartinsDayTest.php b/tests/Austria/Burgenland/stMartinsDayTest.php new file mode 100644 index 000000000..cad243b77 --- /dev/null +++ b/tests/Austria/Burgenland/stMartinsDayTest.php @@ -0,0 +1,80 @@ + + */ + +namespace Yasumi\tests\Austria\Burgenland; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing st Martins Day in the Netherlands. + */ +class stMartinsDayTest extends BurgenlandBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stMartinsDay'; + + /** + * Tests Saint Martins Day. + * + * @dataProvider stMartinsDayDataProvider + * + * @param int $year the year for which Saint Martins Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function teststMartinsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Saint Martins Day. + * + * @return array list of test dates for Saint Martins Day + * @throws Exception + */ + public function stMartinsDayDataProvider(): array + { + return $this->generateRandomDates(11, 11, self::TIMEZONE); + } + + /** + * Tests the translated name of the holiday defined in this test. + * + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Martin'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Carinthia/CarinthiaBaseTestCase.php b/tests/Austria/Carinthia/CarinthiaBaseTestCase.php new file mode 100644 index 000000000..fc2013c5d --- /dev/null +++ b/tests/Austria/Carinthia/CarinthiaBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Carinthia; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Carinthia (Austria) holiday provider. + */ +abstract class CarinthiaBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Carinthia'; +} diff --git a/tests/Austria/Carinthia/PlebisciteDayTest.php b/tests/Austria/Carinthia/PlebisciteDayTest.php new file mode 100644 index 000000000..12c49d302 --- /dev/null +++ b/tests/Austria/Carinthia/PlebisciteDayTest.php @@ -0,0 +1,105 @@ + + */ + +namespace Yasumi\tests\Austria\Carinthia; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Plebiscite Day in Carinthia (Austria). + */ +class PlebisciteDayTest extends CarinthiaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'plebisciteDay'; + + /** + * The year in which the holiday was first established. + */ + public const ESTABLISHMENT_YEAR = 1920; + + /** + * Tests Plebiscite Day. + * + * @dataProvider PlebisciteDayDataProvider + * + * @param int $year the year for which Plebiscite Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testPlebisciteDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Plebiscite Day. + * + * @return array list of test dates for Plebiscite Day. + * @throws Exception + */ + public function PlebisciteDayDataProvider(): array + { + $data = []; + + for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $data[] = [$year, new DateTime("$year-10-10", new DateTimeZone(self::TIMEZONE))]; + } + + return $data; + } + + /** + * Tests the holiday defined in this test before establishment. + * @throws ReflectionException + */ + public function testHolidayBeforeEstablishment() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 2) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Tag der Volksabstimmung'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Carinthia/StJosephsDayTest.php b/tests/Austria/Carinthia/StJosephsDayTest.php new file mode 100644 index 000000000..f586979db --- /dev/null +++ b/tests/Austria/Carinthia/StJosephsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\Carinthia; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing St. Joseph's Day in Carinthia (Austria). + */ +class StJosephsDayTest extends CarinthiaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stJosephsDay'; + + /** + * Tests St. Joseph's Day. + * + * @dataProvider StJosephsDayDataProvider + * + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStJosephsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of St. Joseph's Day. + * + * @return array list of test dates for St. Joseph's Day. + * @throws Exception + */ + public function StJosephsDayDataProvider(): array + { + return $this->generateRandomDates(3, 19, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Josephstag'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php b/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php new file mode 100644 index 000000000..acce349e6 --- /dev/null +++ b/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\LowerAustria; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Lower Austria (Austria) holiday provider. + */ +abstract class LowerAustriaBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/LowerAustria'; +} diff --git a/tests/Austria/LowerAustria/StLeopoldsDayTest.php b/tests/Austria/LowerAustria/StLeopoldsDayTest.php new file mode 100644 index 000000000..78d4f6359 --- /dev/null +++ b/tests/Austria/LowerAustria/StLeopoldsDayTest.php @@ -0,0 +1,105 @@ + + */ + +namespace Yasumi\tests\Austria\LowerAustria; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Saint Leopold's Day in Lower Austria (Austria). + */ +class StLeopoldsDayTest extends LowerAustriaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stLeopoldsDay'; + + /** + * The year in which the holiday was first established. + */ + public const ESTABLISHMENT_YEAR = 1136; + + /** + * Tests Saint Leopold's Day. + * + * @dataProvider StLeopoldsDayDataProvider + * + * @param int $year the year for which Saint Leopold's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStLeopoldsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Saint Leopold's Day. + * + * @return array list of test dates for Saint Leopold's Day. + * @throws Exception + */ + public function StLeopoldsDayDataProvider(): array + { + $data = []; + + for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $data[] = [$year, new DateTime("$year-11-15", new DateTimeZone(self::TIMEZONE))]; + } + + return $data; + } + + /** + * Tests the holiday defined in this test before establishment. + * @throws ReflectionException + */ + public function testHolidayBeforeEstablishment() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 2) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Leopold'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Salzburg/SalzburgBaseTestCase.php b/tests/Austria/Salzburg/SalzburgBaseTestCase.php new file mode 100644 index 000000000..9f9c2c1eb --- /dev/null +++ b/tests/Austria/Salzburg/SalzburgBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Salzburg; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Salzburg (Austria) holiday provider. + */ +abstract class SalzburgBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Austria/Salzburg'; +} diff --git a/tests/Austria/Salzburg/StRupertsDayTest.php b/tests/Austria/Salzburg/StRupertsDayTest.php new file mode 100644 index 000000000..bbcf07d3f --- /dev/null +++ b/tests/Austria/Salzburg/StRupertsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\Salzburg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Saint Rupert's Day in Salzburg (Austria). + */ +class StRupertsDayTest extends SalzburgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stRupertsDay'; + + /** + * Tests Saint Rupert's Day. + * + * @dataProvider StRupertsDayDataProvider + * + * @param int $year the year for which Saint Rupert's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStRupertsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Saint Rupert's Day. + * + * @return array list of test dates for Saint Rupert's Day. + * @throws Exception + */ + public function StRupertsDayDataProvider(): array + { + return $this->generateRandomDates(9, 24, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Rupert'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Styria/StJosephsDayTest.php b/tests/Austria/Styria/StJosephsDayTest.php new file mode 100644 index 000000000..530f66e4c --- /dev/null +++ b/tests/Austria/Styria/StJosephsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\Styria; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing St. Joseph's Day in Styria (Austria). + */ +class StJosephsDayTest extends StyriaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stJosephsDay'; + + /** + * Tests St. Joseph's Day. + * + * @dataProvider StJosephsDayDataProvider + * + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStJosephsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of St. Joseph's Day. + * + * @return array list of test dates for St. Joseph's Day. + * @throws Exception + */ + public function StJosephsDayDataProvider(): array + { + return $this->generateRandomDates(3, 19, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Josephstag'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Styria/StyriaBaseTestCase.php b/tests/Austria/Styria/StyriaBaseTestCase.php new file mode 100644 index 000000000..262b222b9 --- /dev/null +++ b/tests/Austria/Styria/StyriaBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Styria; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Styria (Austria) holiday provider. + */ +abstract class StyriaBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Styria'; +} diff --git a/tests/Austria/Tyrol/StJosephsDayTest.php b/tests/Austria/Tyrol/StJosephsDayTest.php new file mode 100644 index 000000000..a78c3aded --- /dev/null +++ b/tests/Austria/Tyrol/StJosephsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\Tyrol; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing St. Joseph's Day in Tyrol (Austria). + */ +class StJosephsDayTest extends TyrolBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stJosephsDay'; + + /** + * Tests St. Joseph's Day. + * + * @dataProvider StJosephsDayDataProvider + * + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStJosephsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of St. Joseph's Day. + * + * @return array list of test dates for St. Joseph's Day. + * @throws Exception + */ + public function StJosephsDayDataProvider(): array + { + return $this->generateRandomDates(3, 19, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Josephstag'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Tyrol/TyrolBaseTestCase.php b/tests/Austria/Tyrol/TyrolBaseTestCase.php new file mode 100644 index 000000000..bae44b47a --- /dev/null +++ b/tests/Austria/Tyrol/TyrolBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Tyrol; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Tyrol (Austria) holiday provider. + */ +abstract class TyrolBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Tyrol'; +} diff --git a/tests/Austria/UpperAustria/StFloriansDayTest.php b/tests/Austria/UpperAustria/StFloriansDayTest.php new file mode 100644 index 000000000..10ad83c04 --- /dev/null +++ b/tests/Austria/UpperAustria/StFloriansDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\UpperAustria; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Saint Florian's Day in Upper Austria (Austria). + */ +class StFloriansDayTest extends UpperAustriaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stFloriansDay'; + + /** + * Tests Saint Florian's Day. + * + * @dataProvider StFloriansDayDataProvider + * + * @param int $year the year for which Saint Florian's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStFloriansDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Saint Florian's Day. + * + * @return array list of test dates for Saint Florian's Day. + * @throws Exception + */ + public function StFloriansDayDataProvider(): array + { + return $this->generateRandomDates(5, 4, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Florian'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php b/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php new file mode 100644 index 000000000..67a7267bc --- /dev/null +++ b/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\UpperAustria; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Upper Austria (Austria) holiday provider. + */ +abstract class UpperAustriaBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/UpperAustria'; +} diff --git a/tests/Austria/Vienna/StLeopoldsDayTest.php b/tests/Austria/Vienna/StLeopoldsDayTest.php new file mode 100644 index 000000000..85979037a --- /dev/null +++ b/tests/Austria/Vienna/StLeopoldsDayTest.php @@ -0,0 +1,105 @@ + + */ + +namespace Yasumi\tests\Austria\Vienna; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Saint Leopold's Day in Lower Austria (Austria). + */ +class StLeopoldsDayTest extends ViennaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stLeopoldsDay'; + + /** + * The year in which the holiday was first established. + */ + public const ESTABLISHMENT_YEAR = 1136; + + /** + * Tests Saint Leopold's Day. + * + * @dataProvider StLeopoldsDayDataProvider + * + * @param int $year the year for which Saint Leopold's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStLeopoldsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Saint Leopold's Day. + * + * @return array list of test dates for Saint Leopold's Day. + * @throws Exception + */ + public function StLeopoldsDayDataProvider(): array + { + $data = []; + + for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $data[] = [$year, new DateTime("$year-11-15", new DateTimeZone(self::TIMEZONE))]; + } + + return $data; + } + + /** + * Tests the holiday defined in this test before establishment. + * @throws ReflectionException + */ + public function testHolidayBeforeEstablishment() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 2) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Leopold'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Vienna/ViennaBaseTestCase.php b/tests/Austria/Vienna/ViennaBaseTestCase.php new file mode 100644 index 000000000..90a90c98e --- /dev/null +++ b/tests/Austria/Vienna/ViennaBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Vienna; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Vienna (Austria) holiday provider. + */ +abstract class ViennaBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Vienna'; +} diff --git a/tests/Austria/Vorarlberg/StJosephsDayTest.php b/tests/Austria/Vorarlberg/StJosephsDayTest.php new file mode 100644 index 000000000..0ec91404a --- /dev/null +++ b/tests/Austria/Vorarlberg/StJosephsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Austria\Vorarlberg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing St. Joseph's Day in Vorarlberg (Austria). + */ +class StJosephsDayTest extends VorarlbergBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'stJosephsDay'; + + /** + * Tests St. Joseph's Day. + * + * @dataProvider StJosephsDayDataProvider + * + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param DateTime $expected the expected date. + * + * @throws ReflectionException + */ + public function testStJosephsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of St. Joseph's Day. + * + * @return array list of test dates for St. Joseph's Day. + * @throws Exception + */ + public function StJosephsDayDataProvider(): array + { + return $this->generateRandomDates(3, 19, self::TIMEZONE); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Josephstag'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php b/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php new file mode 100644 index 000000000..1baf45b06 --- /dev/null +++ b/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php @@ -0,0 +1,29 @@ + + */ + +namespace Yasumi\tests\Austria\Vorarlberg; + +use Yasumi\tests\Austria\AustriaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Vorarlberg (Austria) holiday provider. + */ +abstract class VorarlbergBaseTestCase extends AustriaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested. + */ + public const REGION = 'Austria/Vorarlberg'; +} From ce7b32d007d9c29ae73b478d5654fd472cd3561a Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 10 Nov 2019 02:24:55 +0100 Subject: [PATCH 021/115] Use fallback from DEAULT_LANGUAGE to 'en' (#183) --- src/Yasumi/Holiday.php | 6 +++++- tests/Base/HolidayTest.php | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index ee36b4a9d..c3c8dc549 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -181,7 +181,11 @@ protected function getLocales(): array while (\array_pop($parts) && $parts) { $locales[] = \implode('_', $parts); } - $locales[] = self::DEFAULT_LOCALE; + + // DEFAULT_LOCALE is en_US + $locales[] = 'en_US'; + $locales[] = 'en'; + return $locales; } diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index 4a1972051..c3f522bbc 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -120,11 +120,23 @@ public function testHolidayGetNameWithParentLocaleTranslation(): void * @throws Exception */ public function testHolidayGetNameWithOnlyDefaultTranslation(): void + { + $name = 'testHoliday'; + $holiday = new Holiday($name, ['en' => 'Holiday EN', 'en_US' => 'Holiday EN-US'], new DateTime(), 'nl_NL'); + + $this->assertIsString($holiday->getName()); + $this->assertEquals('Holiday EN-US', $holiday->getName()); + } + + /** + * Tests the getName function of the Holiday object with only a default translation for the name given. + * @throws Exception + */ + public function testHolidayGetNameWithOnlyDefaultTranslationAndFallback(): void { $name = 'testHoliday'; $translation = 'My Holiday'; - $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => $translation], new DateTime(), $locale); + $holiday = new Holiday($name, ['en' => $translation], new DateTime(), 'nl_NL'); $this->assertIsString($holiday->getName()); $this->assertEquals($translation, $holiday->getName()); From 41c6a0a25594f326ddff6e933344296c4375789a Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 3 Dec 2019 00:21:50 +0900 Subject: [PATCH 022/115] Removed support for PHP 7.1 Signed-off-by: Sacha Telgenhof --- .travis.yml | 9 ++------- CHANGELOG.md | 1 + composer.json | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 288d5033c..34c71854e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: php php: - - 7.1 - 7.2 - 7.3 - - 7.4snapshot + - 7.4 - nightly dist: trusty @@ -30,19 +29,15 @@ script: matrix: allow_failures: - - php: 7.1 - - php: 7.4snapshot - php: hhvm - php: nightly include: - - php: 7.1 - env: PHPSTAN=1 - php: 7.2 env: PHPSTAN=1 - php: 7.3 env: PHPSTAN=1 - - php: 7.4snapshot + - php: 7.4 env: PHPSTAN=1 - php: hhvm env: HHVM=true diff --git a/CHANGELOG.md b/CHANGELOG.md index 201ddcfc8..e6aed3c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Fixed ### Removed +- PHP 7.1 Support, as it has reached its end of life. ## [2.2.0] - 2019-10-06 diff --git a/composer.json b/composer.json index 1b256086a..fc8b6f921 100755 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "ext-json": "*" }, "require-dev": { From d577e4dbc3be7180e015f551722036b82e6e9a5f Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 3 Dec 2019 22:56:04 +0900 Subject: [PATCH 023/115] Bumped versions. Signed-off-by: Sacha Telgenhof --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fc8b6f921..d57a81231 100755 --- a/composer.json +++ b/composer.json @@ -24,8 +24,8 @@ "ext-json": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "fzaninotto/faker": "~1.8", + "friendsofphp/php-cs-fixer": "^2.16", + "fzaninotto/faker": "~1.9", "mikey179/vfsstream": "~1.6", "phpunit/phpunit": "~8.4" }, From 0581d7d13ea04c01f69f63fe960388d11d3c35cc Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 3 Dec 2019 23:09:22 +0900 Subject: [PATCH 024/115] Fixed typo. Minor formatting corrections. Signed-off-by: Sacha Telgenhof --- tests/Japan/ChildrensDayTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Japan/ChildrensDayTest.php b/tests/Japan/ChildrensDayTest.php index d83decaa6..d268758bf 100644 --- a/tests/Japan/ChildrensDayTest.php +++ b/tests/Japan/ChildrensDayTest.php @@ -20,7 +20,7 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class testing Childrens Day in Japan. + * Class testing Children's Day in Japan. */ class ChildrensDayTest extends JapanBaseTestCase implements YasumiTestCaseInterface { @@ -52,6 +52,7 @@ public function testChildrensDayOnAfter1948() /** * Tests Children's Day after 1948 substituted next working day (when Children's Day falls on a Sunday) + * * @throws Exception * @throws ReflectionException */ @@ -68,6 +69,7 @@ public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay() /** * Tests Children's Day before 1948. Children's Day was established after 1948 + * * @throws ReflectionException */ public function testChildrensDayBefore1948() @@ -81,6 +83,7 @@ public function testChildrensDayBefore1948() /** * Tests the translated name of the holiday defined in this test. + * * @throws ReflectionException */ public function testTranslation(): void @@ -95,6 +98,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. + * * @throws ReflectionException */ public function testHolidayType(): void From 77f18833366dab3be01c943465fd881de2fd330b Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Thu, 5 Dec 2019 01:28:17 +0900 Subject: [PATCH 025/115] Corrected clause as second part was not a condition but rather an assignment (which is incorrect and always is true). Signed-off-by: Sacha Telgenhof --- tests/Switzerland/Aargau/AargauTest.php | 2 +- .../AppenzellAusserrhoden/AppenzellAusserrhodenTest.php | 2 +- .../AppenzellInnerrhoden/AppenzellInnerrhodenTest.php | 2 +- tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php | 2 +- tests/Switzerland/BaselStadt/BaselStadtTest.php | 2 +- tests/Switzerland/Bern/BernTest.php | 2 +- tests/Switzerland/Fribourg/FribourgTest.php | 2 +- tests/Switzerland/Geneva/GenevaTest.php | 2 +- tests/Switzerland/Glarus/GlarusTest.php | 2 +- tests/Switzerland/Grisons/GrisonsTest.php | 2 +- tests/Switzerland/Jura/JuraTest.php | 2 +- tests/Switzerland/Lucerne/LucerneTest.php | 2 +- tests/Switzerland/Neuchatel/NeuchatelTest.php | 2 +- tests/Switzerland/Nidwalden/NidwaldenTest.php | 2 +- tests/Switzerland/Obwalden/ObwaldenTest.php | 2 +- tests/Switzerland/Schaffhausen/SchaffhausenTest.php | 2 +- tests/Switzerland/Schwyz/SchwyzTest.php | 2 +- tests/Switzerland/Solothurn/SolothurnTest.php | 2 +- tests/Switzerland/StGallen/StGallenTest.php | 2 +- tests/Switzerland/SwitzerlandTest.php | 2 +- tests/Switzerland/Thurgau/ThurgauTest.php | 2 +- tests/Switzerland/Ticino/TicinoTest.php | 2 +- tests/Switzerland/Uri/UriTest.php | 2 +- tests/Switzerland/Valais/ValaisTest.php | 2 +- tests/Switzerland/Vaud/VaudTest.php | 2 +- tests/Switzerland/Zug/ZugTest.php | 2 +- tests/Switzerland/Zurich/ZurichTest.php | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/Switzerland/Aargau/AargauTest.php b/tests/Switzerland/Aargau/AargauTest.php index 962f8d6aa..9f70c198b 100644 --- a/tests/Switzerland/Aargau/AargauTest.php +++ b/tests/Switzerland/Aargau/AargauTest.php @@ -62,7 +62,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php index 3f3989248..c3fb32f7d 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php @@ -62,7 +62,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php index c7aae43a1..e24359f4c 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php @@ -66,7 +66,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php b/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php index b0d8d2dda..996f7aaf6 100644 --- a/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php +++ b/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/BaselStadt/BaselStadtTest.php b/tests/Switzerland/BaselStadt/BaselStadtTest.php index 2c0357799..c03b14aef 100644 --- a/tests/Switzerland/BaselStadt/BaselStadtTest.php +++ b/tests/Switzerland/BaselStadt/BaselStadtTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Bern/BernTest.php b/tests/Switzerland/Bern/BernTest.php index 9916b59f2..4c2a6e1be 100644 --- a/tests/Switzerland/Bern/BernTest.php +++ b/tests/Switzerland/Bern/BernTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Fribourg/FribourgTest.php b/tests/Switzerland/Fribourg/FribourgTest.php index d4cdf155f..4964d1937 100644 --- a/tests/Switzerland/Fribourg/FribourgTest.php +++ b/tests/Switzerland/Fribourg/FribourgTest.php @@ -61,7 +61,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Geneva/GenevaTest.php b/tests/Switzerland/Geneva/GenevaTest.php index dd0bdb1e5..81c648db6 100644 --- a/tests/Switzerland/Geneva/GenevaTest.php +++ b/tests/Switzerland/Geneva/GenevaTest.php @@ -67,7 +67,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Glarus/GlarusTest.php b/tests/Switzerland/Glarus/GlarusTest.php index 564e6e5a9..8e6a0028e 100644 --- a/tests/Switzerland/Glarus/GlarusTest.php +++ b/tests/Switzerland/Glarus/GlarusTest.php @@ -65,7 +65,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Grisons/GrisonsTest.php b/tests/Switzerland/Grisons/GrisonsTest.php index aac1be88a..9a45aa4f4 100644 --- a/tests/Switzerland/Grisons/GrisonsTest.php +++ b/tests/Switzerland/Grisons/GrisonsTest.php @@ -62,7 +62,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Jura/JuraTest.php b/tests/Switzerland/Jura/JuraTest.php index c9c924c40..54101ee51 100644 --- a/tests/Switzerland/Jura/JuraTest.php +++ b/tests/Switzerland/Jura/JuraTest.php @@ -67,7 +67,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Lucerne/LucerneTest.php b/tests/Switzerland/Lucerne/LucerneTest.php index a54963080..3854b6659 100644 --- a/tests/Switzerland/Lucerne/LucerneTest.php +++ b/tests/Switzerland/Lucerne/LucerneTest.php @@ -67,7 +67,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Neuchatel/NeuchatelTest.php b/tests/Switzerland/Neuchatel/NeuchatelTest.php index 7f9682a67..3e4f56037 100644 --- a/tests/Switzerland/Neuchatel/NeuchatelTest.php +++ b/tests/Switzerland/Neuchatel/NeuchatelTest.php @@ -65,7 +65,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Nidwalden/NidwaldenTest.php b/tests/Switzerland/Nidwalden/NidwaldenTest.php index 6adff25ca..600e0e085 100644 --- a/tests/Switzerland/Nidwalden/NidwaldenTest.php +++ b/tests/Switzerland/Nidwalden/NidwaldenTest.php @@ -67,7 +67,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Obwalden/ObwaldenTest.php b/tests/Switzerland/Obwalden/ObwaldenTest.php index 5dd21aec5..4fa78b4d1 100644 --- a/tests/Switzerland/Obwalden/ObwaldenTest.php +++ b/tests/Switzerland/Obwalden/ObwaldenTest.php @@ -68,7 +68,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Schaffhausen/SchaffhausenTest.php b/tests/Switzerland/Schaffhausen/SchaffhausenTest.php index 93c16bbe3..6c54ae13d 100644 --- a/tests/Switzerland/Schaffhausen/SchaffhausenTest.php +++ b/tests/Switzerland/Schaffhausen/SchaffhausenTest.php @@ -64,7 +64,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Schwyz/SchwyzTest.php b/tests/Switzerland/Schwyz/SchwyzTest.php index 9c89225c4..211ecbf33 100644 --- a/tests/Switzerland/Schwyz/SchwyzTest.php +++ b/tests/Switzerland/Schwyz/SchwyzTest.php @@ -68,7 +68,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Solothurn/SolothurnTest.php b/tests/Switzerland/Solothurn/SolothurnTest.php index 51f13f1a8..70b6e87d9 100644 --- a/tests/Switzerland/Solothurn/SolothurnTest.php +++ b/tests/Switzerland/Solothurn/SolothurnTest.php @@ -61,7 +61,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/StGallen/StGallenTest.php b/tests/Switzerland/StGallen/StGallenTest.php index 25ef3f378..3c16eb990 100644 --- a/tests/Switzerland/StGallen/StGallenTest.php +++ b/tests/Switzerland/StGallen/StGallenTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/SwitzerlandTest.php b/tests/Switzerland/SwitzerlandTest.php index bb2b9d170..e7be01f35 100644 --- a/tests/Switzerland/SwitzerlandTest.php +++ b/tests/Switzerland/SwitzerlandTest.php @@ -45,7 +45,7 @@ public function testOfficialHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Thurgau/ThurgauTest.php b/tests/Switzerland/Thurgau/ThurgauTest.php index f214114dd..d5a969420 100644 --- a/tests/Switzerland/Thurgau/ThurgauTest.php +++ b/tests/Switzerland/Thurgau/ThurgauTest.php @@ -64,7 +64,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Ticino/TicinoTest.php b/tests/Switzerland/Ticino/TicinoTest.php index bd2e521d6..889acbf5b 100644 --- a/tests/Switzerland/Ticino/TicinoTest.php +++ b/tests/Switzerland/Ticino/TicinoTest.php @@ -69,7 +69,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Uri/UriTest.php b/tests/Switzerland/Uri/UriTest.php index 8d4095b64..1fa6b1bc9 100644 --- a/tests/Switzerland/Uri/UriTest.php +++ b/tests/Switzerland/Uri/UriTest.php @@ -68,7 +68,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Valais/ValaisTest.php b/tests/Switzerland/Valais/ValaisTest.php index 67500efb9..b51900b2d 100644 --- a/tests/Switzerland/Valais/ValaisTest.php +++ b/tests/Switzerland/Valais/ValaisTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Vaud/VaudTest.php b/tests/Switzerland/Vaud/VaudTest.php index 2ef4757c7..69f81f5c1 100644 --- a/tests/Switzerland/Vaud/VaudTest.php +++ b/tests/Switzerland/Vaud/VaudTest.php @@ -63,7 +63,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Zug/ZugTest.php b/tests/Switzerland/Zug/ZugTest.php index 21a5db80b..db7b1144a 100644 --- a/tests/Switzerland/Zug/ZugTest.php +++ b/tests/Switzerland/Zug/ZugTest.php @@ -67,7 +67,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } diff --git a/tests/Switzerland/Zurich/ZurichTest.php b/tests/Switzerland/Zurich/ZurichTest.php index 730f6c7a1..6cc151f90 100644 --- a/tests/Switzerland/Zurich/ZurichTest.php +++ b/tests/Switzerland/Zurich/ZurichTest.php @@ -64,7 +64,7 @@ public function testRegionalHolidays(): void public function testObservedHolidays(): void { $observedHolidays = []; - if (($this->year >= 1899 && $this->year < 1994) || $this->year = 1891) { + if (($this->year >= 1899 && $this->year < 1994) || 1891 === $this->year) { $observedHolidays[] = 'swissNationalDay'; } From 1e2f82b658152d3a2e59756dfc32175f6a03e131 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 16 Dec 2019 22:45:26 +0900 Subject: [PATCH 026/115] Updated dependencies. Signed-off-by: Sacha Telgenhof --- .travis.yml | 2 +- composer.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 34c71854e..848bfa9ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - composer install --no-interaction script: - - if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.11 && vendor/bin/phpstan analyse -l 5 src; fi + - if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.12 && vendor/bin/phpstan analyse -l 5 src; fi - ./vendor/bin/phpunit - phpenv config-rm xdebug.ini || return 0 - ./vendor/bin/php-cs-fixer --diff --dry-run -v fix diff --git a/composer.json b/composer.json index d57a81231..5d82961cc 100755 --- a/composer.json +++ b/composer.json @@ -25,9 +25,9 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.16", - "fzaninotto/faker": "~1.9", - "mikey179/vfsstream": "~1.6", - "phpunit/phpunit": "~8.4" + "fzaninotto/faker": "^1.9", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^8.5" }, "autoload": { "psr-4": { From ed73539d71b06f5fbb1a7a6cb94bdda3c79b8d58 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 28 Dec 2019 23:05:25 +0900 Subject: [PATCH 027/115] Fixed compound conditions that are always true by simplifying the condition steps. Removed unnecessary unit tests. Fixed comments. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Japan.php | 16 ++++++++++------ tests/Japan/AutumnalEquinoxDayTest.php | 21 +++------------------ tests/Japan/VernalEquinoxDayTest.php | 15 --------------- 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index 16d7ab1f9..f3a19b931 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -269,9 +269,7 @@ private function calculateEmperorsBirthday(): void private function calculateVernalEquinoxDay(): void { $day = null; - if ($this->year < 1948 || $this->year > 2150) { - $day = null; - } elseif ($this->year >= 1948 && $this->year <= 1979) { + if ($this->year >= 1948 && $this->year <= 1979) { $day = \floor(self::VERNAL_EQUINOX_PARAM_1979 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1983) / 4)); } elseif ($this->year <= 2099) { $day = \floor(self::VERNAL_EQUINOX_PARAM_2099 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1980) / 4)); @@ -279,6 +277,10 @@ private function calculateVernalEquinoxDay(): void $day = \floor(self::VERNAL_EQUINOX_PARAM_2150 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1980) / 4)); } + if ($this->year < 1948 || $this->year > 2150) { + $day = null; + } + if (\is_numeric($day)) { $this->addHoliday(new Holiday( 'vernalEquinoxDay', @@ -500,9 +502,7 @@ private function calculateSportsDay(): void private function calculateAutumnalEquinoxDay(): void { $day = null; - if ($this->year < 1948 || $this->year > 2150) { - $day = null; - } elseif ($this->year >= 1948 && $this->year <= 1979) { + if ($this->year >= 1948 && $this->year <= 1979) { $day = \floor(self::AUTUMNAL_EQUINOX_PARAM_1979 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1983) / 4)); } elseif ($this->year <= 2099) { $day = \floor(self::AUTUMNAL_EQUINOX_PARAM_2099 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1980) / 4)); @@ -510,6 +510,10 @@ private function calculateAutumnalEquinoxDay(): void $day = \floor(self::AUTUMNAL_EQUINOX_PARAM_2150 + self::EQUINOX_GRADIENT * ($this->year - 1980) - \floor(($this->year - 1980) / 4)); } + if ($this->year < 1948 || $this->year > 2150) { + $day = null; + } + if (\is_numeric($day)) { $this->addHoliday(new Holiday( 'autumnalEquinoxDay', diff --git a/tests/Japan/AutumnalEquinoxDayTest.php b/tests/Japan/AutumnalEquinoxDayTest.php index 0e962d950..4865df314 100644 --- a/tests/Japan/AutumnalEquinoxDayTest.php +++ b/tests/Japan/AutumnalEquinoxDayTest.php @@ -35,7 +35,7 @@ class AutumnalEquinoxDayTest extends JapanBaseTestCase implements YasumiTestCase public const ESTABLISHMENT_YEAR = 1948; /** - * Tests Vernal Equinox Day after 2150. This national holiday was established in 1948 as a day on which to honor + * Tests Autumnal Equinox Day after 2150. This national holiday was established in 1948 as a day on which to honor * one's ancestors and remember the dead. Prior to 1948, the autumnal equinox was an imperial ancestor worship * festival called Shūki kōrei-sai (秋季皇霊祭). * @@ -48,7 +48,7 @@ public function testAutumnalEquinoxDayOnAfter2150() } /** - * Tests Vernal Equinox Day between 1948 and 2150. This national holiday was established in 1948 as a day on which + * Tests Autumnal Equinox Day between 1948 and 2150. This national holiday was established in 1948 as a day on which * to honor one's ancestors and remember the dead. Prior to 1948, the autumnal equinox was an imperial ancestor * worship festival called Shūki kōrei-sai (秋季皇霊祭). * @@ -90,7 +90,7 @@ public function autumnalEquinoxHolidaysProvider(): array } /** - * Tests Vernal Equinox Day before 1948. This national holiday was established in 1948 as a day on which to honor + * Tests Autumnal Equinox Day before 1948. This national holiday was established in 1948 as a day on which to honor * one's ancestors and remember the dead. Prior to 1948, the autumnal equinox was an imperial ancestor worship * festival called Shūki kōrei-sai (秋季皇霊祭). * @throws ReflectionException @@ -104,21 +104,6 @@ public function testAutumnalEquinoxDayBefore1948() ); } - /** - * Tests Vernal Equinox Day between 1851 and 1948. This national holiday was established in 1948 as a day on - * which to honor one's ancestors and remember the dead. Prior to 1948, the autumnal equinox was an imperial - * ancestor worship festival called Shūki kōrei-sai (秋季皇霊祭). - * @throws ReflectionException - */ - public function testAutumnalEquinoxDayBetween1851And1948() - { - $this->assertNotHoliday( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(1851, self::ESTABLISHMENT_YEAR - 1) - ); - } - /** * Tests the translated name of the holiday defined in this test. * @throws ReflectionException diff --git a/tests/Japan/VernalEquinoxDayTest.php b/tests/Japan/VernalEquinoxDayTest.php index b5f24bae0..83f4fba52 100644 --- a/tests/Japan/VernalEquinoxDayTest.php +++ b/tests/Japan/VernalEquinoxDayTest.php @@ -105,21 +105,6 @@ public function testVernalEquinoxDayBefore1948() ); } - /** - * Tests Vernal Equinox Day between 1851 and 1948. This national holiday was established in 1948 as a day for - * the admiration of nature and the love of living things. Prior to 1948, the vernal equinox was an imperial - * ancestor worship festival called Shunki kōrei-sai (春季皇霊祭). - * @throws ReflectionException - */ - public function testVernalEquinoxDayBetween1851And1948() - { - $this->assertNotHoliday( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(1851, self::ESTABLISHMENT_YEAR - 1) - ); - } - /** * Tests the translated name of the holiday defined in this test. * @throws ReflectionException From 12d942346d3d092a9b25465681f64961b2976b52 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 28 Dec 2019 23:35:33 +0900 Subject: [PATCH 028/115] Fixed compound conditions that are always true by simplifying the condition steps. Removed unnecessary unit tests. Fixed comments. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Switzerland/Geneva.php | 21 ++++++++----- .../Switzerland/Geneva/JeuneGenevoisTest.php | 30 ++++++------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/Yasumi/Provider/Switzerland/Geneva.php b/src/Yasumi/Provider/Switzerland/Geneva.php index 0a4b08c9d..498a60f7f 100644 --- a/src/Yasumi/Provider/Switzerland/Geneva.php +++ b/src/Yasumi/Provider/Switzerland/Geneva.php @@ -36,6 +36,8 @@ class Geneva extends Switzerland */ public const ID = 'CH-GE'; + public const JEUNE_GENEVOIS_ESTABLISHMENT_YEAR = 1840; + /** * Initialize holidays for Geneva (Switzerland). * @@ -74,20 +76,23 @@ public function initialize(): void */ private function calculateJeuneGenevois(): void { + if (self::JEUNE_GENEVOIS_ESTABLISHMENT_YEAR > $this->year) { + return; + } + // Find first Sunday of September $date = new DateTime('First Sunday of ' . $this->year . '-09', new DateTimeZone($this->timezone)); // Go to next Thursday $date->add(new DateInterval('P4D')); - if (($this->year >= 1840 && $this->year <= 1869) || $this->year >= 1966) { - $this->addHoliday(new Holiday('jeuneGenevois', [ - 'fr' => 'Jeûne genevois', - ], $date, $this->locale, Holiday::TYPE_OTHER)); - } elseif ($this->year > 1869 && $this->year < 1966) { - $this->addHoliday(new Holiday('jeuneGenevois', [ - 'fr' => 'Jeûne genevois', - ], $date, $this->locale, Holiday::TYPE_OBSERVANCE)); + $type = Holiday::TYPE_OTHER; + if ($this->year > 1869 && $this->year < 1966) { + $type = Holiday::TYPE_OBSERVANCE; } + + $this->addHoliday(new Holiday('jeuneGenevois', [ + 'fr' => 'Jeûne genevois', + ], $date, $this->locale, $type)); } /** diff --git a/tests/Switzerland/Geneva/JeuneGenevoisTest.php b/tests/Switzerland/Geneva/JeuneGenevoisTest.php index 548844f3f..1765e95ad 100644 --- a/tests/Switzerland/Geneva/JeuneGenevoisTest.php +++ b/tests/Switzerland/Geneva/JeuneGenevoisTest.php @@ -18,6 +18,7 @@ use Exception; use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\Switzerland\Geneva; use Yasumi\tests\YasumiTestCaseInterface; /** @@ -30,24 +31,6 @@ class JeuneGenevoisTest extends GenevaBaseTestCase implements YasumiTestCaseInte */ public const HOLIDAY = 'jeuneGenevois'; - /** - * Tests Jeune Genevois on or after 1966 - * - * @throws ReflectionException - * @throws Exception - */ - public function testJeuneGenevoisOnAfter1966() - { - $year = $this->generateRandomYear(1966); - // Find first Sunday of September - $date = new DateTime('First Sunday of ' . $year . '-09', new DateTimeZone(self::TIMEZONE)); - // Go to next Thursday - $date->add(new DateInterval('P4D')); - - $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); - } - /** * Tests Jeune Genevois between 1870 and 1965 * @@ -74,7 +57,7 @@ public function testJeuneGenevoisBetween1870And1965() */ public function testJeuneGenevoisBetween1840And1869() { - $year = $this->generateRandomYear(1840, 1869); + $year = $this->generateRandomYear(Geneva::JEUNE_GENEVOIS_ESTABLISHMENT_YEAR, 1869); // Find first Sunday of September $date = new DateTime('First Sunday of ' . $year . '-09', new DateTimeZone(self::TIMEZONE)); // Go to next Thursday @@ -90,7 +73,7 @@ public function testJeuneGenevoisBetween1840And1869() */ public function testJeuneGenevoisBefore1840() { - $year = $this->generateRandomYear(1000, 1839); + $year = $this->generateRandomYear(1000, Geneva::JEUNE_GENEVOIS_ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); } @@ -114,6 +97,11 @@ public function testTranslation(): void */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(1966), Holiday::TYPE_OTHER); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1966), + Holiday::TYPE_OTHER + ); } } From 3314d97de75ddd59b4ddff2bbe17e5700bc9e3e1 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 29 Dec 2019 11:35:22 +0900 Subject: [PATCH 029/115] Reformatting. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Yasumi.php | 4 ++-- src/Yasumi/data/translations/plebisciteDay.php | 4 ++-- src/Yasumi/data/translations/stFloriansDay.php | 4 ++-- src/Yasumi/data/translations/stLeopoldsDay.php | 4 ++-- src/Yasumi/data/translations/stRupertsDay.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 6576e3883..227b55282 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -92,7 +92,7 @@ public static function nextWorkingDay( while ($workingDays > 0) { $date = $date->add(new \DateInterval('P1D')); - if (! $provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { + if (!$provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { @@ -286,7 +286,7 @@ public static function prevWorkingDay( while ($workingDays > 0) { $date = $date->sub(new \DateInterval('P1D')); - if (! $provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { + if (!$provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { diff --git a/src/Yasumi/data/translations/plebisciteDay.php b/src/Yasumi/data/translations/plebisciteDay.php index 7e4767a9e..a8d9d6eab 100644 --- a/src/Yasumi/data/translations/plebisciteDay.php +++ b/src/Yasumi/data/translations/plebisciteDay.php @@ -13,6 +13,6 @@ // Translations for Plebiscite Day. return [ - 'en' => 'Plebiscite Day', - 'de_AT' => 'Tag der Volksabstimmung', + 'en' => 'Plebiscite Day', + 'de_AT' => 'Tag der Volksabstimmung', ]; diff --git a/src/Yasumi/data/translations/stFloriansDay.php b/src/Yasumi/data/translations/stFloriansDay.php index a8fbe48ba..fe4ea42ce 100644 --- a/src/Yasumi/data/translations/stFloriansDay.php +++ b/src/Yasumi/data/translations/stFloriansDay.php @@ -13,6 +13,6 @@ // Translations for Saint Florian's Day. return [ - 'en' => 'Saint Florian\'s Day', - 'de_AT' => 'Florian', + 'en' => 'Saint Florian\'s Day', + 'de_AT' => 'Florian', ]; diff --git a/src/Yasumi/data/translations/stLeopoldsDay.php b/src/Yasumi/data/translations/stLeopoldsDay.php index ff64801b0..50941bce6 100644 --- a/src/Yasumi/data/translations/stLeopoldsDay.php +++ b/src/Yasumi/data/translations/stLeopoldsDay.php @@ -13,6 +13,6 @@ // Translations for Saint Leopold's Day. return [ - 'en' => 'Saint Leopold\'s Day', - 'de_AT' => 'Leopold', + 'en' => 'Saint Leopold\'s Day', + 'de_AT' => 'Leopold', ]; diff --git a/src/Yasumi/data/translations/stRupertsDay.php b/src/Yasumi/data/translations/stRupertsDay.php index 19d3f76fa..4e6152874 100644 --- a/src/Yasumi/data/translations/stRupertsDay.php +++ b/src/Yasumi/data/translations/stRupertsDay.php @@ -13,6 +13,6 @@ // Translations for Saint Rupert's Day. return [ - 'en' => 'Saint Rupert\'s Day', - 'de_AT' => 'Rupert', + 'en' => 'Saint Rupert\'s Day', + 'de_AT' => 'Rupert', ]; From 3510230cb0b4b485fe2a69a95ccd35ff74a146a0 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 29 Dec 2019 11:50:22 +0900 Subject: [PATCH 030/115] Simplified condition structure. Reformatting. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/SouthKorea.php | 102 +++++++++++++++-------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 94886454a..2d933d3b0 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -50,7 +50,7 @@ class SouthKorea extends AbstractProvider * There is no perfect formula, and as it moves away from the current date, the error becomes bigger. * Korea Astronomy and Space Science Institute (KASI) is supporting the converter until 2050. * For more information, please refer to the paper below. - * 박한얼, 민병희, 안영숙,(2017).한국 음력의 운용과 계산법 연구.천문학논총,32(3),407-420. + * 박(2017)총,32(3),407-420. * @link https://www.kasi.re.kr/kor/research/paper/20170259 - Korea Astronomy and Space Science Institute */ public const LUNAR_HOLIDAY = [ @@ -458,65 +458,67 @@ public function calculateHangulDay(): void /** * Substitute Holidays. - * related statutes: Article 3 Alternative Statutory Holidays of the Regulations on Holidays of Government Offices + * Related statutes: Article 3 Alternative Statutory Holidays of the Regulations on Holidays of Government Offices * * Since 2014, it has been applied only on Seollal, Chuseok and Children's Day. * Due to the lunar calendar, public holidays can overlap even if it's not a Sunday. - * When public holidays fall each other, the first non-public holiday after the holiday become as a public holiday. + * When public holidays fall on each other, the first non-public holiday after the holiday becomes a public holiday. * As an exception, Children's Day also applies on Saturday. * * @throws \Exception */ public function calculateSubstituteHolidays(): void { - if ($this->year > 2013) { - // Initialize holidays variable - $holidays = $this->getHolidays(); - $acceptedHolidays = [ - 'dayBeforeSeollal', 'seollal', 'dayAfterSeollal', - 'dayBeforeChuseok', 'chuseok', 'dayAfterChuseok', - 'childrensDay', - ]; - - // Loop through all holidays - foreach ($holidays as $shortName => $holiday) { - // Get list of holiday dates except this - $holidayDates = \array_map(static function ($holiday) use ($shortName) { - return $holiday->shortName === $shortName ? false : (string)$holiday; - }, $holidays); - - // Only process accepted holidays and conditions - if (\in_array($shortName, $acceptedHolidays, true) - && ( - 0 === (int)$holiday->format('w') - || \in_array($holiday, $holidayDates, false) - || (6 === (int)$holiday->format('w') && 'childrensDay' === $shortName) - ) - ) { - $date = clone $holiday; - - // Find next week day (not being another holiday) - while (0 === (int)$date->format('w') - || (6 === (int)$date->format('w') && 'childrensDay' === $shortName) - || \in_array($date, $holidayDates, false)) { - $date->add(new DateInterval('P1D')); - continue; - } - - // Add a new holiday that is substituting the original holiday - $substitute = new SubstituteHoliday( - $holiday, - [], - $date, - $this->locale - ); - - // Add a new holiday that is substituting the original holiday - $this->addHoliday($substitute); - - // Add substitute holiday to the list - $holidays[] = $substitute; + if ($this->year <= 2013) { + return; + } + + // Initialize holidays variable + $holidays = $this->getHolidays(); + $acceptedHolidays = [ + 'dayBeforeSeollal', 'seollal', 'dayAfterSeollal', + 'dayBeforeChuseok', 'chuseok', 'dayAfterChuseok', + 'childrensDay', + ]; + + // Loop through all holidays + foreach ($holidays as $shortName => $holiday) { + // Get list of holiday dates except this + $holidayDates = \array_map(static function ($holiday) use ($shortName) { + return $holiday->shortName === $shortName ? false : (string)$holiday; + }, $holidays); + + // Only process accepted holidays and conditions + if (\in_array($shortName, $acceptedHolidays, true) + && ( + 0 === (int)$holiday->format('w') + || \in_array($holiday, $holidayDates, false) + || (6 === (int)$holiday->format('w') && 'childrensDay' === $shortName) + ) + ) { + $date = clone $holiday; + + // Find next week day (not being another holiday) + while (0 === (int)$date->format('w') + || (6 === (int)$date->format('w') && 'childrensDay' === $shortName) + || \in_array($date, $holidayDates, false)) { + $date->add(new DateInterval('P1D')); + continue; } + + // Add a new holiday that is substituting the original holiday + $substitute = new SubstituteHoliday( + $holiday, + [], + $date, + $this->locale + ); + + // Add a new holiday that is substituting the original holiday + $this->addHoliday($substitute); + + // Add substitute holiday to the list + $holidays[] = $substitute; } } } From 651c8d1ef9198eec86e24b436db9f603a5253dee Mon Sep 17 00:00:00 2001 From: Thomas Niemann Date: Tue, 31 Dec 2019 14:18:21 +0100 Subject: [PATCH 031/115] Fix issue if calculated workday is in next year (#194) Currently, the year of the calculated date is not changed if it is in the next year. When u try to get the next working day starting from 28.12.2019 and with 3 working days the calculated day is 1.1.2019 which is in the past. --- CHANGELOG.md | 1 + src/Yasumi/Yasumi.php | 2 +- tests/Base/YasumiWorkdayTest.php | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6aed3c6b..6dde75794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Changed ### Fixed +- Fixed issue if the next working day happens to be in the next year ### Removed - PHP 7.1 Support, as it has reached its end of life. diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 227b55282..888c5c725 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -92,7 +92,7 @@ public static function nextWorkingDay( while ($workingDays > 0) { $date = $date->add(new \DateInterval('P1D')); - if (!$provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { + if (! $provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { diff --git a/tests/Base/YasumiWorkdayTest.php b/tests/Base/YasumiWorkdayTest.php index acb84fe20..31baaf3ee 100644 --- a/tests/Base/YasumiWorkdayTest.php +++ b/tests/Base/YasumiWorkdayTest.php @@ -142,4 +142,44 @@ public function testYearBoundary(): void $result = Yasumi::prevWorkingDay($provider, $startDate, $interval); $this->assertEquals($expectedPrevious, $result->format(self::FORMAT_DATE)); } + + + /** + * Tests when the next working day happens to be in the next year. + * + * @dataProvider dataProviderWorkDayNextYear + * @param string $start + * @param int $workdays + * @param string $expectedNext + * @throws ReflectionException + * @throws Exception + */ + public function testWorkDayIsNextYear(string $start, int $workdays, string $expectedNext): void + { + $provider = 'USA'; + $timezone = 'America/New_York'; + $startDate = new DateTime($start, new DateTimeZone($timezone)); + $result = Yasumi::nextWorkingDay($provider, $startDate, $workdays); + + $this->assertEquals($expectedNext, $result->format(self::FORMAT_DATE)); + } + + /** + * @return array + */ + public function dataProviderWorkDayNextYear(): array + { + return [ + [ + '2019-12-30', + 2, + '2020-01-02', + ], + [ + '2018-12-28', + 2, + '2019-01-02', + ], + ]; + } } From 931ecd663453653f58190658a0a043447ed4ab08 Mon Sep 17 00:00:00 2001 From: bruce aldridge Date: Wed, 1 Jan 2020 03:18:35 +1300 Subject: [PATCH 032/115] Add AFL Grand Final Friday dates for 2019 / 2020 (#190) * Add AFL Grand Final Friday dates for 2019 / 2020 sources 2019: https://www.timeanddate.com/holidays/australia/afl-grand-final-friday 2020: https://publicholidays.com.au/afl-grand-final-holiday/ --- CHANGELOG.md | 2 +- src/Yasumi/Provider/Australia/Victoria.php | 6 ++++++ tests/Australia/Victoria/AFLGrandFinalFridayTest.php | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dde75794..34da0fc05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added - +- Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) ### Changed ### Fixed diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index e158d9e6e..77dd6ef8f 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -194,6 +194,12 @@ private function calculateAFLGrandFinalDay(): void case 2018: $aflGrandFinalFriday = '2018-09-28'; break; + case 2019: + $aflGrandFinalFriday = '2019-09-27'; + break; + case 2020: + $aflGrandFinalFriday = '2020-09-25'; + break; default: return; } diff --git a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php index 303ce70aa..09760f0fd 100644 --- a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php +++ b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php @@ -30,7 +30,7 @@ class AFLGrandFinalFridayTest extends VictoriaBaseTestCase implements YasumiTest public const HOLIDAY = 'aflGrandFinalFriday'; public const ESTABLISHMENT_YEAR = 2015; - public const LAST_KNOWN_YEAR = 2018; + public const LAST_KNOWN_YEAR = 2020; /** * Tests AFL Grand Final Friday @@ -103,6 +103,8 @@ public function HolidayDataProvider(): array [2016, '2016-09-30'], [2017, '2017-09-29'], [2018, '2018-09-28'], + [2019, '2019-09-27'], + [2020, '2020-09-25'], ]; return $data; From 18f5c338edd9069d407087fd19bfb365594e68b5 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Tue, 31 Dec 2019 15:19:29 +0100 Subject: [PATCH 033/115] Do not capitalise names in DA/NB/NL (#185) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Belgium.php | 2 +- src/Yasumi/Provider/Denmark.php | 4 ++-- src/Yasumi/Provider/Netherlands.php | 2 +- src/Yasumi/Provider/Norway.php | 2 +- src/Yasumi/data/translations/allSaintsEve.php | 2 +- src/Yasumi/data/translations/christmasDay.php | 6 +++--- src/Yasumi/data/translations/christmasEve.php | 2 +- src/Yasumi/data/translations/easter.php | 6 +++--- src/Yasumi/data/translations/easterMonday.php | 6 +++--- src/Yasumi/data/translations/epiphanyEve.php | 2 +- src/Yasumi/data/translations/goodFriday.php | 4 ++-- src/Yasumi/data/translations/internationalWorkersDay.php | 6 +++--- src/Yasumi/data/translations/maundyThursday.php | 4 ++-- src/Yasumi/data/translations/newYearsDay.php | 4 ++-- src/Yasumi/data/translations/newYearsEve.php | 2 +- src/Yasumi/data/translations/pentecost.php | 8 ++++---- src/Yasumi/data/translations/pentecostMonday.php | 6 +++--- src/Yasumi/data/translations/secondChristmasDay.php | 4 ++-- src/Yasumi/data/translations/stJohnsDay.php | 2 +- src/Yasumi/data/translations/stJohnsEve.php | 2 +- src/Yasumi/data/translations/summerTime.php | 4 ++-- src/Yasumi/data/translations/winterTime.php | 4 ++-- tests/Belgium/EasterMondayTest.php | 2 +- tests/Belgium/EasterTest.php | 2 +- tests/Belgium/NationalDayTest.php | 2 +- tests/Belgium/PentecostTest.php | 2 +- tests/Belgium/pentecostMondayTest.php | 2 +- tests/Denmark/ChristmasDayTest.php | 2 +- tests/Denmark/ChristmasEveTest.php | 2 +- tests/Denmark/ConstitutionDayTest.php | 2 +- tests/Denmark/EasterTest.php | 2 +- tests/Denmark/GoodFridayTest.php | 2 +- tests/Denmark/GreatPrayerDayTest.php | 2 +- tests/Denmark/InternationalWorkersDayTest.php | 2 +- tests/Denmark/MaundyThursdayTest.php | 2 +- tests/Denmark/NewYearsDayTest.php | 2 +- tests/Denmark/NewYearsEveTest.php | 2 +- tests/Denmark/PentecostTest.php | 2 +- tests/Denmark/SummerTimeTest.php | 2 +- tests/Denmark/WinterTimeTest.php | 2 +- tests/Netherlands/ChristmasDayTest.php | 2 +- tests/Netherlands/CommemorationDayTest.php | 2 +- tests/Netherlands/EasterMondayTest.php | 2 +- tests/Netherlands/EasterTest.php | 2 +- tests/Netherlands/PentecostTest.php | 2 +- tests/Netherlands/SummertimeTest.php | 2 +- tests/Netherlands/WintertimeTest.php | 2 +- tests/Netherlands/pentecostMondayTest.php | 2 +- tests/Netherlands/secondChristmasdayTest.php | 2 +- tests/Norway/ChristmasDayTest.php | 2 +- tests/Norway/ConstitutionDayTest.php | 2 +- tests/Norway/EasterMondayTest.php | 2 +- tests/Norway/EasterTest.php | 2 +- tests/Norway/GoodFridayTest.php | 2 +- tests/Norway/InternationalWorkersDayTest.php | 2 +- tests/Norway/MaundyThursdayTest.php | 2 +- tests/Norway/NewYearsDayTest.php | 2 +- tests/Norway/PentecostMondayTest.php | 2 +- tests/Norway/PentecostTest.php | 2 +- tests/Norway/SecondChristmasDayTest.php | 2 +- tests/Sweden/InternationalWorkersDayTest.php | 2 +- tests/Sweden/PentecostTest.php | 2 +- 63 files changed, 83 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34da0fc05..81bbebb60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Added - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) ### Changed +- Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) ### Fixed - Fixed issue if the next working day happens to be in the next year diff --git a/src/Yasumi/Provider/Belgium.php b/src/Yasumi/Provider/Belgium.php index 720a68c56..c13c8d824 100755 --- a/src/Yasumi/Provider/Belgium.php +++ b/src/Yasumi/Provider/Belgium.php @@ -66,7 +66,7 @@ public function initialize(): void $this->addHoliday(new Holiday('nationalDay', [ 'fr' => 'Fête nationale', 'en' => 'Belgian National Day', - 'nl' => 'Nationale feestdag', + 'nl' => 'nationale feestdag', ], new DateTime("$this->year-7-21", new DateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Denmark.php b/src/Yasumi/Provider/Denmark.php index 689b21deb..b4b0212b2 100644 --- a/src/Yasumi/Provider/Denmark.php +++ b/src/Yasumi/Provider/Denmark.php @@ -97,7 +97,7 @@ private function calculateGreatPrayerDay(): void if ($this->year >= 1686) { $this->addHoliday(new Holiday( 'greatPrayerDay', - ['da' => 'Store bededag'], + ['da' => 'store bededag'], new DateTime("fourth friday $easter", new DateTimeZone($this->timezone)), $this->locale )); @@ -125,7 +125,7 @@ private function calculateConstitutionDay(): void if ($this->year >= 1849) { $this->addHoliday(new Holiday( 'constitutionDay', - ['da' => 'Grundlovsdag'], + ['da' => 'grundlovsdag'], new DateTime("$this->year-6-5", new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php index e589e62d3..c71b459e1 100755 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -304,7 +304,7 @@ private function calculateCommemorationLiberationDay(): void if ($this->year >= 1947) { $this->addHoliday(new Holiday( 'commemorationDay', - ['en' => 'Commemoration Day', 'nl' => 'Dodenherdenking'], + ['en' => 'Commemoration Day', 'nl' => 'dodenherdenking'], new DateTime("$this->year-5-4", new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE diff --git a/src/Yasumi/Provider/Norway.php b/src/Yasumi/Provider/Norway.php index 39e02ba38..e0b90c400 100644 --- a/src/Yasumi/Provider/Norway.php +++ b/src/Yasumi/Provider/Norway.php @@ -85,7 +85,7 @@ private function calculateConstitutionDay(): void if ($this->year >= 1836) { $this->addHoliday(new Holiday( 'constitutionDay', - ['nb' => 'Grunnlovsdagen'], + ['nb' => 'grunnlovsdagen'], new DateTime("$this->year-5-17", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/data/translations/allSaintsEve.php b/src/Yasumi/data/translations/allSaintsEve.php index d835564d3..53a351526 100755 --- a/src/Yasumi/data/translations/allSaintsEve.php +++ b/src/Yasumi/data/translations/allSaintsEve.php @@ -13,7 +13,7 @@ // Translations for All Saints' Eve return [ - 'da' => 'Allehelgensaften', + 'da' => 'allehelgensaften', 'en' => 'All Saints\' Eve', 'sv' => 'alla helgons afton', ]; diff --git a/src/Yasumi/data/translations/christmasDay.php b/src/Yasumi/data/translations/christmasDay.php index 61403f3d8..b1aef3b20 100755 --- a/src/Yasumi/data/translations/christmasDay.php +++ b/src/Yasumi/data/translations/christmasDay.php @@ -16,7 +16,7 @@ 'bs_Latn' => 'Božić', 'cs' => '1. svátek vánoční', 'cy' => 'Nadolig', - 'da' => 'Juledag', + 'da' => 'juledag', 'de' => '1. Weihnachtsfeiertag', 'de_AT' => 'Christtag', 'de_CH' => 'Weihnachtstag', @@ -33,8 +33,8 @@ 'ko' => '기독탄신일', 'lt' => 'Šv. Kalėdos', 'lv' => 'Ziemassvētki', - 'nb' => 'Første juledag', - 'nl' => 'Eerste kerstdag', + 'nb' => 'første juledag', + 'nl' => 'eerste kerstdag', 'nl_BE' => 'Kerstmis', 'pl' => 'pierwszy dzień Bożego Narodzenia', 'pt' => 'Natal', diff --git a/src/Yasumi/data/translations/christmasEve.php b/src/Yasumi/data/translations/christmasEve.php index bb201afcd..beb7b3ed5 100755 --- a/src/Yasumi/data/translations/christmasEve.php +++ b/src/Yasumi/data/translations/christmasEve.php @@ -15,7 +15,7 @@ return [ 'cs' => 'Štědrý den', 'cy' => 'Noswyl Nadolig', - 'da' => 'Juleaften', + 'da' => 'juleaften', 'de' => 'Heiliger Abend', 'en' => 'Christmas Eve', 'et' => 'Jõululaupäev', diff --git a/src/Yasumi/data/translations/easter.php b/src/Yasumi/data/translations/easter.php index b3d243387..e28371a96 100644 --- a/src/Yasumi/data/translations/easter.php +++ b/src/Yasumi/data/translations/easter.php @@ -15,7 +15,7 @@ return [ 'bs_Latn' => 'Uskrs', 'cy' => 'Sul y Pasg', - 'da' => 'Påskedag', + 'da' => 'påskedag', 'de' => 'Ostersonntag', 'de_CH' => 'Ostern', 'el' => 'Κυριακή του Πάσχα', @@ -29,8 +29,8 @@ 'it' => 'Pasqua', 'lt' => 'Velykos', 'lv' => 'Lieldienas', - 'nb' => 'Første påskedag', - 'nl' => 'Eerste paasdag', + 'nb' => 'første påskedag', + 'nl' => 'eerste paasdag', 'pl' => 'Wielkanoc', 'pt' => 'Páscoa', 'ro' => 'Paștele', diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index 72668b423..55a599fe8 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -29,9 +29,9 @@ 'it_CH' => 'Lunedi di Pasqua', 'lt' => 'Antroji Velykų diena', 'lv' => 'Otrās Lieldienas', - 'nb' => 'Andre påskedag', - 'nl_BE' => 'Paasmaandag', - 'nl' => 'Tweede paasdag', + 'nb' => 'andre påskedag', + 'nl_BE' => 'paasmaandag', + 'nl' => 'tweede paasdag', 'pl' => 'Poniedziałek Wielkanocny', 'ro' => 'A doua zi de Paște', 'sk' => 'Veľkonočný pondelok', diff --git a/src/Yasumi/data/translations/epiphanyEve.php b/src/Yasumi/data/translations/epiphanyEve.php index a05bac762..faf40672c 100644 --- a/src/Yasumi/data/translations/epiphanyEve.php +++ b/src/Yasumi/data/translations/epiphanyEve.php @@ -13,7 +13,7 @@ // Translations for Epiphany Eve return [ - 'da' => 'Helligtrekongersaften', + 'da' => 'helligtrekongersaften', 'en' => 'Epiphany Eve', 'sv' => 'trettondagsafton', ]; diff --git a/src/Yasumi/data/translations/goodFriday.php b/src/Yasumi/data/translations/goodFriday.php index 5ca23ca60..d3b23d8ee 100644 --- a/src/Yasumi/data/translations/goodFriday.php +++ b/src/Yasumi/data/translations/goodFriday.php @@ -15,7 +15,7 @@ return [ 'cs' => 'Velký pátek', 'cy' => 'Gwener y Groglith', - 'da' => 'Langfredag', + 'da' => 'langfredag', 'de' => 'Karfreitag', 'el' => 'Μεγάλη Παρασκευή', 'en' => 'Good Friday', @@ -28,7 +28,7 @@ 'it' => 'Venerdi Santo', 'ja' => 'グッドフライデー', 'lv' => 'Lielā Piektdiena', - 'nb' => 'Langfredag', + 'nb' => 'langfredag', 'nl' => 'Goede Vrijdag', 'pl' => 'Wielki Piątek', 'pt' => 'Sexta feira santa', diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php index 68dba8399..b62cc758f 100755 --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -15,7 +15,7 @@ return [ 'bs_Latn' => 'Praznik rada', 'cs' => 'Svátek práce', - 'da' => 'Første maj', + 'da' => 'første maj', 'de' => 'Tag der Arbeit', 'de_AT' => 'Staatsfeiertag', 'el' => 'Εργατική Πρωτομαγιά', @@ -33,7 +33,7 @@ 'ko' => '노동절', 'lt' => 'Tarptautinė darbo diena', 'lv' => 'Darba svētki', - 'nb' => 'Arbeidernes dag', + 'nb' => 'arbeidernes dag', 'nl' => 'Dag van de arbeid', 'pl' => 'Święto Pracy', 'pt' => 'Dia internacional do trabalhador', @@ -41,6 +41,6 @@ 'ro' => 'Ziua internațională a muncii', 'ru' => 'День международной солидарности трудящихся', 'sk' => 'Sviatok práce', - 'sv' => 'Första maj', + 'sv' => 'första maj', 'uk' => 'День міжнародної солідарності трудящих', ]; diff --git a/src/Yasumi/data/translations/maundyThursday.php b/src/Yasumi/data/translations/maundyThursday.php index 0a39bb641..405c70049 100644 --- a/src/Yasumi/data/translations/maundyThursday.php +++ b/src/Yasumi/data/translations/maundyThursday.php @@ -13,9 +13,9 @@ // Translations for Maundy Thursday return [ - 'da' => 'Skærtorsdag', + 'da' => 'skærtorsdag', 'el' => 'Μεγάλη Πέμπτη', 'en' => 'Maundy Thursday', 'es' => 'Jueves Santo', - 'nb' => 'Skjærtorsdag', + 'nb' => 'skjærtorsdag', ]; diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php index 28d394d00..8818a63d9 100755 --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -16,7 +16,7 @@ 'bs_Latn' => 'Nova godina', 'cs' => 'Nový rok', 'cy' => 'Dydd Calan', - 'da' => 'Nytårsdag', + 'da' => 'nytårsdag', 'de' => 'Neujahr', 'el' => 'Πρωτοχρονιά', 'en' => 'New Year\'s Day', @@ -34,7 +34,7 @@ 'ko' => '새해', 'lt' => 'Naujųjų metų diena', 'lv' => 'Jaunais Gads', - 'nb' => 'Første nyttårsdag', + 'nb' => 'første nyttårsdag', 'nl' => 'Nieuwjaar', 'pl' => 'Nowy Rok', 'pt' => 'Ano novo', diff --git a/src/Yasumi/data/translations/newYearsEve.php b/src/Yasumi/data/translations/newYearsEve.php index 961dc8aa2..ffe2c4dcc 100755 --- a/src/Yasumi/data/translations/newYearsEve.php +++ b/src/Yasumi/data/translations/newYearsEve.php @@ -13,7 +13,7 @@ // Translations for New Year's Eve return [ - 'da' => 'Nytårsaften', + 'da' => 'nytårsaften', 'en' => 'New Year\'s Eve', 'ko' => '신년전야', 'lv' => 'Vecgada vakars', diff --git a/src/Yasumi/data/translations/pentecost.php b/src/Yasumi/data/translations/pentecost.php index a8d303e4a..933be561f 100755 --- a/src/Yasumi/data/translations/pentecost.php +++ b/src/Yasumi/data/translations/pentecost.php @@ -13,7 +13,7 @@ // Translations for Whitsunday return [ - 'da' => 'Pinsedag', + 'da' => 'pinsedag', 'de' => 'Pfingstsonntag', 'de_AT' => 'Pfingsten', 'de_CH' => 'Pfingsten', @@ -25,11 +25,11 @@ 'ga' => 'Domhnach Cincíse', 'hu' => 'Pünkösd', 'it' => 'Pentecoste', - 'nb' => 'Første pinsedag', - 'nl' => 'Eerste pinksterdag', + 'nb' => 'første pinsedag', + 'nl' => 'eerste pinksterdag', 'pl' => 'Zielone Świątki', 'ro' => 'Rusaliile', 'ru' => 'Троица', - 'sv' => 'Pingstdagen', + 'sv' => 'pingstdagen', 'uk' => 'Трійця', ]; diff --git a/src/Yasumi/data/translations/pentecostMonday.php b/src/Yasumi/data/translations/pentecostMonday.php index 1f237b894..bf1af85d4 100755 --- a/src/Yasumi/data/translations/pentecostMonday.php +++ b/src/Yasumi/data/translations/pentecostMonday.php @@ -21,8 +21,8 @@ 'ga' => 'Luan Cincíse', 'hu' => 'Pünkösdhétfő', 'it' => 'Lunedi di Pentecoste', - 'nb' => 'Andre pinsedag', - 'nl' => 'Tweede pinksterdag', - 'nl_BE' => 'Pinkstermaandag', + 'nb' => 'andre pinsedag', + 'nl' => 'tweede pinksterdag', + 'nl_BE' => 'pinkstermaandag', 'ro' => 'A doua zi de Rusalii', ]; diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php index 18267dac2..7f308f8a0 100755 --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -27,8 +27,8 @@ 'ko' => '성탄절 연휴', 'lt' => 'Kalėdos (antra diena)', 'lv' => 'Otrie Ziemassvētki', - 'nb' => 'Andre juledag', - 'nl' => 'Tweede kerstdag', + 'nb' => 'andre juledag', + 'nl' => 'tweede kerstdag', 'pl' => 'drugi dzień Bożego Narodzenia', 'ro' => 'A doua zi de Crăciun', 'sk' => 'Druhý sviatok vianočný', diff --git a/src/Yasumi/data/translations/stJohnsDay.php b/src/Yasumi/data/translations/stJohnsDay.php index c8750e792..c76829f8e 100644 --- a/src/Yasumi/data/translations/stJohnsDay.php +++ b/src/Yasumi/data/translations/stJohnsDay.php @@ -13,7 +13,7 @@ // Translations for St. John's Day return [ - 'da' => 'Sankthansaften', + 'da' => 'sankthansaften', 'el' => 'Σύναξις Προφήτου Προδρόμου και Βαπτιστού Ιωάννου', 'en' => 'St. John\'s Day', 'es' => 'Sant Joan', diff --git a/src/Yasumi/data/translations/stJohnsEve.php b/src/Yasumi/data/translations/stJohnsEve.php index f957d9e1c..45f2b79a6 100644 --- a/src/Yasumi/data/translations/stJohnsEve.php +++ b/src/Yasumi/data/translations/stJohnsEve.php @@ -13,7 +13,7 @@ // Translations for St. John's Eve return [ - 'da' => 'Sankthansaften', + 'da' => 'sankthansaften', 'en' => 'St. John\'s Eve', 'sv' => 'midsommarafton', ]; diff --git a/src/Yasumi/data/translations/summerTime.php b/src/Yasumi/data/translations/summerTime.php index 41bf528ae..8932db8d7 100644 --- a/src/Yasumi/data/translations/summerTime.php +++ b/src/Yasumi/data/translations/summerTime.php @@ -13,8 +13,8 @@ // Translations for Summertime return [ - 'da' => 'Sommertid starter', + 'da' => 'sommertid starter', 'en' => 'Summertime', 'ko' => '서머타임', - 'nl' => 'Zomertijd', + 'nl' => 'zomertijd', ]; diff --git a/src/Yasumi/data/translations/winterTime.php b/src/Yasumi/data/translations/winterTime.php index a2cbd90ca..d482b7e12 100644 --- a/src/Yasumi/data/translations/winterTime.php +++ b/src/Yasumi/data/translations/winterTime.php @@ -13,7 +13,7 @@ // Translations for Wintertime return [ - 'da' => 'Sommertid slutter', + 'da' => 'sommertid slutter', 'en' => 'Wintertime', - 'nl' => 'Wintertijd', + 'nl' => 'wintertijd', ]; diff --git a/tests/Belgium/EasterMondayTest.php b/tests/Belgium/EasterMondayTest.php index f39b18c7f..2302362e1 100644 --- a/tests/Belgium/EasterMondayTest.php +++ b/tests/Belgium/EasterMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Paasmaandag'] + [self::LOCALE => 'paasmaandag'] ); } diff --git a/tests/Belgium/EasterTest.php b/tests/Belgium/EasterTest.php index 88d8506ff..33c68c0ad 100644 --- a/tests/Belgium/EasterTest.php +++ b/tests/Belgium/EasterTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Eerste paasdag'] + [self::LOCALE => 'eerste paasdag'] ); } diff --git a/tests/Belgium/NationalDayTest.php b/tests/Belgium/NationalDayTest.php index 8ddc79cbe..ec1ee8bd1 100644 --- a/tests/Belgium/NationalDayTest.php +++ b/tests/Belgium/NationalDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Nationale feestdag'] + [self::LOCALE => 'nationale feestdag'] ); } diff --git a/tests/Belgium/PentecostTest.php b/tests/Belgium/PentecostTest.php index c994be531..77f44a95c 100644 --- a/tests/Belgium/PentecostTest.php +++ b/tests/Belgium/PentecostTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Eerste pinksterdag'] + [self::LOCALE => 'eerste pinksterdag'] ); } diff --git a/tests/Belgium/pentecostMondayTest.php b/tests/Belgium/pentecostMondayTest.php index 6f4c0b99f..b9521a536 100644 --- a/tests/Belgium/pentecostMondayTest.php +++ b/tests/Belgium/pentecostMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Pinkstermaandag'] + [self::LOCALE => 'pinkstermaandag'] ); } diff --git a/tests/Denmark/ChristmasDayTest.php b/tests/Denmark/ChristmasDayTest.php index 215eaeaee..9578f4116 100644 --- a/tests/Denmark/ChristmasDayTest.php +++ b/tests/Denmark/ChristmasDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Juledag'] + [self::LOCALE => 'juledag'] ); } diff --git a/tests/Denmark/ChristmasEveTest.php b/tests/Denmark/ChristmasEveTest.php index 92f7897cb..d9d47816d 100644 --- a/tests/Denmark/ChristmasEveTest.php +++ b/tests/Denmark/ChristmasEveTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Juleaften'] + [self::LOCALE => 'juleaften'] ); } diff --git a/tests/Denmark/ConstitutionDayTest.php b/tests/Denmark/ConstitutionDayTest.php index 3879fc4e5..48be77dfc 100644 --- a/tests/Denmark/ConstitutionDayTest.php +++ b/tests/Denmark/ConstitutionDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Grundlovsdag'] + [self::LOCALE => 'grundlovsdag'] ); } diff --git a/tests/Denmark/EasterTest.php b/tests/Denmark/EasterTest.php index 1affea3a8..59da8c55d 100644 --- a/tests/Denmark/EasterTest.php +++ b/tests/Denmark/EasterTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Påskedag'] + [self::LOCALE => 'påskedag'] ); } diff --git a/tests/Denmark/GoodFridayTest.php b/tests/Denmark/GoodFridayTest.php index 0baea5c52..bb67a540d 100644 --- a/tests/Denmark/GoodFridayTest.php +++ b/tests/Denmark/GoodFridayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Langfredag'] + [self::LOCALE => 'langfredag'] ); } diff --git a/tests/Denmark/GreatPrayerDayTest.php b/tests/Denmark/GreatPrayerDayTest.php index ffcd70864..3155c4401 100644 --- a/tests/Denmark/GreatPrayerDayTest.php +++ b/tests/Denmark/GreatPrayerDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Store bededag'] + [self::LOCALE => 'store bededag'] ); } diff --git a/tests/Denmark/InternationalWorkersDayTest.php b/tests/Denmark/InternationalWorkersDayTest.php index 8089a1516..3e7a17813 100644 --- a/tests/Denmark/InternationalWorkersDayTest.php +++ b/tests/Denmark/InternationalWorkersDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Første maj'] + [self::LOCALE => 'første maj'] ); } diff --git a/tests/Denmark/MaundyThursdayTest.php b/tests/Denmark/MaundyThursdayTest.php index 5552a3357..05bcd197d 100644 --- a/tests/Denmark/MaundyThursdayTest.php +++ b/tests/Denmark/MaundyThursdayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Skærtorsdag'] + [self::LOCALE => 'skærtorsdag'] ); } diff --git a/tests/Denmark/NewYearsDayTest.php b/tests/Denmark/NewYearsDayTest.php index ee2157508..fab76da79 100644 --- a/tests/Denmark/NewYearsDayTest.php +++ b/tests/Denmark/NewYearsDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Nytårsdag'] + [self::LOCALE => 'nytårsdag'] ); } diff --git a/tests/Denmark/NewYearsEveTest.php b/tests/Denmark/NewYearsEveTest.php index b1d72f816..1723cea3e 100644 --- a/tests/Denmark/NewYearsEveTest.php +++ b/tests/Denmark/NewYearsEveTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Nytårsaften'] + [self::LOCALE => 'nytårsaften'] ); } diff --git a/tests/Denmark/PentecostTest.php b/tests/Denmark/PentecostTest.php index bd6ec9ea2..e7c2281a5 100644 --- a/tests/Denmark/PentecostTest.php +++ b/tests/Denmark/PentecostTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Pinsedag'] + [self::LOCALE => 'pinsedag'] ); } diff --git a/tests/Denmark/SummerTimeTest.php b/tests/Denmark/SummerTimeTest.php index 04e63ca8a..cedad76b3 100644 --- a/tests/Denmark/SummerTimeTest.php +++ b/tests/Denmark/SummerTimeTest.php @@ -65,7 +65,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(1980, 2037), - [self::LOCALE => 'Sommertid starter'] + [self::LOCALE => 'sommertid starter'] ); } diff --git a/tests/Denmark/WinterTimeTest.php b/tests/Denmark/WinterTimeTest.php index 8392c84bb..2fc62f09c 100644 --- a/tests/Denmark/WinterTimeTest.php +++ b/tests/Denmark/WinterTimeTest.php @@ -66,7 +66,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(1980, 2037), - [self::LOCALE => 'Sommertid slutter'] + [self::LOCALE => 'sommertid slutter'] ); } diff --git a/tests/Netherlands/ChristmasDayTest.php b/tests/Netherlands/ChristmasDayTest.php index 782251d48..c18d36808 100644 --- a/tests/Netherlands/ChristmasDayTest.php +++ b/tests/Netherlands/ChristmasDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Eerste kerstdag'] + [self::LOCALE => 'eerste kerstdag'] ); } diff --git a/tests/Netherlands/CommemorationDayTest.php b/tests/Netherlands/CommemorationDayTest.php index 4c66e4cb3..bd1aced75 100644 --- a/tests/Netherlands/CommemorationDayTest.php +++ b/tests/Netherlands/CommemorationDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Dodenherdenking'] + [self::LOCALE => 'dodenherdenking'] ); } diff --git a/tests/Netherlands/EasterMondayTest.php b/tests/Netherlands/EasterMondayTest.php index b92040171..601d7140e 100644 --- a/tests/Netherlands/EasterMondayTest.php +++ b/tests/Netherlands/EasterMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Tweede paasdag'] + [self::LOCALE => 'tweede paasdag'] ); } diff --git a/tests/Netherlands/EasterTest.php b/tests/Netherlands/EasterTest.php index 6c30b083d..69ad57658 100644 --- a/tests/Netherlands/EasterTest.php +++ b/tests/Netherlands/EasterTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Eerste paasdag'] + [self::LOCALE => 'eerste paasdag'] ); } diff --git a/tests/Netherlands/PentecostTest.php b/tests/Netherlands/PentecostTest.php index 2b6ceabf3..e15318093 100644 --- a/tests/Netherlands/PentecostTest.php +++ b/tests/Netherlands/PentecostTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Eerste pinksterdag'] + [self::LOCALE => 'eerste pinksterdag'] ); } diff --git a/tests/Netherlands/SummertimeTest.php b/tests/Netherlands/SummertimeTest.php index ce978a17e..82d0c40c2 100644 --- a/tests/Netherlands/SummertimeTest.php +++ b/tests/Netherlands/SummertimeTest.php @@ -66,7 +66,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(1978, 2037), - [self::LOCALE => 'Zomertijd'] + [self::LOCALE => 'zomertijd'] ); } diff --git a/tests/Netherlands/WintertimeTest.php b/tests/Netherlands/WintertimeTest.php index 902d580a1..681970aff 100644 --- a/tests/Netherlands/WintertimeTest.php +++ b/tests/Netherlands/WintertimeTest.php @@ -65,7 +65,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(1978, 2037), - [self::LOCALE => 'Wintertijd'] + [self::LOCALE => 'wintertijd'] ); } diff --git a/tests/Netherlands/pentecostMondayTest.php b/tests/Netherlands/pentecostMondayTest.php index e8700703d..e55086154 100644 --- a/tests/Netherlands/pentecostMondayTest.php +++ b/tests/Netherlands/pentecostMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Tweede pinksterdag'] + [self::LOCALE => 'tweede pinksterdag'] ); } diff --git a/tests/Netherlands/secondChristmasdayTest.php b/tests/Netherlands/secondChristmasdayTest.php index 0abdc265d..084f7ebf9 100644 --- a/tests/Netherlands/secondChristmasdayTest.php +++ b/tests/Netherlands/secondChristmasdayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Tweede kerstdag'] + [self::LOCALE => 'tweede kerstdag'] ); } diff --git a/tests/Norway/ChristmasDayTest.php b/tests/Norway/ChristmasDayTest.php index 40514307f..bb6e1ea52 100644 --- a/tests/Norway/ChristmasDayTest.php +++ b/tests/Norway/ChristmasDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Første juledag'] + [self::LOCALE => 'første juledag'] ); } diff --git a/tests/Norway/ConstitutionDayTest.php b/tests/Norway/ConstitutionDayTest.php index ecc54718d..625c949e1 100644 --- a/tests/Norway/ConstitutionDayTest.php +++ b/tests/Norway/ConstitutionDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Grunnlovsdagen'] + [self::LOCALE => 'grunnlovsdagen'] ); } diff --git a/tests/Norway/EasterMondayTest.php b/tests/Norway/EasterMondayTest.php index 4b2bc040e..f5c226b55 100644 --- a/tests/Norway/EasterMondayTest.php +++ b/tests/Norway/EasterMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Andre påskedag'] + [self::LOCALE => 'andre påskedag'] ); } diff --git a/tests/Norway/EasterTest.php b/tests/Norway/EasterTest.php index c279b4716..6e6bff1ec 100644 --- a/tests/Norway/EasterTest.php +++ b/tests/Norway/EasterTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Første påskedag'] + [self::LOCALE => 'første påskedag'] ); } diff --git a/tests/Norway/GoodFridayTest.php b/tests/Norway/GoodFridayTest.php index d63ef604e..3e2218f2a 100644 --- a/tests/Norway/GoodFridayTest.php +++ b/tests/Norway/GoodFridayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Langfredag'] + [self::LOCALE => 'langfredag'] ); } diff --git a/tests/Norway/InternationalWorkersDayTest.php b/tests/Norway/InternationalWorkersDayTest.php index 633a7a4cb..db0271b2b 100644 --- a/tests/Norway/InternationalWorkersDayTest.php +++ b/tests/Norway/InternationalWorkersDayTest.php @@ -53,7 +53,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Arbeidernes dag'] + [self::LOCALE => 'arbeidernes dag'] ); } diff --git a/tests/Norway/MaundyThursdayTest.php b/tests/Norway/MaundyThursdayTest.php index e43b6d03a..68ff0fd63 100644 --- a/tests/Norway/MaundyThursdayTest.php +++ b/tests/Norway/MaundyThursdayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Skjærtorsdag'] + [self::LOCALE => 'skjærtorsdag'] ); } diff --git a/tests/Norway/NewYearsDayTest.php b/tests/Norway/NewYearsDayTest.php index 8daaa6cbc..eefe2c5a5 100644 --- a/tests/Norway/NewYearsDayTest.php +++ b/tests/Norway/NewYearsDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Første nyttårsdag'] + [self::LOCALE => 'første nyttårsdag'] ); } diff --git a/tests/Norway/PentecostMondayTest.php b/tests/Norway/PentecostMondayTest.php index 3a3046f1d..b5c5c0fbc 100644 --- a/tests/Norway/PentecostMondayTest.php +++ b/tests/Norway/PentecostMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Andre pinsedag'] + [self::LOCALE => 'andre pinsedag'] ); } diff --git a/tests/Norway/PentecostTest.php b/tests/Norway/PentecostTest.php index af94d3a32..e0d2865dc 100644 --- a/tests/Norway/PentecostTest.php +++ b/tests/Norway/PentecostTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Første pinsedag'] + [self::LOCALE => 'første pinsedag'] ); } diff --git a/tests/Norway/SecondChristmasDayTest.php b/tests/Norway/SecondChristmasDayTest.php index 62b249e6f..b348198c8 100644 --- a/tests/Norway/SecondChristmasDayTest.php +++ b/tests/Norway/SecondChristmasDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Andre juledag'] + [self::LOCALE => 'andre juledag'] ); } diff --git a/tests/Sweden/InternationalWorkersDayTest.php b/tests/Sweden/InternationalWorkersDayTest.php index 500e0b633..d19daeb03 100644 --- a/tests/Sweden/InternationalWorkersDayTest.php +++ b/tests/Sweden/InternationalWorkersDayTest.php @@ -53,7 +53,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Första maj'] + [self::LOCALE => 'första maj'] ); } diff --git a/tests/Sweden/PentecostTest.php b/tests/Sweden/PentecostTest.php index 755e27a36..9cfdad1e7 100644 --- a/tests/Sweden/PentecostTest.php +++ b/tests/Sweden/PentecostTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Pingstdagen'] + [self::LOCALE => 'pingstdagen'] ); } From e5dd4ecd6bd4b3f771949900a16597e7a7bd7835 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 1 Jan 2020 22:10:17 +0900 Subject: [PATCH 034/115] - Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 4 ++- src/Yasumi/Yasumi.php | 2 +- tests/Base/YasumiWorkdayTest.php | 45 ++++++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81bbebb60..f9471a408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Added - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) + ### Changed - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) ### Fixed -- Fixed issue if the next working day happens to be in the next year +- Fixed issue if the next working day happens to be in the next year (i.e. not in the year of the Yasumi instance) [\#192](https://github.com/azuyalabs/yasumi/issues/192) ([tniemann](https://github.com/tniemann)) +- Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) ### Removed - PHP 7.1 Support, as it has reached its end of life. diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 888c5c725..812a35cf1 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -286,7 +286,7 @@ public static function prevWorkingDay( while ($workingDays > 0) { $date = $date->sub(new \DateInterval('P1D')); - if (!$provider instanceof ProviderInterface || $provider->getYear() !== \getdate()['year']) { + if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { diff --git a/tests/Base/YasumiWorkdayTest.php b/tests/Base/YasumiWorkdayTest.php index 31baaf3ee..c9cc2c78d 100644 --- a/tests/Base/YasumiWorkdayTest.php +++ b/tests/Base/YasumiWorkdayTest.php @@ -131,7 +131,6 @@ public function testYearBoundary(): void $result = Yasumi::prevWorkingDay($provider, $startDate, $interval); $this->assertEquals($expectedPrevious, $result->format(self::FORMAT_DATE)); - // Assertion using a DateTimeImmutable instance $startDate = new DateTimeImmutable($start, new DateTimeZone($timezone)); $result = Yasumi::nextWorkingDay($provider, $startDate, $interval); @@ -143,14 +142,15 @@ public function testYearBoundary(): void $this->assertEquals($expectedPrevious, $result->format(self::FORMAT_DATE)); } - /** * Tests when the next working day happens to be in the next year. * * @dataProvider dataProviderWorkDayNextYear + * * @param string $start * @param int $workdays * @param string $expectedNext + * * @throws ReflectionException * @throws Exception */ @@ -182,4 +182,45 @@ public function dataProviderWorkDayNextYear(): array ], ]; } + + /** + * Tests when the previous working day happens to be in the previous year. + * + * @dataProvider dataProviderWorkDayPreviousYear + * + * @param string $start + * @param int $workdays + * @param string $expectedNext + * + * @throws ReflectionException + * @throws Exception + */ + public function testWorkDayIsPreviousYear(string $start, int $workdays, string $expectedNext): void + { + $provider = 'USA'; + $timezone = 'America/New_York'; + $startDate = new DateTime($start, new DateTimeZone($timezone)); + $result = Yasumi::prevWorkingDay($provider, $startDate, $workdays); + + $this->assertEquals($expectedNext, $result->format(self::FORMAT_DATE)); + } + + /** + * @return array + */ + public function dataProviderWorkDayPreviousYear(): array + { + return [ + [ + '2020-01-02', + 2, + '2019-12-30', + ], + [ + '2019-01-02', + 2, + '2018-12-28', + ], + ]; + } } From 3eb3cb2dbb56d1a462be5bfedf5c66a61c794005 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 1 Jan 2020 22:18:43 +0900 Subject: [PATCH 035/115] Updated Copyright year. Signed-off-by: Sacha Telgenhof --- .php_cs | 2 +- LICENSE | 2 +- phpunit.xml | 10 +++++----- src/Yasumi/Exception/Exception.php | 2 +- src/Yasumi/Exception/InvalidDateException.php | 2 +- src/Yasumi/Exception/InvalidYearException.php | 2 +- src/Yasumi/Exception/ProviderNotFoundException.php | 2 +- src/Yasumi/Exception/UnknownLocaleException.php | 2 +- src/Yasumi/Filters/AbstractFilter.php | 2 +- src/Yasumi/Filters/BankHolidaysFilter.php | 2 +- src/Yasumi/Filters/BetweenFilter.php | 2 +- src/Yasumi/Filters/ObservedHolidaysFilter.php | 2 +- src/Yasumi/Filters/OfficialHolidaysFilter.php | 2 +- src/Yasumi/Filters/OnFilter.php | 2 +- src/Yasumi/Filters/OtherHolidaysFilter.php | 2 +- src/Yasumi/Filters/SeasonalHolidaysFilter.php | 2 +- src/Yasumi/Holiday.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 2 +- src/Yasumi/Provider/Australia.php | 2 +- src/Yasumi/Provider/Australia/ACT.php | 2 +- src/Yasumi/Provider/Australia/NSW.php | 2 +- src/Yasumi/Provider/Australia/NT.php | 2 +- src/Yasumi/Provider/Australia/Queensland.php | 2 +- src/Yasumi/Provider/Australia/Queensland/Brisbane.php | 2 +- src/Yasumi/Provider/Australia/SA.php | 2 +- src/Yasumi/Provider/Australia/Tasmania.php | 2 +- .../Provider/Australia/Tasmania/CentralNorth.php | 2 +- .../Provider/Australia/Tasmania/FlindersIsland.php | 2 +- src/Yasumi/Provider/Australia/Tasmania/KingIsland.php | 2 +- src/Yasumi/Provider/Australia/Tasmania/Northeast.php | 2 +- src/Yasumi/Provider/Australia/Tasmania/Northwest.php | 2 +- .../Australia/Tasmania/Northwest/CircularHead.php | 2 +- src/Yasumi/Provider/Australia/Tasmania/South.php | 2 +- .../Provider/Australia/Tasmania/South/Southeast.php | 2 +- src/Yasumi/Provider/Australia/Victoria.php | 2 +- src/Yasumi/Provider/Australia/WA.php | 2 +- src/Yasumi/Provider/Austria.php | 2 +- src/Yasumi/Provider/Austria/Burgenland.php | 2 +- src/Yasumi/Provider/Austria/Carinthia.php | 2 +- src/Yasumi/Provider/Austria/LowerAustria.php | 2 +- src/Yasumi/Provider/Austria/Salzburg.php | 2 +- src/Yasumi/Provider/Austria/Styria.php | 2 +- src/Yasumi/Provider/Austria/Tyrol.php | 2 +- src/Yasumi/Provider/Austria/UpperAustria.php | 2 +- src/Yasumi/Provider/Austria/Vienna.php | 2 +- src/Yasumi/Provider/Austria/Vorarlberg.php | 2 +- src/Yasumi/Provider/Belgium.php | 2 +- src/Yasumi/Provider/Bosnia.php | 2 +- src/Yasumi/Provider/Brazil.php | 2 +- src/Yasumi/Provider/ChristianHolidays.php | 2 +- src/Yasumi/Provider/CommonHolidays.php | 2 +- src/Yasumi/Provider/Croatia.php | 2 +- src/Yasumi/Provider/CzechRepublic.php | 2 +- src/Yasumi/Provider/Denmark.php | 2 +- src/Yasumi/Provider/Estonia.php | 2 +- src/Yasumi/Provider/Finland.php | 2 +- src/Yasumi/Provider/France.php | 2 +- src/Yasumi/Provider/France/BasRhin.php | 2 +- src/Yasumi/Provider/France/HautRhin.php | 2 +- src/Yasumi/Provider/France/Moselle.php | 2 +- src/Yasumi/Provider/Germany.php | 2 +- src/Yasumi/Provider/Germany/BadenWurttemberg.php | 2 +- src/Yasumi/Provider/Germany/Bavaria.php | 2 +- src/Yasumi/Provider/Germany/Berlin.php | 2 +- src/Yasumi/Provider/Germany/Brandenburg.php | 2 +- src/Yasumi/Provider/Germany/Bremen.php | 2 +- src/Yasumi/Provider/Germany/Hamburg.php | 2 +- src/Yasumi/Provider/Germany/Hesse.php | 2 +- src/Yasumi/Provider/Germany/LowerSaxony.php | 2 +- .../Provider/Germany/MecklenburgWesternPomerania.php | 2 +- src/Yasumi/Provider/Germany/NorthRhineWestphalia.php | 2 +- src/Yasumi/Provider/Germany/RhinelandPalatinate.php | 2 +- src/Yasumi/Provider/Germany/Saarland.php | 2 +- src/Yasumi/Provider/Germany/Saxony.php | 2 +- src/Yasumi/Provider/Germany/SaxonyAnhalt.php | 2 +- src/Yasumi/Provider/Germany/SchleswigHolstein.php | 2 +- src/Yasumi/Provider/Germany/Thuringia.php | 2 +- src/Yasumi/Provider/Greece.php | 2 +- src/Yasumi/Provider/Hungary.php | 2 +- src/Yasumi/Provider/Ireland.php | 2 +- src/Yasumi/Provider/Italy.php | 2 +- src/Yasumi/Provider/Japan.php | 2 +- src/Yasumi/Provider/Latvia.php | 2 +- src/Yasumi/Provider/Lithuania.php | 2 +- src/Yasumi/Provider/Netherlands.php | 2 +- src/Yasumi/Provider/NewZealand.php | 2 +- src/Yasumi/Provider/Norway.php | 2 +- src/Yasumi/Provider/Poland.php | 2 +- src/Yasumi/Provider/Portugal.php | 2 +- src/Yasumi/Provider/Romania.php | 2 +- src/Yasumi/Provider/Russia.php | 2 +- src/Yasumi/Provider/Slovakia.php | 2 +- src/Yasumi/Provider/SouthAfrica.php | 2 +- src/Yasumi/Provider/SouthKorea.php | 2 +- src/Yasumi/Provider/Spain.php | 2 +- src/Yasumi/Provider/Spain/Andalusia.php | 2 +- src/Yasumi/Provider/Spain/Aragon.php | 2 +- src/Yasumi/Provider/Spain/Asturias.php | 2 +- src/Yasumi/Provider/Spain/BalearicIslands.php | 2 +- src/Yasumi/Provider/Spain/BasqueCountry.php | 2 +- src/Yasumi/Provider/Spain/CanaryIslands.php | 2 +- src/Yasumi/Provider/Spain/Cantabria.php | 2 +- src/Yasumi/Provider/Spain/CastileAndLeon.php | 2 +- src/Yasumi/Provider/Spain/CastillaLaMancha.php | 2 +- src/Yasumi/Provider/Spain/Catalonia.php | 2 +- src/Yasumi/Provider/Spain/Ceuta.php | 2 +- src/Yasumi/Provider/Spain/CommunityOfMadrid.php | 2 +- src/Yasumi/Provider/Spain/Extremadura.php | 2 +- src/Yasumi/Provider/Spain/Galicia.php | 2 +- src/Yasumi/Provider/Spain/LaRioja.php | 2 +- src/Yasumi/Provider/Spain/Melilla.php | 2 +- src/Yasumi/Provider/Spain/Navarre.php | 2 +- src/Yasumi/Provider/Spain/RegionOfMurcia.php | 2 +- src/Yasumi/Provider/Spain/ValencianCommunity.php | 2 +- src/Yasumi/Provider/Sweden.php | 2 +- src/Yasumi/Provider/Switzerland.php | 2 +- src/Yasumi/Provider/Switzerland/Aargau.php | 2 +- .../Provider/Switzerland/AppenzellAusserrhoden.php | 2 +- .../Provider/Switzerland/AppenzellInnerrhoden.php | 2 +- src/Yasumi/Provider/Switzerland/BaselLandschaft.php | 2 +- src/Yasumi/Provider/Switzerland/BaselStadt.php | 2 +- src/Yasumi/Provider/Switzerland/Bern.php | 2 +- src/Yasumi/Provider/Switzerland/Fribourg.php | 2 +- src/Yasumi/Provider/Switzerland/Geneva.php | 2 +- src/Yasumi/Provider/Switzerland/Glarus.php | 2 +- src/Yasumi/Provider/Switzerland/Grisons.php | 2 +- src/Yasumi/Provider/Switzerland/Jura.php | 2 +- src/Yasumi/Provider/Switzerland/Lucerne.php | 2 +- src/Yasumi/Provider/Switzerland/Neuchatel.php | 2 +- src/Yasumi/Provider/Switzerland/Nidwalden.php | 2 +- src/Yasumi/Provider/Switzerland/Obwalden.php | 2 +- src/Yasumi/Provider/Switzerland/Schaffhausen.php | 2 +- src/Yasumi/Provider/Switzerland/Schwyz.php | 2 +- src/Yasumi/Provider/Switzerland/Solothurn.php | 2 +- src/Yasumi/Provider/Switzerland/StGallen.php | 2 +- src/Yasumi/Provider/Switzerland/Thurgau.php | 2 +- src/Yasumi/Provider/Switzerland/Ticino.php | 2 +- src/Yasumi/Provider/Switzerland/Uri.php | 2 +- src/Yasumi/Provider/Switzerland/Valais.php | 2 +- src/Yasumi/Provider/Switzerland/Vaud.php | 2 +- src/Yasumi/Provider/Switzerland/Zug.php | 2 +- src/Yasumi/Provider/Switzerland/Zurich.php | 2 +- src/Yasumi/Provider/USA.php | 2 +- src/Yasumi/Provider/Ukraine.php | 2 +- src/Yasumi/Provider/UnitedKingdom.php | 2 +- src/Yasumi/Provider/UnitedKingdom/England.php | 2 +- src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php | 2 +- src/Yasumi/Provider/UnitedKingdom/Scotland.php | 2 +- src/Yasumi/Provider/UnitedKingdom/Wales.php | 2 +- src/Yasumi/ProviderInterface.php | 2 +- src/Yasumi/SubstituteHoliday.php | 2 +- src/Yasumi/Translations.php | 2 +- src/Yasumi/TranslationsInterface.php | 2 +- src/Yasumi/Yasumi.php | 2 +- src/Yasumi/data/locales.php | 2 +- src/Yasumi/data/translations/allSaintsDay.php | 2 +- src/Yasumi/data/translations/allSaintsEve.php | 2 +- src/Yasumi/data/translations/annunciation.php | 2 +- src/Yasumi/data/translations/anzacDay.php | 2 +- src/Yasumi/data/translations/armisticeDay.php | 2 +- src/Yasumi/data/translations/ascensionDay.php | 2 +- src/Yasumi/data/translations/ashWednesday.php | 2 +- src/Yasumi/data/translations/assumptionOfMary.php | 2 +- src/Yasumi/data/translations/australiaDay.php | 2 +- .../data/translations/carnationRevolutionDay.php | 2 +- src/Yasumi/data/translations/christmasDay.php | 2 +- src/Yasumi/data/translations/christmasEve.php | 2 +- src/Yasumi/data/translations/corpusChristi.php | 2 +- src/Yasumi/data/translations/dayAfterNewYearsDay.php | 2 +- src/Yasumi/data/translations/dayOfReformation.php | 2 +- src/Yasumi/data/translations/easter.php | 2 +- src/Yasumi/data/translations/easterMonday.php | 2 +- src/Yasumi/data/translations/epiphany.php | 2 +- src/Yasumi/data/translations/epiphanyEve.php | 2 +- src/Yasumi/data/translations/fathersDay.php | 2 +- src/Yasumi/data/translations/goodFriday.php | 2 +- src/Yasumi/data/translations/immaculateConception.php | 2 +- .../data/translations/internationalWomensDay.php | 2 +- .../data/translations/internationalWorkersDay.php | 2 +- src/Yasumi/data/translations/labourDay.php | 2 +- src/Yasumi/data/translations/maundyThursday.php | 2 +- src/Yasumi/data/translations/mothersDay.php | 2 +- src/Yasumi/data/translations/newYearsDay.php | 2 +- src/Yasumi/data/translations/newYearsEve.php | 2 +- src/Yasumi/data/translations/pentecost.php | 2 +- src/Yasumi/data/translations/pentecostMonday.php | 2 +- src/Yasumi/data/translations/plebisciteDay.php | 2 +- src/Yasumi/data/translations/portugalDay.php | 2 +- src/Yasumi/data/translations/portugueseRepublicDay.php | 2 +- src/Yasumi/data/translations/reformationDay.php | 2 +- .../data/translations/restorationOfIndepence.php | 2 +- src/Yasumi/data/translations/secondChristmasDay.php | 2 +- src/Yasumi/data/translations/secondNewYearsDay.php | 2 +- src/Yasumi/data/translations/stAndrewsDay.php | 2 +- src/Yasumi/data/translations/stDavidsDay.php | 2 +- src/Yasumi/data/translations/stFloriansDay.php | 2 +- src/Yasumi/data/translations/stGeorgesDay.php | 2 +- src/Yasumi/data/translations/stJohnsDay.php | 2 +- src/Yasumi/data/translations/stJohnsEve.php | 2 +- src/Yasumi/data/translations/stJosephsDay.php | 2 +- src/Yasumi/data/translations/stLeopoldsDay.php | 2 +- src/Yasumi/data/translations/stMartinsDay.php | 2 +- src/Yasumi/data/translations/stRupertsDay.php | 2 +- src/Yasumi/data/translations/stStephensDay.php | 2 +- src/Yasumi/data/translations/substituteHoliday.php | 2 +- src/Yasumi/data/translations/summerTime.php | 2 +- src/Yasumi/data/translations/valentinesDay.php | 2 +- src/Yasumi/data/translations/victoryInEuropeDay.php | 2 +- src/Yasumi/data/translations/waitangiDay.php | 2 +- src/Yasumi/data/translations/walpurgisEve.php | 2 +- src/Yasumi/data/translations/winterTime.php | 2 +- src/Yasumi/data/translations/worldAnimalDay.php | 2 +- tests/Australia/ACT/ACTBaseTestCase.php | 2 +- tests/Australia/ACT/ACTTest.php | 2 +- tests/Australia/ACT/AnzacDayTest.php | 2 +- tests/Australia/ACT/AustraliaDayTest.php | 2 +- tests/Australia/ACT/BoxingDayTest.php | 2 +- tests/Australia/ACT/CanberraDayTest.php | 2 +- tests/Australia/ACT/ChristmasDayTest.php | 2 +- tests/Australia/ACT/EasterMondayTest.php | 2 +- tests/Australia/ACT/EasterSaturdayTest.php | 2 +- tests/Australia/ACT/EasterSundayTest.php | 2 +- tests/Australia/ACT/GoodFridayTest.php | 2 +- tests/Australia/ACT/LabourDayTest.php | 2 +- tests/Australia/ACT/NewYearsDayTest.php | 2 +- tests/Australia/ACT/QueensBirthdayTest.php | 2 +- tests/Australia/ACT/ReconciliationDayTest.php | 2 +- tests/Australia/AnzacDayTest.php | 2 +- tests/Australia/AustraliaBaseTestCase.php | 2 +- tests/Australia/AustraliaDayTest.php | 2 +- tests/Australia/AustraliaTest.php | 2 +- tests/Australia/BoxingDayTest.php | 2 +- tests/Australia/ChristmasDayTest.php | 2 +- tests/Australia/EasterMondayTest.php | 2 +- tests/Australia/GoodFridayTest.php | 2 +- tests/Australia/NSW/AnzacDayTest.php | 2 +- tests/Australia/NSW/AustraliaDayTest.php | 2 +- tests/Australia/NSW/BankHolidayTest.php | 2 +- tests/Australia/NSW/BoxingDayTest.php | 2 +- tests/Australia/NSW/ChristmasDayTest.php | 2 +- tests/Australia/NSW/EasterMondayTest.php | 2 +- tests/Australia/NSW/EasterSaturdayTest.php | 2 +- tests/Australia/NSW/EasterSundayTest.php | 2 +- tests/Australia/NSW/GoodFridayTest.php | 2 +- tests/Australia/NSW/LabourDayTest.php | 2 +- tests/Australia/NSW/NSWBaseTestCase.php | 2 +- tests/Australia/NSW/NSWTest.php | 2 +- tests/Australia/NSW/NewYearsDayTest.php | 2 +- tests/Australia/NSW/QueensBirthdayTest.php | 2 +- tests/Australia/NT/AnzacDayTest.php | 2 +- tests/Australia/NT/AustraliaDayTest.php | 2 +- tests/Australia/NT/BoxingDayTest.php | 2 +- tests/Australia/NT/ChristmasDayTest.php | 2 +- tests/Australia/NT/EasterMondayTest.php | 2 +- tests/Australia/NT/EasterSaturdayTest.php | 2 +- tests/Australia/NT/GoodFridayTest.php | 2 +- tests/Australia/NT/MayDayTest.php | 2 +- tests/Australia/NT/NTBaseTestCase.php | 2 +- tests/Australia/NT/NTTest.php | 2 +- tests/Australia/NT/NewYearsDayTest.php | 2 +- tests/Australia/NT/PicnicDayTest.php | 2 +- tests/Australia/NT/QueensBirthdayTest.php | 2 +- tests/Australia/NewYearsDayTest.php | 2 +- tests/Australia/Queensland/AnzacDayTest.php | 2 +- tests/Australia/Queensland/AustraliaDayTest.php | 2 +- tests/Australia/Queensland/BoxingDayTest.php | 2 +- tests/Australia/Queensland/Brisbane/AnzacDayTest.php | 2 +- .../Australia/Queensland/Brisbane/AustraliaDayTest.php | 2 +- tests/Australia/Queensland/Brisbane/BoxingDayTest.php | 2 +- .../Queensland/Brisbane/BrisbaneBaseTestCase.php | 2 +- tests/Australia/Queensland/Brisbane/BrisbaneTest.php | 2 +- .../Australia/Queensland/Brisbane/ChristmasDayTest.php | 2 +- .../Australia/Queensland/Brisbane/EasterMondayTest.php | 2 +- tests/Australia/Queensland/Brisbane/GoodFridayTest.php | 2 +- tests/Australia/Queensland/Brisbane/LabourDayTest.php | 2 +- .../Australia/Queensland/Brisbane/NewYearsDayTest.php | 2 +- tests/Australia/Queensland/Brisbane/PeoplesDayTest.php | 2 +- .../Queensland/Brisbane/QueensBirthdayTest.php | 2 +- tests/Australia/Queensland/ChristmasDayTest.php | 2 +- tests/Australia/Queensland/EasterMondayTest.php | 2 +- tests/Australia/Queensland/GoodFridayTest.php | 2 +- tests/Australia/Queensland/LabourDayTest.php | 2 +- tests/Australia/Queensland/NewYearsDayTest.php | 2 +- tests/Australia/Queensland/QueensBirthdayTest.php | 2 +- tests/Australia/Queensland/QueenslandBaseTestCase.php | 2 +- tests/Australia/Queensland/QueenslandTest.php | 2 +- tests/Australia/SA/AdelaideCupDayTest.php | 2 +- tests/Australia/SA/AnzacDayTest.php | 2 +- tests/Australia/SA/AustraliaDayTest.php | 2 +- tests/Australia/SA/ChristmasDayTest.php | 2 +- tests/Australia/SA/EasterMondayTest.php | 2 +- tests/Australia/SA/EasterSaturdayTest.php | 2 +- tests/Australia/SA/GoodFridayTest.php | 2 +- tests/Australia/SA/LabourDayTest.php | 2 +- tests/Australia/SA/NewYearsDayTest.php | 2 +- tests/Australia/SA/ProclamationDayTest.php | 2 +- tests/Australia/SA/QueensBirthdayTest.php | 2 +- tests/Australia/SA/SABaseTestCase.php | 2 +- tests/Australia/SA/SATest.php | 2 +- tests/Australia/Tasmania/AnzacDayTest.php | 2 +- tests/Australia/Tasmania/AustraliaDayTest.php | 2 +- tests/Australia/Tasmania/BoxingDayTest.php | 2 +- tests/Australia/Tasmania/CentralNorth/AnzacDayTest.php | 2 +- .../Tasmania/CentralNorth/AustraliaDayTest.php | 2 +- .../Australia/Tasmania/CentralNorth/BoxingDayTest.php | 2 +- .../Tasmania/CentralNorth/CentralNorthBaseTestCase.php | 2 +- .../Tasmania/CentralNorth/CentralNorthTest.php | 2 +- .../Tasmania/CentralNorth/ChristmasDayTest.php | 2 +- .../Tasmania/CentralNorth/DevonportShowTest.php | 2 +- .../Tasmania/CentralNorth/EasterMondayTest.php | 2 +- .../Tasmania/CentralNorth/EightHourDayTest.php | 2 +- .../Australia/Tasmania/CentralNorth/GoodFridayTest.php | 2 +- .../Tasmania/CentralNorth/NewYearsDayTest.php | 2 +- .../Tasmania/CentralNorth/QueensBirthdayTest.php | 2 +- .../Tasmania/CentralNorth/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/ChristmasDayTest.php | 2 +- tests/Australia/Tasmania/EasterMondayTest.php | 2 +- tests/Australia/Tasmania/EightHourDayTest.php | 2 +- .../Australia/Tasmania/FlindersIsland/AnzacDayTest.php | 2 +- .../Tasmania/FlindersIsland/AustraliaDayTest.php | 2 +- .../Tasmania/FlindersIsland/BoxingDayTest.php | 2 +- .../Tasmania/FlindersIsland/ChristmasDayTest.php | 2 +- .../Tasmania/FlindersIsland/EasterMondayTest.php | 2 +- .../Tasmania/FlindersIsland/EightHourDayTest.php | 2 +- .../FlindersIsland/FlindersIslandBaseTestCase.php | 2 +- .../Tasmania/FlindersIsland/FlindersIslandShowTest.php | 2 +- .../Tasmania/FlindersIsland/FlindersIslandTest.php | 2 +- .../Tasmania/FlindersIsland/GoodFridayTest.php | 2 +- .../Tasmania/FlindersIsland/NewYearsDayTest.php | 2 +- .../Tasmania/FlindersIsland/QueensBirthdayTest.php | 2 +- .../Tasmania/FlindersIsland/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/GoodFridayTest.php | 2 +- tests/Australia/Tasmania/KingIsland/AnzacDayTest.php | 2 +- .../Australia/Tasmania/KingIsland/AustraliaDayTest.php | 2 +- tests/Australia/Tasmania/KingIsland/BoxingDayTest.php | 2 +- .../Australia/Tasmania/KingIsland/ChristmasDayTest.php | 2 +- .../Australia/Tasmania/KingIsland/EasterMondayTest.php | 2 +- .../Australia/Tasmania/KingIsland/EightHourDayTest.php | 2 +- tests/Australia/Tasmania/KingIsland/GoodFridayTest.php | 2 +- .../Tasmania/KingIsland/KingIslandBaseTestCase.php | 2 +- .../Tasmania/KingIsland/KingIslandShowTest.php | 2 +- tests/Australia/Tasmania/KingIsland/KingIslandTest.php | 2 +- .../Australia/Tasmania/KingIsland/NewYearsDayTest.php | 2 +- .../Tasmania/KingIsland/QueensBirthdayTest.php | 2 +- .../Tasmania/KingIsland/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/NewYearsDayTest.php | 2 +- tests/Australia/Tasmania/Northeast/AnzacDayTest.php | 2 +- .../Australia/Tasmania/Northeast/AustraliaDayTest.php | 2 +- tests/Australia/Tasmania/Northeast/BoxingDayTest.php | 2 +- .../Australia/Tasmania/Northeast/ChristmasDayTest.php | 2 +- .../Australia/Tasmania/Northeast/EasterMondayTest.php | 2 +- .../Australia/Tasmania/Northeast/EightHourDayTest.php | 2 +- tests/Australia/Tasmania/Northeast/GoodFridayTest.php | 2 +- .../Tasmania/Northeast/LauncestonShowTest.php | 2 +- tests/Australia/Tasmania/Northeast/NewYearsDayTest.php | 2 +- .../Tasmania/Northeast/NortheastBaseTestCase.php | 2 +- tests/Australia/Tasmania/Northeast/NortheastTest.php | 2 +- .../Tasmania/Northeast/QueensBirthdayTest.php | 2 +- .../Australia/Tasmania/Northeast/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/Northwest/AnzacDayTest.php | 2 +- .../Australia/Tasmania/Northwest/AustraliaDayTest.php | 2 +- tests/Australia/Tasmania/Northwest/BoxingDayTest.php | 2 +- tests/Australia/Tasmania/Northwest/BurnieShowTest.php | 2 +- .../Australia/Tasmania/Northwest/ChristmasDayTest.php | 2 +- .../Tasmania/Northwest/CircularHead/AGFESTTest.php | 2 +- .../Tasmania/Northwest/CircularHead/AnzacDayTest.php | 2 +- .../Northwest/CircularHead/AustraliaDayTest.php | 2 +- .../Tasmania/Northwest/CircularHead/BoxingDayTest.php | 2 +- .../Tasmania/Northwest/CircularHead/BurnieShowTest.php | 2 +- .../Northwest/CircularHead/ChristmasDayTest.php | 2 +- .../CircularHead/CircularHeadBaseTestCase.php | 2 +- .../Northwest/CircularHead/CircularHeadTest.php | 2 +- .../Northwest/CircularHead/EasterMondayTest.php | 2 +- .../Northwest/CircularHead/EightHourDayTest.php | 2 +- .../Tasmania/Northwest/CircularHead/GoodFridayTest.php | 2 +- .../Northwest/CircularHead/NewYearsDayTest.php | 2 +- .../Northwest/CircularHead/QueensBirthdayTest.php | 2 +- .../Northwest/CircularHead/RecreationDayTest.php | 2 +- .../Australia/Tasmania/Northwest/EasterMondayTest.php | 2 +- .../Australia/Tasmania/Northwest/EightHourDayTest.php | 2 +- tests/Australia/Tasmania/Northwest/GoodFridayTest.php | 2 +- tests/Australia/Tasmania/Northwest/NewYearsDayTest.php | 2 +- .../Tasmania/Northwest/NorthwestBaseTestCase.php | 2 +- tests/Australia/Tasmania/Northwest/NorthwestTest.php | 2 +- .../Tasmania/Northwest/QueensBirthdayTest.php | 2 +- .../Australia/Tasmania/Northwest/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/QueensBirthdayTest.php | 2 +- tests/Australia/Tasmania/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/South/AnzacDayTest.php | 2 +- tests/Australia/Tasmania/South/AustraliaDayTest.php | 2 +- tests/Australia/Tasmania/South/BoxingDayTest.php | 2 +- tests/Australia/Tasmania/South/ChristmasDayTest.php | 2 +- tests/Australia/Tasmania/South/EasterMondayTest.php | 2 +- tests/Australia/Tasmania/South/EightHourDayTest.php | 2 +- tests/Australia/Tasmania/South/GoodFridayTest.php | 2 +- tests/Australia/Tasmania/South/HobartShowTest.php | 2 +- tests/Australia/Tasmania/South/NewYearsDayTest.php | 2 +- tests/Australia/Tasmania/South/QueensBirthdayTest.php | 2 +- tests/Australia/Tasmania/South/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/South/SouthBaseTestCase.php | 2 +- tests/Australia/Tasmania/South/SouthTest.php | 2 +- .../Tasmania/South/Southeast/AnzacDayTest.php | 2 +- .../Tasmania/South/Southeast/AustraliaDayTest.php | 2 +- .../Tasmania/South/Southeast/BoxingDayTest.php | 2 +- .../Tasmania/South/Southeast/ChristmasDayTest.php | 2 +- .../Tasmania/South/Southeast/EasterMondayTest.php | 2 +- .../Tasmania/South/Southeast/EightHourDayTest.php | 2 +- .../Tasmania/South/Southeast/GoodFridayTest.php | 2 +- .../Tasmania/South/Southeast/HobartRegattaTest.php | 2 +- .../Tasmania/South/Southeast/HobartShowTest.php | 2 +- .../Tasmania/South/Southeast/NewYearsDayTest.php | 2 +- .../Tasmania/South/Southeast/QueensBirthdayTest.php | 2 +- .../Tasmania/South/Southeast/SoutheastBaseTestCase.php | 2 +- .../Tasmania/South/Southeast/SoutheastTest.php | 2 +- tests/Australia/Tasmania/TasmaniaBaseTestCase.php | 2 +- tests/Australia/Tasmania/TasmaniaTest.php | 2 +- tests/Australia/Victoria/AFLGrandFinalFridayTest.php | 2 +- tests/Australia/Victoria/AnzacDayTest.php | 2 +- tests/Australia/Victoria/AustraliaDayTest.php | 2 +- tests/Australia/Victoria/BoxingDayTest.php | 2 +- tests/Australia/Victoria/ChristmasDayTest.php | 2 +- tests/Australia/Victoria/EasterMondayTest.php | 2 +- tests/Australia/Victoria/EasterSaturdayTest.php | 2 +- tests/Australia/Victoria/EasterSundayTest.php | 2 +- tests/Australia/Victoria/GoodFridayTest.php | 2 +- tests/Australia/Victoria/LabourDayTest.php | 2 +- tests/Australia/Victoria/MelbourneCupDayTest.php | 2 +- tests/Australia/Victoria/NewYearsDayTest.php | 2 +- tests/Australia/Victoria/QueensBirthdayTest.php | 2 +- tests/Australia/Victoria/VictoriaBaseTestCase.php | 2 +- tests/Australia/Victoria/VictoriaTest.php | 2 +- tests/Australia/WA/AnzacDayTest.php | 2 +- tests/Australia/WA/AustraliaDayTest.php | 2 +- tests/Australia/WA/BoxingDayTest.php | 2 +- tests/Australia/WA/ChristmasDayTest.php | 2 +- tests/Australia/WA/EasterMondayTest.php | 2 +- tests/Australia/WA/GoodFridayTest.php | 2 +- tests/Australia/WA/LabourDayTest.php | 2 +- tests/Australia/WA/NewYearsDayTest.php | 2 +- tests/Australia/WA/QueensBirthdayTest.php | 2 +- tests/Australia/WA/WABaseTestCase.php | 2 +- tests/Australia/WA/WATest.php | 2 +- tests/Australia/WA/WesternAustraliaDayTest.php | 2 +- tests/Austria/AllSaintsDayTest.php | 2 +- tests/Austria/AscensionDayTest.php | 2 +- tests/Austria/AssumptionOfMaryTest.php | 2 +- tests/Austria/AustriaBaseTestCase.php | 2 +- tests/Austria/AustriaTest.php | 2 +- tests/Austria/Burgenland/BurgenlandBaseTestCase.php | 2 +- tests/Austria/Burgenland/stMartinsDayTest.php | 2 +- tests/Austria/Carinthia/CarinthiaBaseTestCase.php | 2 +- tests/Austria/Carinthia/PlebisciteDayTest.php | 2 +- tests/Austria/Carinthia/StJosephsDayTest.php | 2 +- tests/Austria/ChristmasTest.php | 2 +- tests/Austria/CorpusChristiTest.php | 2 +- tests/Austria/EasterMondayTest.php | 2 +- tests/Austria/EasterTest.php | 2 +- tests/Austria/EpiphanyTest.php | 2 +- tests/Austria/ImmaculateConceptionTest.php | 2 +- tests/Austria/InternationalWorkersDayTest.php | 2 +- .../Austria/LowerAustria/LowerAustriaBaseTestCase.php | 2 +- tests/Austria/LowerAustria/StLeopoldsDayTest.php | 2 +- tests/Austria/NationalDayTest.php | 2 +- tests/Austria/NewYearsDayTest.php | 2 +- tests/Austria/PentecostMondayTest.php | 2 +- tests/Austria/PentecostTest.php | 2 +- tests/Austria/Salzburg/SalzburgBaseTestCase.php | 2 +- tests/Austria/Salzburg/StRupertsDayTest.php | 2 +- tests/Austria/SecondChristmasDayTest.php | 2 +- tests/Austria/Styria/StJosephsDayTest.php | 2 +- tests/Austria/Styria/StyriaBaseTestCase.php | 2 +- tests/Austria/Tyrol/StJosephsDayTest.php | 2 +- tests/Austria/Tyrol/TyrolBaseTestCase.php | 2 +- tests/Austria/UpperAustria/StFloriansDayTest.php | 2 +- .../Austria/UpperAustria/UpperAustriaBaseTestCase.php | 2 +- tests/Austria/Vienna/StLeopoldsDayTest.php | 2 +- tests/Austria/Vienna/ViennaBaseTestCase.php | 2 +- tests/Austria/Vorarlberg/StJosephsDayTest.php | 2 +- tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php | 2 +- tests/Base/HolidayBetweenFilterTest.php | 2 +- tests/Base/HolidayFiltersTest.php | 2 +- tests/Base/HolidayOnFilterTest.php | 2 +- tests/Base/HolidayTest.php | 2 +- tests/Base/SubstituteHolidayTest.php | 2 +- tests/Base/TranslationsTest.php | 2 +- tests/Base/YasumiExternalProvider.php | 2 +- tests/Base/YasumiTest.php | 2 +- tests/Base/YasumiWorkdayTest.php | 2 +- tests/Belgium/AllSaintsDayTest.php | 2 +- tests/Belgium/ArmisticeDayTest.php | 2 +- tests/Belgium/AscensionDayTest.php | 2 +- tests/Belgium/AssumptionOfMaryTest.php | 2 +- tests/Belgium/BelgiumBaseTestCase.php | 2 +- tests/Belgium/BelgiumTest.php | 2 +- tests/Belgium/ChristmasTest.php | 2 +- tests/Belgium/EasterMondayTest.php | 2 +- tests/Belgium/EasterTest.php | 2 +- tests/Belgium/InternationalWorkersDayTest.php | 2 +- tests/Belgium/NationalDayTest.php | 2 +- tests/Belgium/NewYearsDayTest.php | 2 +- tests/Belgium/PentecostTest.php | 2 +- tests/Belgium/pentecostMondayTest.php | 2 +- tests/Bosnia/BosniaBaseTestCase.php | 2 +- tests/Bosnia/BosniaTest.php | 2 +- tests/Bosnia/ChristmasDayTest.php | 2 +- tests/Bosnia/DayAfterNewYearsDay.php | 2 +- tests/Bosnia/EasterTest.php | 2 +- tests/Bosnia/IndependenceDayTest.php | 2 +- tests/Bosnia/InternationalWorkersDayTest.php | 2 +- tests/Bosnia/NewYearsDayTest.php | 2 +- tests/Bosnia/OrthodoxChristmasDay.php | 2 +- tests/Bosnia/SecondLabourDay.php | 2 +- tests/Bosnia/StatehoodDayTest.php | 2 +- tests/Brazil/AllSoulsDayTest.php | 2 +- tests/Brazil/AshWednesdayTest.php | 2 +- tests/Brazil/BrazilBaseTestCase.php | 2 +- tests/Brazil/BrazilTest.php | 2 +- tests/Brazil/CarnavalMondayTest.php | 2 +- tests/Brazil/CarnavalTuesdayTest.php | 2 +- tests/Brazil/ChristmasDayTest.php | 2 +- tests/Brazil/CorpusChristiTest.php | 2 +- tests/Brazil/EasterTest.php | 2 +- tests/Brazil/GoodFridayTest.php | 2 +- tests/Brazil/IndependenceDayTest.php | 2 +- tests/Brazil/InternationalWorkersDayTest.php | 2 +- tests/Brazil/NewYearsDayTest.php | 2 +- tests/Brazil/OurLadyOfAparecidaDayTest.php | 2 +- tests/Brazil/ProclamationOfRepublicDayTest.php | 2 +- tests/Brazil/TiradentesDayTest.php | 2 +- tests/Croatia/AllSaintsDayTest.php | 2 +- tests/Croatia/AntifascistStruggleDayTest.php | 2 +- tests/Croatia/AssumptionOfMaryTest.php | 2 +- tests/Croatia/ChristmasDayTest.php | 2 +- tests/Croatia/CorpusChristiTest.php | 2 +- tests/Croatia/CroatiaBaseTestCase.php | 2 +- tests/Croatia/EasterMondayTest.php | 2 +- tests/Croatia/EasterTest.php | 2 +- tests/Croatia/EpiphanyTest.php | 2 +- tests/Croatia/HomelandThanksgivingDayTest.php | 2 +- tests/Croatia/IndependenceDayTest.php | 2 +- tests/Croatia/InternationalWorkersDayTest.php | 2 +- tests/Croatia/NewYearsDayTest.php | 2 +- tests/Croatia/StStephensDayTest.php | 2 +- tests/Croatia/StatehoodDayTest.php | 2 +- tests/CzechRepublic/ChristmasDayTest.php | 2 +- tests/CzechRepublic/ChristmasEveTest.php | 2 +- tests/CzechRepublic/CzechRepublicBaseTestCase.php | 2 +- tests/CzechRepublic/CzechRepublicTest.php | 2 +- tests/CzechRepublic/CzechStateHoodDayTest.php | 2 +- tests/CzechRepublic/EasterMondayTest.php | 2 +- tests/CzechRepublic/GoodFridayTest.php | 2 +- .../IndependentCzechoslovakStateDayTest.php | 2 +- tests/CzechRepublic/InternationalWorkersDayTest.php | 2 +- tests/CzechRepublic/JanHusDayTest.php | 2 +- tests/CzechRepublic/NewYearsDayTest.php | 2 +- .../RenewalOfIndependentCzechStateDayTest.php | 2 +- tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php | 2 +- tests/CzechRepublic/SecondChristmasDayTest.php | 2 +- .../StruggleForFreedomAndDemocracyDayTest.php | 2 +- tests/CzechRepublic/VictoryInEuropeDayTest.php | 2 +- tests/Denmark/AscensionDayTest.php | 2 +- tests/Denmark/ChristmasDayTest.php | 2 +- tests/Denmark/ChristmasEveTest.php | 2 +- tests/Denmark/ConstitutionDayTest.php | 2 +- tests/Denmark/DenmarkBaseTestCase.php | 2 +- tests/Denmark/DenmarkTest.php | 2 +- tests/Denmark/EasterMondayTest.php | 2 +- tests/Denmark/EasterTest.php | 2 +- tests/Denmark/GoodFridayTest.php | 2 +- tests/Denmark/GreatPrayerDayTest.php | 2 +- tests/Denmark/InternationalWorkersDayTest.php | 2 +- tests/Denmark/MaundyThursdayTest.php | 2 +- tests/Denmark/NewYearsDayTest.php | 2 +- tests/Denmark/NewYearsEveTest.php | 2 +- tests/Denmark/PentecostMondayTest.php | 2 +- tests/Denmark/PentecostTest.php | 2 +- tests/Denmark/SecondChristmasDayTest.php | 2 +- tests/Denmark/SummerTimeTest.php | 2 +- tests/Denmark/WinterTimeTest.php | 2 +- tests/Estonia/ChristmasDayTest.php | 2 +- tests/Estonia/ChristmasEveDayTest.php | 2 +- tests/Estonia/EasterDayTest.php | 2 +- tests/Estonia/EstoniaBaseTestCase.php | 2 +- tests/Estonia/EstoniaTest.php | 2 +- tests/Estonia/GoodFridayDayTest.php | 2 +- tests/Estonia/IndependenceDayTest.php | 2 +- tests/Estonia/InternationalWorkersDayTest.php | 2 +- tests/Estonia/NewYearsDayTest.php | 2 +- tests/Estonia/PentecostTest.php | 2 +- tests/Estonia/RestorationOfIndependenceDayTest.php | 2 +- tests/Estonia/SecondChristmasDayTest.php | 2 +- tests/Estonia/StJohnsDayTest.php | 2 +- tests/Estonia/VictoryDayTest.php | 2 +- tests/Finland/AllSaintsDayTest.php | 2 +- tests/Finland/AscensionDayTest.php | 2 +- tests/Finland/ChristmasDayTest.php | 2 +- tests/Finland/EasterMondayTest.php | 2 +- tests/Finland/EasterTest.php | 2 +- tests/Finland/EpiphanyTest.php | 2 +- tests/Finland/FinlandBaseTestCase.php | 2 +- tests/Finland/FinlandTest.php | 2 +- tests/Finland/GoodFridayTest.php | 2 +- tests/Finland/IndependenceDayTest.php | 2 +- tests/Finland/InternationalWorkersDayTest.php | 2 +- tests/Finland/NewYearsDayTest.php | 2 +- tests/Finland/PentecostTest.php | 2 +- tests/Finland/SecondChristmasDayTest.php | 2 +- tests/Finland/stJohnsDayTest.php | 2 +- tests/France/AllSaintsDayTest.php | 2 +- tests/France/ArmisticeDayTest.php | 2 +- tests/France/AscensionDayTest.php | 2 +- tests/France/AssumptionOfMaryTest.php | 2 +- tests/France/BasRhin/BasRhinBaseTestCase.php | 2 +- tests/France/BasRhin/BasRhinTest.php | 2 +- tests/France/BasRhin/GoodFridayTest.php | 2 +- tests/France/BasRhin/stStephensDayTest.php | 2 +- tests/France/BastilleDayTest.php | 2 +- tests/France/ChristmasDayTest.php | 2 +- tests/France/EasterMondayTest.php | 2 +- tests/France/FranceBaseTestCase.php | 2 +- tests/France/FranceTest.php | 2 +- tests/France/HautRhin/GoodFridayTest.php | 2 +- tests/France/HautRhin/HautRhinBaseTestCase.php | 2 +- tests/France/HautRhin/HautRhinTest.php | 2 +- tests/France/HautRhin/stStephensDayTest.php | 2 +- tests/France/InternationalWorkersDayTest.php | 2 +- tests/France/Moselle/GoodFridayTest.php | 2 +- tests/France/Moselle/MoselleBaseTestCase.php | 2 +- tests/France/Moselle/MoselleTest.php | 2 +- tests/France/Moselle/stStephensDayTest.php | 2 +- tests/France/NewYearsDayTest.php | 2 +- tests/France/PentecostMondayTest.php | 2 +- tests/France/VictoryInEuropeDayTest.php | 2 +- tests/Germany/AscensionDayTest.php | 2 +- tests/Germany/BadenWurttemberg/AllSaintsDayTest.php | 2 +- .../BadenWurttemberg/BadenWurttembergBaseTestCase.php | 2 +- .../Germany/BadenWurttemberg/BadenWurttembergTest.php | 2 +- tests/Germany/BadenWurttemberg/CorpusChristiTest.php | 2 +- tests/Germany/BadenWurttemberg/EpiphanyTest.php | 2 +- tests/Germany/BadenWurttemberg/GermanUnityDayTest.php | 2 +- .../BadenWurttemberg/ReformationDay2017Test.php | 2 +- tests/Germany/Bavaria/AllSaintsDayTest.php | 2 +- tests/Germany/Bavaria/BavariaBaseTestCase.php | 2 +- tests/Germany/Bavaria/BavariaTest.php | 2 +- tests/Germany/Bavaria/CorpusChristiTest.php | 2 +- tests/Germany/Bavaria/EpiphanyTest.php | 2 +- tests/Germany/Bavaria/GermanUnityDayTest.php | 2 +- tests/Germany/Bavaria/ReformationDay2017Test.php | 2 +- tests/Germany/Berlin/BerlinBaseTestCase.php | 2 +- tests/Germany/Berlin/BerlinTest.php | 2 +- tests/Germany/Berlin/GermanUnityDayTest.php | 2 +- .../Germany/Berlin/InternationalWomensDay2019Test.php | 2 +- tests/Germany/Berlin/ReformationDay2017Test.php | 2 +- tests/Germany/Brandenburg/BrandenburgBaseTestCase.php | 2 +- tests/Germany/Brandenburg/BrandenburgTest.php | 2 +- tests/Germany/Brandenburg/GermanUnityDayTest.php | 2 +- tests/Germany/Brandenburg/ReformationDayTest.php | 2 +- tests/Germany/Bremen/BremenBaseTestCase.php | 2 +- tests/Germany/Bremen/BremenTest.php | 2 +- tests/Germany/Bremen/GermanUnityDayTest.php | 2 +- tests/Germany/Bremen/ReformationDay2017Test.php | 2 +- tests/Germany/Bremen/ReformationDayTest.php | 2 +- tests/Germany/ChristmasTest.php | 2 +- tests/Germany/EasterMondayTest.php | 2 +- tests/Germany/GermanUnityDayTest.php | 2 +- tests/Germany/GermanyBaseTestCase.php | 2 +- tests/Germany/GermanyTest.php | 2 +- tests/Germany/GoodFridayTest.php | 2 +- tests/Germany/Hamburg/DayOfReformationTest.php | 2 +- tests/Germany/Hamburg/GermanUnityDay.php | 2 +- tests/Germany/Hamburg/HamburgBaseTestCase.php | 2 +- tests/Germany/Hamburg/HamburgTest.php | 2 +- tests/Germany/Hamburg/ReformationDay2017Test.php | 2 +- tests/Germany/Hesse/CorpusChristiTest.php | 2 +- tests/Germany/Hesse/GermanUnityDayTest.php | 2 +- tests/Germany/Hesse/HesseBaseTestCase.php | 2 +- tests/Germany/Hesse/HesseTest.php | 2 +- tests/Germany/Hesse/ReformationDay2017Test.php | 2 +- tests/Germany/InternationalWorkersDayTest.php | 2 +- tests/Germany/LowerSaxony/GermanUnityDayTest.php | 2 +- tests/Germany/LowerSaxony/LowerSaxonyBaseTestCase.php | 2 +- tests/Germany/LowerSaxony/LowerSaxonyTest.php | 2 +- tests/Germany/LowerSaxony/ReformationDay2017Test.php | 2 +- tests/Germany/LowerSaxony/ReformationDayTest.php | 2 +- .../MecklenburgWesternPomerania/GermanUnityDayTest.php | 2 +- .../MecklenburgWesternPomeraniaBaseTestCase.php | 2 +- .../MecklenburgWesternPomeraniaTest.php | 2 +- .../MecklenburgWesternPomerania/ReformationDayTest.php | 2 +- tests/Germany/NewYearsDayTest.php | 2 +- .../Germany/NorthRhineWestphalia/AllSaintsDayTest.php | 2 +- .../Germany/NorthRhineWestphalia/CorpusChristiTest.php | 2 +- .../NorthRhineWestphalia/GermanUnityDayTest.php | 2 +- .../NorthRhineWestphaliaBaseTestCase.php | 2 +- .../NorthRhineWestphalia/NorthRhineWestphaliaTest.php | 2 +- .../NorthRhineWestphalia/ReformationDay2017Test.php | 2 +- tests/Germany/PentecostMondayTest.php | 2 +- tests/Germany/ReformationDay2017Test.php | 2 +- tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php | 2 +- .../Germany/RhinelandPalatinate/CorpusChristiTest.php | 2 +- .../Germany/RhinelandPalatinate/GermanUnityDayTest.php | 2 +- .../RhinelandPalatinate/ReformationDay2017Test.php | 2 +- .../RhinelandPalatinateBaseTestCase.php | 2 +- .../RhinelandPalatinate/RhinelandPalatinateTest.php | 2 +- tests/Germany/Saarland/AllSaintsDayTest.php | 2 +- tests/Germany/Saarland/AssumptionOfMaryTest.php | 2 +- tests/Germany/Saarland/CorpusChristiTest.php | 2 +- tests/Germany/Saarland/GermanUnityDayTest.php | 2 +- tests/Germany/Saarland/ReformationDay2017Test.php | 2 +- tests/Germany/Saarland/SaarlandBaseTestCase.php | 2 +- tests/Germany/Saarland/SaarlandTest.php | 2 +- tests/Germany/Saxony/GermanUnityDayTest.php | 2 +- tests/Germany/Saxony/ReformationDayTest.php | 2 +- tests/Germany/Saxony/RepentanceAndPrayerDayTest.php | 2 +- tests/Germany/Saxony/SaxonyBaseTestCase.php | 2 +- tests/Germany/Saxony/SaxonyTest.php | 2 +- tests/Germany/SaxonyAnhalt/EpiphanyTest.php | 2 +- tests/Germany/SaxonyAnhalt/GermanUnityDayTest.php | 2 +- tests/Germany/SaxonyAnhalt/ReformationDayTest.php | 2 +- .../Germany/SaxonyAnhalt/SaxonyAnhaltBaseTestCase.php | 2 +- tests/Germany/SaxonyAnhalt/SaxonyAnhaltTest.php | 2 +- tests/Germany/SchleswigHolstein/GermanUnityDayTest.php | 2 +- .../SchleswigHolstein/ReformationDay2017Test.php | 2 +- tests/Germany/SchleswigHolstein/ReformationDayTest.php | 2 +- .../SchleswigHolsteinBaseTestCase.php | 2 +- .../SchleswigHolstein/SchleswigHolsteinTest.php | 2 +- tests/Germany/SecondChristmasDayTest.php | 2 +- tests/Germany/Thuringia/GermanUnityDayTest.php | 2 +- tests/Germany/Thuringia/ReformationDayTest.php | 2 +- tests/Germany/Thuringia/ThuringiaBaseTestCase.php | 2 +- tests/Germany/Thuringia/ThuringiaTest.php | 2 +- tests/Greece/AnnunciationTest.php | 2 +- tests/Greece/AscensionDayTest.php | 2 +- tests/Greece/AssumptionOfMaryTest.php | 2 +- tests/Greece/ChristmasDayTest.php | 2 +- tests/Greece/CleanMondayTest.php | 2 +- tests/Greece/EasterMondayTest.php | 2 +- tests/Greece/EasterTest.php | 2 +- tests/Greece/EpiphanyTest.php | 2 +- tests/Greece/GreeceBaseTestCase.php | 2 +- tests/Greece/GreeceTest.php | 2 +- tests/Greece/IndepencenceDayTest.php | 2 +- tests/Greece/InternationalWorkersDayTest.php | 2 +- tests/Greece/NewYearsDayTest.php | 2 +- tests/Greece/OhiDayTest.php | 2 +- tests/Greece/PentecostMondayTest.php | 2 +- tests/Greece/PentecostTest.php | 2 +- tests/Greece/PolytechnioTest.php | 2 +- tests/Greece/ThreeHolyHierarchsTest.php | 2 +- tests/Greece/goodFridayTest.php | 2 +- tests/Hungary/AllSaintsDayTest.php | 2 +- tests/Hungary/ChristmasTest.php | 2 +- tests/Hungary/EasterMondayTest.php | 2 +- tests/Hungary/EasterTest.php | 2 +- tests/Hungary/HungaryBaseTestCase.php | 2 +- tests/Hungary/HungaryTest.php | 2 +- tests/Hungary/InternationalWorkersDayTest.php | 2 +- tests/Hungary/MemorialDay1848Test.php | 2 +- tests/Hungary/MemorialDay1956Test.php | 2 +- tests/Hungary/NewYearsDayTest.php | 2 +- tests/Hungary/PentecostMondayTest.php | 2 +- tests/Hungary/PentecostTest.php | 2 +- tests/Hungary/SecondChristmasDayTest.php | 2 +- tests/Hungary/StateFoundationDayTest.php | 2 +- tests/Ireland/AugustHolidayTest.php | 2 +- tests/Ireland/ChristmasDayTest.php | 2 +- tests/Ireland/EasterMondayTest.php | 2 +- tests/Ireland/EasterTest.php | 2 +- tests/Ireland/GoodFridayTest.php | 2 +- tests/Ireland/IrelandBaseTestCase.php | 2 +- tests/Ireland/IrelandTest.php | 2 +- tests/Ireland/JuneHolidayTest.php | 2 +- tests/Ireland/MayDayTest.php | 2 +- tests/Ireland/NewYearsDayTest.php | 2 +- tests/Ireland/OctoberHolidayTest.php | 2 +- tests/Ireland/PentecostTest.php | 2 +- tests/Ireland/StPatricksDayTest.php | 2 +- tests/Ireland/StStephensDayTest.php | 2 +- tests/Ireland/pentecostMondayTest.php | 2 +- tests/Italy/AllSaintsDayTest.php | 2 +- tests/Italy/AssumptionOfMaryTest.php | 2 +- tests/Italy/ChristmasTest.php | 2 +- tests/Italy/EasterMondayTest.php | 2 +- tests/Italy/EasterTest.php | 2 +- tests/Italy/EpiphanyTest.php | 2 +- tests/Italy/ImmaculateConceptionTest.php | 2 +- tests/Italy/InternationalWorkersDayTest.php | 2 +- tests/Italy/ItalyBaseTestCase.php | 2 +- tests/Italy/ItalyTest.php | 2 +- tests/Italy/LiberationDayTest.php | 2 +- tests/Italy/NewYearsDayTest.php | 2 +- tests/Italy/RepublicDayTest.php | 2 +- tests/Italy/stStephensDayTest.php | 2 +- tests/Japan/AutumnalEquinoxDayTest.php | 2 +- tests/Japan/ChildrensDayTest.php | 2 +- tests/Japan/ComingOfAgeDayTest.php | 2 +- tests/Japan/ConstitutionMemorialDayTest.php | 2 +- tests/Japan/CoronationDayTest.php | 2 +- tests/Japan/CultureDayTest.php | 2 +- tests/Japan/EmperorsBirthdayTest.php | 2 +- tests/Japan/EnthronementProclamationCeremonyTest.php | 2 +- tests/Japan/GreeneryDayTest.php | 2 +- tests/Japan/JapanBaseTestCase.php | 2 +- tests/Japan/JapanTest.php | 2 +- tests/Japan/LabourThanksgivingDayTest.php | 2 +- tests/Japan/MarineDayTest.php | 2 +- tests/Japan/MountainDayTest.php | 2 +- tests/Japan/NationalFoundationDayTest.php | 2 +- tests/Japan/NewYearsDayTest.php | 2 +- tests/Japan/PublicBridgeDayTest.php | 2 +- tests/Japan/RespectForTheAgedDayTest.php | 2 +- tests/Japan/ShowaDayTest.php | 2 +- tests/Japan/SportsDayTest.php | 2 +- tests/Japan/VernalEquinoxDayTest.php | 2 +- tests/Latvia/ChristmasDayTest.php | 2 +- tests/Latvia/ChristmasEveDayTest.php | 2 +- tests/Latvia/EasterDayTest.php | 2 +- tests/Latvia/EasterMondayDayTest.php | 2 +- tests/Latvia/GoodFridayDayTest.php | 2 +- tests/Latvia/InternationalWorkersDayTest.php | 2 +- tests/Latvia/LatviaBaseTestCase.php | 2 +- tests/Latvia/LatviaTest.php | 2 +- tests/Latvia/MidsummerEveDayTest.php | 2 +- tests/Latvia/NewYearsDayTest.php | 2 +- tests/Latvia/NewYearsEveDayTest.php | 2 +- .../ProclamationOfTheRepublicOfLatviaDayTest.php | 2 +- tests/Latvia/RestorationOfIndependenceDayTest.php | 2 +- tests/Latvia/SecondChristmasDayTest.php | 2 +- tests/Latvia/StJohnsDayTest.php | 2 +- tests/Lithuania/AllSaintsDayTest.php | 2 +- tests/Lithuania/AssumptionOfMaryDayTest.php | 2 +- tests/Lithuania/ChristmasDayTest.php | 2 +- tests/Lithuania/ChristmasEveDayTest.php | 2 +- tests/Lithuania/EasterDayTest.php | 2 +- tests/Lithuania/EasterMondayDayTest.php | 2 +- tests/Lithuania/InternationalWorkersDayTest.php | 2 +- tests/Lithuania/LithuaniaBaseTestCase.php | 2 +- tests/Lithuania/LithuaniaTest.php | 2 +- tests/Lithuania/NewYearsDayTest.php | 2 +- .../RestorationOfIndependenceOfLithuaniaDayTest.php | 2 +- .../RestorationOfTheStateOfLithuaniaDayTest.php | 2 +- tests/Lithuania/SecondChristmasDayTest.php | 2 +- tests/Lithuania/StJohnsDayTest.php | 2 +- tests/Lithuania/StatehoodDayTest.php | 2 +- tests/Netherlands/AscensionDayTest.php | 2 +- tests/Netherlands/AshWednesdayTest.php | 2 +- tests/Netherlands/ChristmasDayTest.php | 2 +- tests/Netherlands/CommemorationDayTest.php | 2 +- tests/Netherlands/EasterMondayTest.php | 2 +- tests/Netherlands/EasterTest.php | 2 +- tests/Netherlands/EpiphanyTest.php | 2 +- tests/Netherlands/FathersDayTest.php | 2 +- tests/Netherlands/GoodFridayTest.php | 2 +- tests/Netherlands/HalloweenTest.php | 2 +- tests/Netherlands/InternationalWorkersDayTest.php | 2 +- tests/Netherlands/KingsDayTest.php | 2 +- tests/Netherlands/LiberationDayTest.php | 2 +- tests/Netherlands/MothersDayTest.php | 2 +- tests/Netherlands/NetherlandsBaseTestCase.php | 2 +- tests/Netherlands/NetherlandsTest.php | 2 +- tests/Netherlands/NewYearsDayTest.php | 2 +- tests/Netherlands/PentecostTest.php | 2 +- tests/Netherlands/QueensDayTest.php | 2 +- tests/Netherlands/SummertimeTest.php | 2 +- tests/Netherlands/ValentinesDayTest.php | 2 +- tests/Netherlands/WintertimeTest.php | 2 +- tests/Netherlands/WorldAnimalDayTest.php | 2 +- tests/Netherlands/carnivalDayTest.php | 2 +- tests/Netherlands/pentecostMondayTest.php | 2 +- tests/Netherlands/princesDayTest.php | 2 +- tests/Netherlands/secondCarnivalDay.php | 2 +- tests/Netherlands/secondChristmasdayTest.php | 2 +- tests/Netherlands/stMartinsDayTest.php | 2 +- tests/Netherlands/stNicholasDayTest.php | 2 +- tests/Netherlands/thirdCarnivalDay.php | 2 +- tests/NewZealand/AnzacDayTest.php | 2 +- tests/NewZealand/BoxingDayTest.php | 2 +- tests/NewZealand/ChristmasDayTest.php | 2 +- tests/NewZealand/DayAfterNewYearsDayTest.php | 2 +- tests/NewZealand/EasterMondayTest.php | 2 +- tests/NewZealand/GoodFridayTest.php | 2 +- tests/NewZealand/LabourDayTest.php | 2 +- tests/NewZealand/NewYearsDayTest.php | 2 +- tests/NewZealand/NewZealandBaseTestCase.php | 2 +- tests/NewZealand/NewZealandTest.php | 2 +- tests/NewZealand/QueensBirthdayTest.php | 2 +- tests/NewZealand/WaitangiDayTest.php | 2 +- tests/Norway/AscensionDayTest.php | 2 +- tests/Norway/ChristmasDayTest.php | 2 +- tests/Norway/ConstitutionDayTest.php | 2 +- tests/Norway/EasterMondayTest.php | 2 +- tests/Norway/EasterTest.php | 2 +- tests/Norway/GoodFridayTest.php | 2 +- tests/Norway/InternationalWorkersDayTest.php | 2 +- tests/Norway/MaundyThursdayTest.php | 2 +- tests/Norway/NewYearsDayTest.php | 2 +- tests/Norway/NorwayBaseTestCase.php | 2 +- tests/Norway/NorwayTest.php | 2 +- tests/Norway/PentecostMondayTest.php | 2 +- tests/Norway/PentecostTest.php | 2 +- tests/Norway/SecondChristmasDayTest.php | 2 +- tests/Poland/AllSaintsDayTest.php | 2 +- tests/Poland/AssumptionOfMaryTest.php | 2 +- tests/Poland/ChristmasTest.php | 2 +- tests/Poland/ConstitutionDayTest.php | 2 +- tests/Poland/CorpusChristiTest.php | 2 +- tests/Poland/EasterMondayTest.php | 2 +- tests/Poland/EasterTest.php | 2 +- tests/Poland/EpiphanyTest.php | 2 +- tests/Poland/IndependenceDayTest.php | 2 +- tests/Poland/InternationalWorkersDayTest.php | 2 +- tests/Poland/NewYearsDayTest.php | 2 +- tests/Poland/PentecostTest.php | 2 +- tests/Poland/PolandBaseTestCase.php | 2 +- tests/Poland/PolandTest.php | 2 +- tests/Poland/SecondChristmasDayTest.php | 2 +- tests/Portugal/AllSaintsDayTest.php | 2 +- tests/Portugal/AssumptionOfMaryTest.php | 2 +- tests/Portugal/CarnationRevolutionDayTest.php | 2 +- tests/Portugal/ChristmasTest.php | 2 +- tests/Portugal/CorpusChristiTest.php | 2 +- tests/Portugal/EasterTest.php | 2 +- tests/Portugal/GoodFridayTest.php | 2 +- tests/Portugal/ImmaculateConceptionTest.php | 2 +- tests/Portugal/InternationalWorkersDayTest.php | 2 +- tests/Portugal/NewYearsDayTest.php | 2 +- tests/Portugal/PortugalBaseTestCase.php | 2 +- tests/Portugal/PortugalDayTest.php | 2 +- tests/Portugal/PortugalTest.php | 2 +- tests/Portugal/PortugueseRepublicDayTest.php | 2 +- tests/Portugal/RestorationOfIndependenceTest.php | 2 +- tests/Romania/AssumptionOfMaryTest.php | 2 +- tests/Romania/ChildrensDayTest.php | 2 +- tests/Romania/ChristmasDayTest.php | 2 +- tests/Romania/ConstantinBrancusiDayTest.php | 2 +- tests/Romania/DayAfterNewYearsDayTest.php | 2 +- tests/Romania/EasterMondayTest.php | 2 +- tests/Romania/EasterTest.php | 2 +- tests/Romania/InternationalWorkersDayTest.php | 2 +- tests/Romania/NationalDayTest.php | 2 +- tests/Romania/NewYearsDayTest.php | 2 +- tests/Romania/PentecostMondayTest.php | 2 +- tests/Romania/PentecostTest.php | 2 +- tests/Romania/RomaniaBaseTestCase.php | 2 +- tests/Romania/RomaniaTest.php | 2 +- tests/Romania/SecondChristmasDayTest.php | 2 +- tests/Romania/StAndrewsDayTest.php | 2 +- tests/Romania/UnitedPrincipalitiesDayTest.php | 2 +- tests/Russia/DefenceOfTheFatherlandDayTest.php | 2 +- tests/Russia/InternationalWomensDayTest.php | 2 +- tests/Russia/NewYearHolidaysDay2Test.php | 2 +- tests/Russia/NewYearHolidaysDay3Test.php | 2 +- tests/Russia/NewYearHolidaysDay4Test.php | 2 +- tests/Russia/NewYearHolidaysDay5Test.php | 2 +- tests/Russia/NewYearHolidaysDay6Test.php | 2 +- tests/Russia/NewYearHolidaysDay8Test.php | 2 +- tests/Russia/NewYearsDayTest.php | 2 +- tests/Russia/OrthodoxChristmasDayTest.php | 2 +- tests/Russia/RussiaBaseTestCase.php | 2 +- tests/Russia/RussiaDayTest.php | 2 +- tests/Russia/RussiaTest.php | 2 +- tests/Russia/SpringAndLabourDayTest.php | 2 +- tests/Russia/UnityDayTest.php | 2 +- tests/Russia/VictoryDayTest.php | 2 +- tests/Slovakia/AllSaintsDayTest.php | 2 +- tests/Slovakia/ChristmasDayTest.php | 2 +- tests/Slovakia/ChristmasEveTest.php | 2 +- tests/Slovakia/EasterMondayTest.php | 2 +- tests/Slovakia/EpiphanyTest.php | 2 +- tests/Slovakia/GoodFridayTest.php | 2 +- tests/Slovakia/InternationalWorkersDayTest.php | 2 +- tests/Slovakia/OurLadyOfSorrowsDayTest.php | 2 +- tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php | 2 +- tests/Slovakia/SecondChristmasDayTest.php | 2 +- tests/Slovakia/SlovakConstitutionDayTest.php | 2 +- tests/Slovakia/SlovakIndependeceDayTest.php | 2 +- tests/Slovakia/SlovakNationalUprisingDayTest.php | 2 +- tests/Slovakia/SlovakiaBaseTestCase.php | 2 +- tests/Slovakia/SlovakiaTest.php | 2 +- .../Slovakia/StruggleForFreedomAndDemocracyDayTest.php | 2 +- tests/Slovakia/VictoryInEuropeDayTest.php | 2 +- tests/SouthAfrica/ChristmasDayTest.php | 2 +- tests/SouthAfrica/FamilyDayTest.php | 2 +- tests/SouthAfrica/FreedomDayTest.php | 2 +- tests/SouthAfrica/GoodFridayTest.php | 2 +- tests/SouthAfrica/HeritageDayTest.php | 2 +- tests/SouthAfrica/HumanRightsDayTest.php | 2 +- tests/SouthAfrica/MunicipalElections2016DayTest.php | 2 +- tests/SouthAfrica/NationalWomensDayTest.php | 2 +- tests/SouthAfrica/NewYearsDayTest.php | 2 +- tests/SouthAfrica/ReconciliationDayTest.php | 2 +- tests/SouthAfrica/SecondChristmasDayTest.php | 2 +- tests/SouthAfrica/SouthAfricaBaseTestCase.php | 2 +- tests/SouthAfrica/SouthAfricaTest.php | 2 +- tests/SouthAfrica/SubstituteDayOfGoodwillTest.php | 2 +- tests/SouthAfrica/WorkersDayTest.php | 2 +- tests/SouthAfrica/YouthDayTest.php | 2 +- tests/SouthKorea/ArborDayTest.php | 2 +- tests/SouthKorea/ArmedForcesDayTest.php | 2 +- tests/SouthKorea/BuddhasBirthdayTest.php | 2 +- tests/SouthKorea/ChildrensDayTest.php | 2 +- tests/SouthKorea/ChristmasDayTest.php | 2 +- tests/SouthKorea/ChuseokTest.php | 2 +- tests/SouthKorea/ConstitutionDayTest.php | 2 +- tests/SouthKorea/GaecheonjeolTest.php | 2 +- tests/SouthKorea/HangulDayTest.php | 2 +- tests/SouthKorea/IndependenceMovementDayTest.php | 2 +- tests/SouthKorea/LiberationDayTest.php | 2 +- tests/SouthKorea/MemorialDayTest.php | 2 +- tests/SouthKorea/NewYearsDayTest.php | 2 +- tests/SouthKorea/SeollalTest.php | 2 +- tests/SouthKorea/SouthKoreaBaseTestCase.php | 2 +- tests/SouthKorea/SouthKoreaTest.php | 2 +- tests/Spain/AllSaintsDayTest.php | 2 +- tests/Spain/Andalusia/AndalusiaBaseTestCase.php | 2 +- tests/Spain/Andalusia/AndalusiaDayTest.php | 2 +- tests/Spain/Andalusia/AndalusiaTest.php | 2 +- tests/Spain/Aragon/AragonBaseTestCase.php | 2 +- tests/Spain/Aragon/AragonTest.php | 2 +- tests/Spain/Aragon/StGeorgesDayTest.php | 2 +- tests/Spain/AssumptionOfMaryTest.php | 2 +- tests/Spain/Asturias/AsturiasBaseTestCase.php | 2 +- tests/Spain/Asturias/AsturiasDayTest.php | 2 +- tests/Spain/Asturias/AsturiasTest.php | 2 +- .../BalearicIslands/BalearicIslandsBaseTestCase.php | 2 +- tests/Spain/BalearicIslands/BalearicIslandsDayTest.php | 2 +- tests/Spain/BalearicIslands/BalearicIslandsTest.php | 2 +- .../Spain/BasqueCountry/BasqueCountryBaseTestCase.php | 2 +- tests/Spain/BasqueCountry/BasqueCountryDayTest.php | 2 +- tests/Spain/BasqueCountry/BasqueCountryTest.php | 2 +- .../Spain/CanaryIslands/CanaryIslandsBaseTestCase.php | 2 +- tests/Spain/CanaryIslands/CanaryIslandsDayTest.php | 2 +- tests/Spain/CanaryIslands/CanaryIslandsTest.php | 2 +- tests/Spain/Cantabria/CantabriaBaseTestCase.php | 2 +- tests/Spain/Cantabria/CantabriaDayTest.php | 2 +- tests/Spain/Cantabria/CantabriaTest.php | 2 +- .../CastileAndLeon/CastileAndLeonBaseTestCase.php | 2 +- tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php | 2 +- tests/Spain/CastileAndLeon/CastileAndLeonTest.php | 2 +- .../CastillaLaMancha/CastillaLaManchaBaseTestCase.php | 2 +- .../Spain/CastillaLaMancha/CastillaLaManchaDayTest.php | 2 +- tests/Spain/CastillaLaMancha/CastillaLaManchaTest.php | 2 +- tests/Spain/Catalonia/CataloniaBaseTestCase.php | 2 +- tests/Spain/Catalonia/CataloniaTest.php | 2 +- tests/Spain/Catalonia/nationalCataloniaDayTest.php | 2 +- tests/Spain/Catalonia/stJohnsDayTest.php | 2 +- tests/Spain/Ceuta/CeutaBaseTestCase.php | 2 +- tests/Spain/Ceuta/CeutaTest.php | 2 +- tests/Spain/Ceuta/ceutaDayTest.php | 2 +- tests/Spain/ChristmasTest.php | 2 +- .../CommunityOfMadridBaseTestCase.php | 2 +- .../Spain/CommunityOfMadrid/CommunityOfMadridTest.php | 2 +- .../CommunityOfMadrid/DosdeMayoUprisingDayTest.php | 2 +- tests/Spain/ConstitutionDayTest.php | 2 +- tests/Spain/EasterMondayTest.php | 2 +- tests/Spain/EpiphanyTest.php | 2 +- tests/Spain/Extremadura/ExtremaduraBaseTestCase.php | 2 +- tests/Spain/Extremadura/ExtremaduraDayTest.php | 2 +- tests/Spain/Extremadura/ExtremaduraTest.php | 2 +- tests/Spain/Galicia/GaliciaBaseTestCase.php | 2 +- tests/Spain/Galicia/GaliciaTest.php | 2 +- tests/Spain/Galicia/GalicianLiteratureDayTest.php | 2 +- tests/Spain/Galicia/stJamesDayTest.php | 2 +- tests/Spain/GoodFridayTest.php | 2 +- tests/Spain/ImmaculateConceptionTest.php | 2 +- tests/Spain/InternationalWorkersDayTest.php | 2 +- tests/Spain/LaRioja/LaRiojaBaseTestCase.php | 2 +- tests/Spain/LaRioja/LaRiojaDayTest.php | 2 +- tests/Spain/LaRioja/LaRiojaTest.php | 2 +- tests/Spain/MaundyThursdayTest.php | 2 +- tests/Spain/Melilla/MelillaBaseTestCase.php | 2 +- tests/Spain/Melilla/MelillaTest.php | 2 +- tests/Spain/NationalDayTest.php | 2 +- tests/Spain/Navarre/NavarreBaseTestCase.php | 2 +- tests/Spain/Navarre/NavarreTest.php | 2 +- tests/Spain/NewYearsDayTest.php | 2 +- .../RegionOfMurcia/RegionOfMurciaBaseTestCase.php | 2 +- tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php | 2 +- tests/Spain/RegionOfMurcia/RegionOfMurciaTest.php | 2 +- tests/Spain/SpainBaseTestCase.php | 2 +- tests/Spain/SpainTest.php | 2 +- .../ValencianCommunityBaseTestCase.php | 2 +- .../ValencianCommunity/ValencianCommunityDayTest.php | 2 +- .../ValencianCommunity/ValencianCommunityTest.php | 2 +- tests/Spain/ValentinesDayTest.php | 2 +- tests/Spain/stJosephsDayTest.php | 2 +- tests/Sweden/AllSaintsDayTest.php | 2 +- tests/Sweden/AllSaintsEveTest.php | 2 +- tests/Sweden/AscensionDayTest.php | 2 +- tests/Sweden/ChristmasDayTest.php | 2 +- tests/Sweden/ChristmasEveTest.php | 2 +- tests/Sweden/EasterMondayTest.php | 2 +- tests/Sweden/EasterTest.php | 2 +- tests/Sweden/EpiphanyEveTest.php | 2 +- tests/Sweden/EpiphanyTest.php | 2 +- tests/Sweden/GoodFridayTest.php | 2 +- tests/Sweden/InternationalWorkersDayTest.php | 2 +- tests/Sweden/NationalDayTest.php | 2 +- tests/Sweden/NewYearsDayTest.php | 2 +- tests/Sweden/NewYearsEveTest.php | 2 +- tests/Sweden/PentecostTest.php | 2 +- tests/Sweden/SecondChristmasDayTest.php | 2 +- tests/Sweden/StJohnsDayTest.php | 2 +- tests/Sweden/StJohnsEveTest.php | 2 +- tests/Sweden/SwedenBaseTestCase.php | 2 +- tests/Sweden/SwedenTest.php | 2 +- tests/Sweden/WalpurgisEveTest.php | 2 +- tests/Switzerland/Aargau/AargauBaseTestCase.php | 2 +- tests/Switzerland/Aargau/AargauTest.php | 2 +- tests/Switzerland/Aargau/AscensionDayTest.php | 2 +- tests/Switzerland/Aargau/ChristmasDayTest.php | 2 +- tests/Switzerland/Aargau/GoodFridayTest.php | 2 +- tests/Switzerland/Aargau/NewYearsDayTest.php | 2 +- .../AppenzellAusserrhodenBaseTestCase.php | 2 +- .../AppenzellAusserrhodenTest.php | 2 +- .../AppenzellAusserrhoden/AscensionDayTest.php | 2 +- .../AppenzellAusserrhoden/ChristmasDayTest.php | 2 +- .../AppenzellAusserrhoden/EasterMondayTest.php | 2 +- .../AppenzellAusserrhoden/GoodFridayTest.php | 2 +- .../AppenzellAusserrhoden/NewYearsDayTest.php | 2 +- .../AppenzellAusserrhoden/PentecostMondayTest.php | 2 +- .../AppenzellAusserrhoden/StStephensDayTest.php | 2 +- .../AppenzellInnerrhoden/AllSaintsDayTest.php | 2 +- .../AppenzellInnerrhodenBaseTestCase.php | 2 +- .../AppenzellInnerrhoden/AppenzellInnerrhodenTest.php | 2 +- .../AppenzellInnerrhoden/AscensionDayTest.php | 2 +- .../AppenzellInnerrhoden/AssumptionOfMaryTest.php | 2 +- .../AppenzellInnerrhoden/ChristmasDayTest.php | 2 +- .../AppenzellInnerrhoden/CorpusChristiTest.php | 2 +- .../AppenzellInnerrhoden/EasterMondayTest.php | 2 +- .../AppenzellInnerrhoden/GoodFridayTest.php | 2 +- .../AppenzellInnerrhoden/ImmaculateConceptionTest.php | 2 +- .../AppenzellInnerrhoden/NewYearsDayTest.php | 2 +- .../AppenzellInnerrhoden/PentecostMondayTest.php | 2 +- .../AppenzellInnerrhoden/StStephensDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/AscensionDayTest.php | 2 +- .../BaselLandschaft/BaselLandschaftBaseTestCase.php | 2 +- .../BaselLandschaft/BaselLandschaftTest.php | 2 +- tests/Switzerland/BaselLandschaft/ChristmasDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/EasterMondayTest.php | 2 +- tests/Switzerland/BaselLandschaft/GoodFridayTest.php | 2 +- tests/Switzerland/BaselLandschaft/NewYearsDayTest.php | 2 +- .../BaselLandschaft/PentecostMondayTest.php | 2 +- .../Switzerland/BaselLandschaft/StStephensDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/WorkersDayTest.php | 2 +- tests/Switzerland/BaselStadt/AscensionDayTest.php | 2 +- .../Switzerland/BaselStadt/BaselStadtBaseTestCase.php | 2 +- tests/Switzerland/BaselStadt/BaselStadtTest.php | 2 +- tests/Switzerland/BaselStadt/ChristmasDayTest.php | 2 +- tests/Switzerland/BaselStadt/EasterMondayTest.php | 2 +- tests/Switzerland/BaselStadt/GoodFridayTest.php | 2 +- tests/Switzerland/BaselStadt/NewYearsDayTest.php | 2 +- tests/Switzerland/BaselStadt/PentecostMondayTest.php | 2 +- tests/Switzerland/BaselStadt/StStephensDayTest.php | 2 +- tests/Switzerland/BaselStadt/WorkersDayTest.php | 2 +- tests/Switzerland/Bern/AscensionDayTest.php | 2 +- tests/Switzerland/Bern/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Bern/BernBaseTestCase.php | 2 +- tests/Switzerland/Bern/BernTest.php | 2 +- tests/Switzerland/Bern/ChristmasDayTest.php | 2 +- tests/Switzerland/Bern/EasterMondayTest.php | 2 +- tests/Switzerland/Bern/GoodFridayTest.php | 2 +- tests/Switzerland/Bern/NewYearsDayTest.php | 2 +- tests/Switzerland/Bern/PentecostMondayTest.php | 2 +- tests/Switzerland/Bern/StStephensDayTest.php | 2 +- tests/Switzerland/Fribourg/AscensionDayTest.php | 2 +- tests/Switzerland/Fribourg/ChristmasDayTest.php | 2 +- tests/Switzerland/Fribourg/EasterMondayTest.php | 2 +- tests/Switzerland/Fribourg/FribourgBaseTestCase.php | 2 +- tests/Switzerland/Fribourg/FribourgTest.php | 2 +- tests/Switzerland/Fribourg/GoodFridayTest.php | 2 +- tests/Switzerland/Fribourg/NewYearsDayTest.php | 2 +- tests/Switzerland/Fribourg/PentecostMondayTest.php | 2 +- tests/Switzerland/Geneva/AscensionDayTest.php | 2 +- tests/Switzerland/Geneva/ChristmasDayTest.php | 2 +- tests/Switzerland/Geneva/EasterMondayTest.php | 2 +- tests/Switzerland/Geneva/GenevaBaseTestCase.php | 2 +- tests/Switzerland/Geneva/GenevaTest.php | 2 +- tests/Switzerland/Geneva/GoodFridayTest.php | 2 +- tests/Switzerland/Geneva/JeuneGenevoisTest.php | 2 +- tests/Switzerland/Geneva/NewYearsDayTest.php | 2 +- tests/Switzerland/Geneva/PentecostMondayTest.php | 2 +- tests/Switzerland/Geneva/RestaurationGenevoiseTest.php | 2 +- tests/Switzerland/Glarus/AllSaintsDayTest.php | 2 +- tests/Switzerland/Glarus/AscensionDayTest.php | 2 +- tests/Switzerland/Glarus/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Glarus/ChristmasDayTest.php | 2 +- tests/Switzerland/Glarus/EasterMondayTest.php | 2 +- tests/Switzerland/Glarus/GlarusBaseTestCase.php | 2 +- tests/Switzerland/Glarus/GlarusTest.php | 2 +- tests/Switzerland/Glarus/GoodFridayTest.php | 2 +- tests/Switzerland/Glarus/NafelserFahrtTest.php | 2 +- tests/Switzerland/Glarus/NewYearsDayTest.php | 2 +- tests/Switzerland/Glarus/PentecostMondayTest.php | 2 +- tests/Switzerland/Glarus/StStephensDayTest.php | 2 +- tests/Switzerland/Grisons/AscensionDayTest.php | 2 +- tests/Switzerland/Grisons/ChristmasDayTest.php | 2 +- tests/Switzerland/Grisons/EasterMondayTest.php | 2 +- tests/Switzerland/Grisons/GoodFridayTest.php | 2 +- tests/Switzerland/Grisons/GrisonsBaseTestCase.php | 2 +- tests/Switzerland/Grisons/GrisonsTest.php | 2 +- tests/Switzerland/Grisons/NewYearsDayTest.php | 2 +- tests/Switzerland/Grisons/PentecostMondayTest.php | 2 +- tests/Switzerland/Grisons/StStephensDayTest.php | 2 +- tests/Switzerland/Jura/AllSaintsDayTest.php | 2 +- tests/Switzerland/Jura/AscensionDayTest.php | 2 +- tests/Switzerland/Jura/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Jura/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Jura/ChristmasDayTest.php | 2 +- tests/Switzerland/Jura/CorpusChristiTest.php | 2 +- tests/Switzerland/Jura/EasterMondayTest.php | 2 +- tests/Switzerland/Jura/GoodFridayTest.php | 2 +- tests/Switzerland/Jura/JuraBaseTestCase.php | 2 +- tests/Switzerland/Jura/JuraTest.php | 2 +- tests/Switzerland/Jura/NewYearsDayTest.php | 2 +- tests/Switzerland/Jura/PentecostMondayTest.php | 2 +- tests/Switzerland/Jura/PlebisciteJurassienTest.php | 2 +- tests/Switzerland/Jura/WorkersDayTest.php | 2 +- tests/Switzerland/Lucerne/AllSaintsDayTest.php | 2 +- tests/Switzerland/Lucerne/AscensionDayTest.php | 2 +- tests/Switzerland/Lucerne/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Lucerne/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Lucerne/ChristmasDayTest.php | 2 +- tests/Switzerland/Lucerne/CorpusChristiTest.php | 2 +- tests/Switzerland/Lucerne/EasterMondayTest.php | 2 +- tests/Switzerland/Lucerne/GoodFridayTest.php | 2 +- tests/Switzerland/Lucerne/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Lucerne/LucerneBaseTestCase.php | 2 +- tests/Switzerland/Lucerne/LucerneTest.php | 2 +- tests/Switzerland/Lucerne/NewYearsDayTest.php | 2 +- tests/Switzerland/Lucerne/PentecostMondayTest.php | 2 +- tests/Switzerland/Lucerne/StStephensDayTest.php | 2 +- tests/Switzerland/Neuchatel/AscensionDayTest.php | 2 +- tests/Switzerland/Neuchatel/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Neuchatel/BettagsMontagTest.php | 2 +- tests/Switzerland/Neuchatel/ChristmasDayTest.php | 2 +- tests/Switzerland/Neuchatel/EasterMondayTest.php | 2 +- tests/Switzerland/Neuchatel/GoodFridayTest.php | 2 +- .../Neuchatel/InstaurationRepubliqueTest.php | 2 +- tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php | 2 +- tests/Switzerland/Neuchatel/NeuchatelTest.php | 2 +- tests/Switzerland/Neuchatel/NewYearsDayTest.php | 2 +- tests/Switzerland/Neuchatel/PentecostMondayTest.php | 2 +- tests/Switzerland/Neuchatel/WorkersDayTest.php | 2 +- tests/Switzerland/Nidwalden/AllSaintsDayTest.php | 2 +- tests/Switzerland/Nidwalden/AscensionDayTest.php | 2 +- tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Nidwalden/ChristmasDayTest.php | 2 +- tests/Switzerland/Nidwalden/CorpusChristiTest.php | 2 +- tests/Switzerland/Nidwalden/EasterMondayTest.php | 2 +- tests/Switzerland/Nidwalden/GoodFridayTest.php | 2 +- .../Switzerland/Nidwalden/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Nidwalden/NewYearsDayTest.php | 2 +- tests/Switzerland/Nidwalden/NidwaldenBaseTestCase.php | 2 +- tests/Switzerland/Nidwalden/NidwaldenTest.php | 2 +- tests/Switzerland/Nidwalden/PentecostMondayTest.php | 2 +- tests/Switzerland/Nidwalden/StJosephDayTest.php | 2 +- tests/Switzerland/Nidwalden/StStephensDayTest.php | 2 +- tests/Switzerland/Obwalden/AllSaintsDayTest.php | 2 +- tests/Switzerland/Obwalden/AscensionDayTest.php | 2 +- tests/Switzerland/Obwalden/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Obwalden/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Obwalden/BruderKlausenFestTest.php | 2 +- tests/Switzerland/Obwalden/ChristmasDayTest.php | 2 +- tests/Switzerland/Obwalden/CorpusChristiTest.php | 2 +- tests/Switzerland/Obwalden/EasterMondayTest.php | 2 +- tests/Switzerland/Obwalden/GoodFridayTest.php | 2 +- .../Switzerland/Obwalden/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Obwalden/NewYearsDayTest.php | 2 +- tests/Switzerland/Obwalden/ObwaldenBaseTestCase.php | 2 +- tests/Switzerland/Obwalden/ObwaldenTest.php | 2 +- tests/Switzerland/Obwalden/PentecostMondayTest.php | 2 +- tests/Switzerland/Obwalden/StStephensDayTest.php | 2 +- tests/Switzerland/Schaffhausen/AscensionDayTest.php | 2 +- tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Schaffhausen/ChristmasDayTest.php | 2 +- tests/Switzerland/Schaffhausen/EasterMondayTest.php | 2 +- tests/Switzerland/Schaffhausen/GoodFridayTest.php | 2 +- tests/Switzerland/Schaffhausen/NewYearsDayTest.php | 2 +- tests/Switzerland/Schaffhausen/PentecostMondayTest.php | 2 +- .../Schaffhausen/SchaffhausenBaseTestCase.php | 2 +- tests/Switzerland/Schaffhausen/SchaffhausenTest.php | 2 +- tests/Switzerland/Schaffhausen/StStephensDayTest.php | 2 +- tests/Switzerland/Schaffhausen/WorkersDayTest.php | 2 +- tests/Switzerland/Schwyz/AllSaintsDayTest.php | 2 +- tests/Switzerland/Schwyz/AscensionDayTest.php | 2 +- tests/Switzerland/Schwyz/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Schwyz/ChristmasDayTest.php | 2 +- tests/Switzerland/Schwyz/CorpusChristiTest.php | 2 +- tests/Switzerland/Schwyz/EasterMondayTest.php | 2 +- tests/Switzerland/Schwyz/EpiphanyTest.php | 2 +- tests/Switzerland/Schwyz/GoodFridayTest.php | 2 +- tests/Switzerland/Schwyz/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Schwyz/NewYearsDayTest.php | 2 +- tests/Switzerland/Schwyz/PentecostMondayTest.php | 2 +- tests/Switzerland/Schwyz/SchwyzBaseTestCase.php | 2 +- tests/Switzerland/Schwyz/SchwyzTest.php | 2 +- tests/Switzerland/Schwyz/StJosephDayTest.php | 2 +- tests/Switzerland/Schwyz/StStephensDayTest.php | 2 +- tests/Switzerland/Solothurn/AscensionDayTest.php | 2 +- tests/Switzerland/Solothurn/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Solothurn/ChristmasDayTest.php | 2 +- tests/Switzerland/Solothurn/GoodFridayTest.php | 2 +- tests/Switzerland/Solothurn/NewYearsDayTest.php | 2 +- tests/Switzerland/Solothurn/SolothurnBaseTestCase.php | 2 +- tests/Switzerland/Solothurn/SolothurnTest.php | 2 +- tests/Switzerland/StGallen/AllSaintsDayTest.php | 2 +- tests/Switzerland/StGallen/AscensionDayTest.php | 2 +- tests/Switzerland/StGallen/ChristmasDayTest.php | 2 +- tests/Switzerland/StGallen/EasterMondayTest.php | 2 +- tests/Switzerland/StGallen/GoodFridayTest.php | 2 +- tests/Switzerland/StGallen/NewYearsDayTest.php | 2 +- tests/Switzerland/StGallen/PentecostMondayTest.php | 2 +- tests/Switzerland/StGallen/StGallenBaseTestCase.php | 2 +- tests/Switzerland/StGallen/StGallenTest.php | 2 +- tests/Switzerland/StGallen/StStephensDayTest.php | 2 +- tests/Switzerland/SwissNationalDayTest.php | 2 +- tests/Switzerland/SwitzerlandBaseTestCase.php | 2 +- tests/Switzerland/SwitzerlandTest.php | 2 +- tests/Switzerland/Thurgau/AscensionDayTest.php | 2 +- tests/Switzerland/Thurgau/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Thurgau/ChristmasDayTest.php | 2 +- tests/Switzerland/Thurgau/EasterMondayTest.php | 2 +- tests/Switzerland/Thurgau/GoodFridayTest.php | 2 +- tests/Switzerland/Thurgau/NewYearsDayTest.php | 2 +- tests/Switzerland/Thurgau/PentecostMondayTest.php | 2 +- tests/Switzerland/Thurgau/StStephensDayTest.php | 2 +- tests/Switzerland/Thurgau/ThurgauBaseTestCase.php | 2 +- tests/Switzerland/Thurgau/ThurgauTest.php | 2 +- tests/Switzerland/Thurgau/WorkersDayTest.php | 2 +- tests/Switzerland/Ticino/AllSaintsDayTest.php | 2 +- tests/Switzerland/Ticino/AscensionDayTest.php | 2 +- tests/Switzerland/Ticino/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Ticino/ChristmasDayTest.php | 2 +- tests/Switzerland/Ticino/CorpusChristiTest.php | 2 +- tests/Switzerland/Ticino/EasterMondayTest.php | 2 +- tests/Switzerland/Ticino/EpiphanyTest.php | 2 +- tests/Switzerland/Ticino/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Ticino/NewYearsDayTest.php | 2 +- tests/Switzerland/Ticino/PentecostMondayTest.php | 2 +- tests/Switzerland/Ticino/StJosephDayTest.php | 2 +- tests/Switzerland/Ticino/StPeterPaulTest.php | 2 +- tests/Switzerland/Ticino/StStephensDayTest.php | 2 +- tests/Switzerland/Ticino/TicinoBaseTestCase.php | 2 +- tests/Switzerland/Ticino/TicinoTest.php | 2 +- tests/Switzerland/Ticino/WorkersDayTest.php | 2 +- tests/Switzerland/Uri/AllSaintsDayTest.php | 2 +- tests/Switzerland/Uri/AscensionDayTest.php | 2 +- tests/Switzerland/Uri/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Uri/ChristmasDayTest.php | 2 +- tests/Switzerland/Uri/CorpusChristiTest.php | 2 +- tests/Switzerland/Uri/EasterMondayTest.php | 2 +- tests/Switzerland/Uri/EpiphanyTest.php | 2 +- tests/Switzerland/Uri/GoodFridayTest.php | 2 +- tests/Switzerland/Uri/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Uri/NewYearsDayTest.php | 2 +- tests/Switzerland/Uri/PentecostMondayTest.php | 2 +- tests/Switzerland/Uri/StJosephDayTest.php | 2 +- tests/Switzerland/Uri/StStephensDayTest.php | 2 +- tests/Switzerland/Uri/UriBaseTestCase.php | 2 +- tests/Switzerland/Uri/UriTest.php | 2 +- tests/Switzerland/Valais/AllSaintsDayTest.php | 2 +- tests/Switzerland/Valais/AscensionDayTest.php | 2 +- tests/Switzerland/Valais/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Valais/ChristmasDayTest.php | 2 +- tests/Switzerland/Valais/CorpusChristiTest.php | 2 +- tests/Switzerland/Valais/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Valais/NewYearsDayTest.php | 2 +- tests/Switzerland/Valais/StJosephDayTest.php | 2 +- tests/Switzerland/Valais/ValaisBaseTestCase.php | 2 +- tests/Switzerland/Valais/ValaisTest.php | 2 +- tests/Switzerland/Vaud/AscensionDayTest.php | 2 +- tests/Switzerland/Vaud/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Vaud/BettagsMontagTest.php | 2 +- tests/Switzerland/Vaud/ChristmasDayTest.php | 2 +- tests/Switzerland/Vaud/EasterMondayTest.php | 2 +- tests/Switzerland/Vaud/GoodFridayTest.php | 2 +- tests/Switzerland/Vaud/NewYearsDayTest.php | 2 +- tests/Switzerland/Vaud/PentecostMondayTest.php | 2 +- tests/Switzerland/Vaud/VaudBaseTestCase.php | 2 +- tests/Switzerland/Vaud/VaudTest.php | 2 +- tests/Switzerland/Zug/AllSaintsDayTest.php | 2 +- tests/Switzerland/Zug/AscensionDayTest.php | 2 +- tests/Switzerland/Zug/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Zug/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Zug/ChristmasDayTest.php | 2 +- tests/Switzerland/Zug/CorpusChristiTest.php | 2 +- tests/Switzerland/Zug/EasterMondayTest.php | 2 +- tests/Switzerland/Zug/GoodFridayTest.php | 2 +- tests/Switzerland/Zug/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Zug/NewYearsDayTest.php | 2 +- tests/Switzerland/Zug/PentecostMondayTest.php | 2 +- tests/Switzerland/Zug/StStephensDayTest.php | 2 +- tests/Switzerland/Zug/ZugBaseTestCase.php | 2 +- tests/Switzerland/Zug/ZugTest.php | 2 +- tests/Switzerland/Zurich/AscensionDayTest.php | 2 +- tests/Switzerland/Zurich/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Zurich/ChristmasDayTest.php | 2 +- tests/Switzerland/Zurich/EasterMondayTest.php | 2 +- tests/Switzerland/Zurich/GoodFridayTest.php | 2 +- tests/Switzerland/Zurich/NewYearsDayTest.php | 2 +- tests/Switzerland/Zurich/PentecostMondayTest.php | 2 +- tests/Switzerland/Zurich/StStephensDayTest.php | 2 +- tests/Switzerland/Zurich/WorkersDayTest.php | 2 +- tests/Switzerland/Zurich/ZurichBaseTestCase.php | 2 +- tests/Switzerland/Zurich/ZurichTest.php | 2 +- tests/USA/ChristmasDayTest.php | 2 +- tests/USA/ColumbusDayTest.php | 2 +- tests/USA/IndependenceDayTest.php | 2 +- tests/USA/LabourDayTest.php | 2 +- tests/USA/MartinLutherKingDayTest.php | 2 +- tests/USA/MemorialDayTest.php | 2 +- tests/USA/NewYearsDayTest.php | 2 +- tests/USA/ThanksgivingDayTest.php | 2 +- tests/USA/USABaseTestCase.php | 2 +- tests/USA/USATest.php | 2 +- tests/USA/VeteransDayTest.php | 2 +- tests/USA/WashingtonsBirthdayTest.php | 2 +- tests/Ukraine/ChristmasDayTest.php | 2 +- tests/Ukraine/ConstitutionDayTest.php | 2 +- tests/Ukraine/DefenderOfUkraineDayTest.php | 2 +- tests/Ukraine/EasterTest.php | 2 +- tests/Ukraine/IndependenceDayTest.php | 2 +- tests/Ukraine/InternationalWomensDayTest.php | 2 +- tests/Ukraine/InternationalWorkersDayTest.php | 2 +- tests/Ukraine/NewYearsDayTest.php | 2 +- tests/Ukraine/PentecostTest.php | 2 +- tests/Ukraine/SecondInternationalWorkersDayTest.php | 2 +- tests/Ukraine/UkraineBaseTestCase.php | 2 +- tests/Ukraine/UkraineTest.php | 2 +- tests/Ukraine/VictoryDayTest.php | 2 +- tests/UnitedKingdom/BoxingDayTest.php | 2 +- tests/UnitedKingdom/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/EasterMondayTest.php | 2 +- tests/UnitedKingdom/England/BoxingDayTest.php | 2 +- tests/UnitedKingdom/England/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/England/EasterMondayTest.php | 2 +- tests/UnitedKingdom/England/EnglandBaseTestCase.php | 2 +- tests/UnitedKingdom/England/EnglandTest.php | 2 +- tests/UnitedKingdom/England/GoodFridayTest.php | 2 +- tests/UnitedKingdom/England/MayDayBankHolidayTest.php | 2 +- tests/UnitedKingdom/England/NewYearsDayTest.php | 2 +- tests/UnitedKingdom/England/SpringBankHolidayTest.php | 2 +- tests/UnitedKingdom/England/SummerBankHolidayTest.php | 2 +- tests/UnitedKingdom/GoodFridayTest.php | 2 +- tests/UnitedKingdom/MayDayBankHolidayTest.php | 2 +- tests/UnitedKingdom/NewYearsDayTest.php | 2 +- .../NorthernIreland/BattleOfTheBoyneTest.php | 2 +- tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php | 2 +- .../UnitedKingdom/NorthernIreland/ChristmasDayTest.php | 2 +- .../UnitedKingdom/NorthernIreland/EasterMondayTest.php | 2 +- tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php | 2 +- .../NorthernIreland/MayDayBankHolidayTest.php | 2 +- .../UnitedKingdom/NorthernIreland/NewYearsDayTest.php | 2 +- .../NorthernIreland/NorthernIrelandBaseTestCase.php | 2 +- .../NorthernIreland/NorthernIrelandTest.php | 2 +- .../NorthernIreland/SpringBankHolidayTest.php | 2 +- .../NorthernIreland/StPatricksDayTest.php | 2 +- .../NorthernIreland/SummerBankHolidayTest.php | 2 +- tests/UnitedKingdom/Scotland/BoxingDayTest.php | 2 +- tests/UnitedKingdom/Scotland/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/Scotland/GoodFridayTest.php | 2 +- tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php | 2 +- tests/UnitedKingdom/Scotland/NewYearsDayTest.php | 2 +- tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php | 2 +- tests/UnitedKingdom/Scotland/ScotlandTest.php | 2 +- tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php | 2 +- tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php | 2 +- tests/UnitedKingdom/Scotland/StAndrewsDayTest.php | 2 +- tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php | 2 +- tests/UnitedKingdom/SpringBankHolidayTest.php | 2 +- tests/UnitedKingdom/SummerBankHolidayTest.php | 2 +- tests/UnitedKingdom/UnitedKingdomBaseTestCase.php | 2 +- tests/UnitedKingdom/UnitedKingdomTest.php | 2 +- tests/UnitedKingdom/Wales/BoxingDayTest.php | 2 +- tests/UnitedKingdom/Wales/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/Wales/EasterMondayTest.php | 2 +- tests/UnitedKingdom/Wales/GoodFridayTest.php | 2 +- tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php | 2 +- tests/UnitedKingdom/Wales/NewYearsDayTest.php | 2 +- tests/UnitedKingdom/Wales/SpringBankHolidayTest.php | 2 +- tests/UnitedKingdom/Wales/SummerBankHolidayTest.php | 2 +- tests/UnitedKingdom/Wales/WalesBaseTestCase.php | 2 +- tests/UnitedKingdom/Wales/WalesTest.php | 2 +- tests/YasumiBase.php | 2 +- tests/YasumiTestCaseInterface.php | 2 +- 1485 files changed, 1489 insertions(+), 1489 deletions(-) diff --git a/.php_cs b/.php_cs index 231c3b0a2..81169b11a 100644 --- a/.php_cs +++ b/.php_cs @@ -2,7 +2,7 @@ /** * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2019 AzuyaLabs + * Copyright (c) 2015 - 2020 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/LICENSE b/LICENSE index 9ffbc6f6b..0408169d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 - 2019 AzuyaLabs +Copyright (c) 2015 - 2020 AzuyaLabs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/phpunit.xml b/phpunit.xml index 7cbade3eb..aa3aca34c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,13 @@ Date: Thu, 2 Jan 2020 05:13:18 +0100 Subject: [PATCH 036/115] Added fr translation for Second Christmas Day (#188) --- src/Yasumi/data/translations/secondChristmasDay.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php index acbdd092e..763cb84c1 100755 --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -23,6 +23,7 @@ 'en_ZA' => 'Day of Goodwill', 'et' => 'Teine Jõulupüha', 'fi' => '2. joulupäivä', + 'fr' => 'Lendemain de Noël', 'hu' => 'Karácsony másnapja', 'ko' => '성탄절 연휴', 'lt' => 'Kalėdos (antra diena)', From b011860a9d28d682cdf001b09ff7b5f867384d68 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Thu, 2 Jan 2020 05:22:45 +0100 Subject: [PATCH 037/115] Add Catalan translations (#189) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Spain.php | 10 ++++++++-- src/Yasumi/Provider/Spain/BalearicIslands.php | 5 ++++- src/Yasumi/Provider/Spain/Catalonia.php | 5 ++++- src/Yasumi/Provider/Spain/ValencianCommunity.php | 12 +++++++++--- src/Yasumi/data/translations/allSaintsDay.php | 1 + src/Yasumi/data/translations/assumptionOfMary.php | 1 + src/Yasumi/data/translations/christmasDay.php | 1 + src/Yasumi/data/translations/easter.php | 1 + src/Yasumi/data/translations/easterMonday.php | 1 + src/Yasumi/data/translations/epiphany.php | 1 + src/Yasumi/data/translations/goodFriday.php | 1 + .../data/translations/immaculateConception.php | 1 + .../data/translations/internationalWorkersDay.php | 1 + src/Yasumi/data/translations/maundyThursday.php | 1 + src/Yasumi/data/translations/newYearsDay.php | 1 + src/Yasumi/data/translations/stGeorgesDay.php | 1 + src/Yasumi/data/translations/stJohnsDay.php | 1 + src/Yasumi/data/translations/stJosephsDay.php | 1 + src/Yasumi/data/translations/stStephensDay.php | 1 + src/Yasumi/data/translations/valentinesDay.php | 1 + tests/Spain/Catalonia/nationalCataloniaDayTest.php | 5 ++++- 22 files changed, 46 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9471a408..43e1eacb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added +- Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) ### Changed diff --git a/src/Yasumi/Provider/Spain.php b/src/Yasumi/Provider/Spain.php index e98c93db8..7b356fef9 100755 --- a/src/Yasumi/Provider/Spain.php +++ b/src/Yasumi/Provider/Spain.php @@ -83,7 +83,10 @@ private function calculateNationalDay(): void if ($this->year >= 1981) { $this->addHoliday(new Holiday( 'nationalDay', - ['es' => 'Fiesta Nacional de España'], + [ + 'ca' => 'Festa Nacional d\'Espanya', + 'es' => 'Fiesta Nacional de España', + ], new DateTime("$this->year-10-12", new DateTimeZone($this->timezone)), $this->locale )); @@ -109,7 +112,10 @@ private function calculateConstitutionDay(): void if ($this->year >= 1978) { $this->addHoliday(new Holiday( 'constitutionDay', - ['es' => 'Día de la Constitución'], + [ + 'ca' => 'Dia de la Constitució', + 'es' => 'Día de la Constitución', + ], new DateTime("$this->year-12-6", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Spain/BalearicIslands.php b/src/Yasumi/Provider/Spain/BalearicIslands.php index 8d96308ea..93c62e542 100755 --- a/src/Yasumi/Provider/Spain/BalearicIslands.php +++ b/src/Yasumi/Provider/Spain/BalearicIslands.php @@ -80,7 +80,10 @@ private function calculateBalearicIslandsDay(): void if ($this->year >= 1983) { $this->addHoliday(new Holiday( 'balearicIslandsDay', - ['es' => 'Día de les Illes Balears'], + [ + 'ca' => 'Diada de les Illes Balears', + 'es' => 'Día de les Illes Balears', + ], new DateTime("$this->year-3-1", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Spain/Catalonia.php b/src/Yasumi/Provider/Spain/Catalonia.php index ca405eeba..0a30868bc 100755 --- a/src/Yasumi/Provider/Spain/Catalonia.php +++ b/src/Yasumi/Provider/Spain/Catalonia.php @@ -83,7 +83,10 @@ private function calculateNationalDayOfCatalonia(): void if ($this->year >= 1886) { $this->addHoliday(new Holiday( 'nationalCataloniaDay', - ['es' => 'Diada Nacional de Catalunya'], + [ + 'ca' => 'Diada Nacional de Catalunya', + 'es' => 'Diada Nacional de Cataluña', + ], new DateTime("$this->year-9-11", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Spain/ValencianCommunity.php b/src/Yasumi/Provider/Spain/ValencianCommunity.php index c0977da52..f886a019b 100755 --- a/src/Yasumi/Provider/Spain/ValencianCommunity.php +++ b/src/Yasumi/Provider/Spain/ValencianCommunity.php @@ -83,9 +83,15 @@ public function initialize(): void private function calculateValencianCommunityDay(): void { if ($this->year >= 1239) { - $this->addHoliday(new Holiday('valencianCommunityDay', [ - 'es' => 'Día de la Comunidad Valenciana', - ], new DateTime("$this->year-10-9", new DateTimeZone($this->timezone)), $this->locale)); + $this->addHoliday(new Holiday( + 'valencianCommunityDay', + [ + 'ca' => 'Diada Nacional del País Valencià', + 'es' => 'Día de la Comunidad Valenciana', + ], + new DateTime("$this->year-10-9", new DateTimeZone($this->timezone)), + $this->locale + )); } } } diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php index fae02e67a..43145060b 100755 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -13,6 +13,7 @@ // Translations for All Saints' Day return [ + 'ca' => 'Dia de Tots Sants', 'de' => 'Allerheiligen', 'el' => 'Άγιοι Πάντες', 'en' => 'All Saints\' Day', diff --git a/src/Yasumi/data/translations/assumptionOfMary.php b/src/Yasumi/data/translations/assumptionOfMary.php index 663369705..fec1c415c 100755 --- a/src/Yasumi/data/translations/assumptionOfMary.php +++ b/src/Yasumi/data/translations/assumptionOfMary.php @@ -13,6 +13,7 @@ // Translations for Assumption of Mary return [ + 'ca' => 'l\'Assumpció', 'de' => 'Mariä Himmelfahrt', 'el' => 'Κοίμηση της Θεοτόκου', 'en' => 'Assumption of Mary', diff --git a/src/Yasumi/data/translations/christmasDay.php b/src/Yasumi/data/translations/christmasDay.php index 6cfb1a727..e9130bbaf 100755 --- a/src/Yasumi/data/translations/christmasDay.php +++ b/src/Yasumi/data/translations/christmasDay.php @@ -14,6 +14,7 @@ // Translations for Christmas return [ 'bs_Latn' => 'Božić', + 'ca' => 'Nadal', 'cs' => '1. svátek vánoční', 'cy' => 'Nadolig', 'da' => 'juledag', diff --git a/src/Yasumi/data/translations/easter.php b/src/Yasumi/data/translations/easter.php index 610069422..bee383877 100644 --- a/src/Yasumi/data/translations/easter.php +++ b/src/Yasumi/data/translations/easter.php @@ -14,6 +14,7 @@ // Translations for Easter Sunday return [ 'bs_Latn' => 'Uskrs', + 'ca' => 'Pasqua', 'cy' => 'Sul y Pasg', 'da' => 'påskedag', 'de' => 'Ostersonntag', diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index 804031b46..b6e4eaff8 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -13,6 +13,7 @@ // Translations for Easter Monday return [ + 'ca' => 'dilluns de Pasqua', 'cs' => 'Velikonoční pondělí', 'cy' => 'Llun y Pasg', 'da' => '2. påskedag', diff --git a/src/Yasumi/data/translations/epiphany.php b/src/Yasumi/data/translations/epiphany.php index 8e2360006..8b7f6c415 100644 --- a/src/Yasumi/data/translations/epiphany.php +++ b/src/Yasumi/data/translations/epiphany.php @@ -13,6 +13,7 @@ // Translations for Epiphany return [ + 'ca' => 'Epifania', 'de_AT' => 'Heilige Drei Könige', 'de_CH' => 'Heilige Drei Könige', 'de' => 'Heilige 3 Könige', diff --git a/src/Yasumi/data/translations/goodFriday.php b/src/Yasumi/data/translations/goodFriday.php index 5dcba4bca..f9bcc8b9c 100644 --- a/src/Yasumi/data/translations/goodFriday.php +++ b/src/Yasumi/data/translations/goodFriday.php @@ -13,6 +13,7 @@ // Translations for Good Friday return [ + 'ca' => 'Divendres Sant', 'cs' => 'Velký pátek', 'cy' => 'Gwener y Groglith', 'da' => 'langfredag', diff --git a/src/Yasumi/data/translations/immaculateConception.php b/src/Yasumi/data/translations/immaculateConception.php index b6a4a84f9..506149ef8 100644 --- a/src/Yasumi/data/translations/immaculateConception.php +++ b/src/Yasumi/data/translations/immaculateConception.php @@ -13,6 +13,7 @@ // Translations for Immaculate Conception return [ + 'ca' => 'Immaculada Concepció', 'de' => 'Mariä Empfängnis', 'el' => 'Ευαγγελισμός της Θεοτόκου', 'en' => 'Immaculate Conception', diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php index 737c39ddb..0c0124a66 100755 --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -14,6 +14,7 @@ // Translations for International Workers' Day return [ 'bs_Latn' => 'Praznik rada', + 'ca' => 'Dia del Treball', 'cs' => 'Svátek práce', 'da' => 'første maj', 'de' => 'Tag der Arbeit', diff --git a/src/Yasumi/data/translations/maundyThursday.php b/src/Yasumi/data/translations/maundyThursday.php index e7b97a264..f74797603 100644 --- a/src/Yasumi/data/translations/maundyThursday.php +++ b/src/Yasumi/data/translations/maundyThursday.php @@ -13,6 +13,7 @@ // Translations for Maundy Thursday return [ + 'ca' => 'dijous Sant', 'da' => 'skærtorsdag', 'el' => 'Μεγάλη Πέμπτη', 'en' => 'Maundy Thursday', diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php index c7b055b53..121ba621b 100755 --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -14,6 +14,7 @@ // Translations for New Year's Day return [ 'bs_Latn' => 'Nova godina', + 'ca' => 'Cap d\'any', 'cs' => 'Nový rok', 'cy' => 'Dydd Calan', 'da' => 'nytårsdag', diff --git a/src/Yasumi/data/translations/stGeorgesDay.php b/src/Yasumi/data/translations/stGeorgesDay.php index f2991fcc9..22bb731b8 100644 --- a/src/Yasumi/data/translations/stGeorgesDay.php +++ b/src/Yasumi/data/translations/stGeorgesDay.php @@ -13,6 +13,7 @@ // Translations for St. George's Day return [ + 'ca' => 'Sant Jordi', 'el' => 'Αγίου Γεωργίου', 'en' => 'St. George\'s Day', 'es' => 'San Jorge', diff --git a/src/Yasumi/data/translations/stJohnsDay.php b/src/Yasumi/data/translations/stJohnsDay.php index 1ca9c933d..e817f242d 100644 --- a/src/Yasumi/data/translations/stJohnsDay.php +++ b/src/Yasumi/data/translations/stJohnsDay.php @@ -13,6 +13,7 @@ // Translations for St. John's Day return [ + 'ca' => 'Sant Joan', 'da' => 'sankthansaften', 'el' => 'Σύναξις Προφήτου Προδρόμου και Βαπτιστού Ιωάννου', 'en' => 'St. John\'s Day', diff --git a/src/Yasumi/data/translations/stJosephsDay.php b/src/Yasumi/data/translations/stJosephsDay.php index 223132cc7..dd32038ed 100644 --- a/src/Yasumi/data/translations/stJosephsDay.php +++ b/src/Yasumi/data/translations/stJosephsDay.php @@ -13,6 +13,7 @@ // Translations for St. Joseph's Day return [ + 'ca' => 'Sant Josep', 'de' => 'Josephstag', 'en' => 'St. Joseph\'s Day', 'es' => 'San José', diff --git a/src/Yasumi/data/translations/stStephensDay.php b/src/Yasumi/data/translations/stStephensDay.php index be43845e8..7ad3ffedd 100644 --- a/src/Yasumi/data/translations/stStephensDay.php +++ b/src/Yasumi/data/translations/stStephensDay.php @@ -13,6 +13,7 @@ // Translations for St. Stephen's Day return [ + 'ca' => 'Sant Esteve', 'cy' => 'Gŵyl San Steffan', 'de' => 'Stephanstag', 'en' => 'St. Stephen\'s Day', diff --git a/src/Yasumi/data/translations/valentinesDay.php b/src/Yasumi/data/translations/valentinesDay.php index 2925b357f..5a9fd3fd2 100644 --- a/src/Yasumi/data/translations/valentinesDay.php +++ b/src/Yasumi/data/translations/valentinesDay.php @@ -13,6 +13,7 @@ // Translations for Valentine's Day return [ + 'ca' => 'Dia de Sant Valentí', 'de' => 'Valentinstag', 'el' => 'Αγίου Βαλεντίνου', 'en' => 'Valentine\'s Day', diff --git a/tests/Spain/Catalonia/nationalCataloniaDayTest.php b/tests/Spain/Catalonia/nationalCataloniaDayTest.php index dfe6646a1..94ebfc3d2 100644 --- a/tests/Spain/Catalonia/nationalCataloniaDayTest.php +++ b/tests/Spain/Catalonia/nationalCataloniaDayTest.php @@ -73,7 +73,10 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Diada Nacional de Catalunya'] + [ + 'es' => 'Diada Nacional de Cataluña', + 'ca' => 'Diada Nacional de Catalunya', + ] ); } From fd8522ae7c94f070c0fcec81a87b31e2d3b46a5f Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Thu, 2 Jan 2020 13:44:34 +0900 Subject: [PATCH 038/115] Updated CHANGELOG.md to reflect the latest changes (and some older ones). Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e1eacb2..d0fad67fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Added - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) +- Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) +- Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) +- Added missing return (correct) and parameter types in various methods. ### Changed - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) +- Changed fallback from DEFAULT_LANGUAGE to 'en'. [\#183](https://github.com/azuyalabs/yasumi/pull/183) ([c960657](https://github.com/c960657)) +- Changed DateTime to DateTimeImmutable as dates should be that: immutable (by default) +- Explicitly set nullable parameters as such. +- Refactored various conditional structures. +- Changed signature of some methods as parameters with defaults should come after required parameters. +- Updated third party dependencies. ### Fixed - Fixed issue if the next working day happens to be in the next year (i.e. not in the year of the Yasumi instance) [\#192](https://github.com/azuyalabs/yasumi/issues/192) ([tniemann](https://github.com/tniemann)) - Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) +- Fix locale fallback for substitute holidays [\#180](https://github.com/azuyalabs/yasumi/pull/180) ([c960657](https://github.com/c960657)) +- Fixed compound conditions that are always true by simplifying the condition steps. ### Removed - PHP 7.1 Support, as it has reached its end of life. +- Removed the assertion of the instance type in some functions as it is already defined by the return type. +- Removed unused variables, brackets, empty tests, etc. ## [2.2.0] - 2019-10-06 From c0f41cdd4b71d55f5ec0c8c7434e6bf97e378a44 Mon Sep 17 00:00:00 2001 From: Christian Mohr Date: Wed, 8 Jan 2020 16:24:50 +0100 Subject: [PATCH 039/115] One-time holiday: Day of Liberation, 2020-05-08, Berlin, Germany (#196) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Germany/Berlin.php | 41 +++++++ .../data/translations/dayOfLiberation.php | 17 +++ .../Berlin/DayOfLiberation2020Test.php | 105 ++++++++++++++++++ 4 files changed, 164 insertions(+) create mode 100644 src/Yasumi/data/translations/dayOfLiberation.php create mode 100644 tests/Germany/Berlin/DayOfLiberation2020Test.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fad67fa..81bdb306a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) - Added missing return (correct) and parameter types in various methods. +- Day of Liberation (Tag der Befreiung) is an one-time official holiday in 2020 in Berlin (Germany). ### Changed - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) diff --git a/src/Yasumi/Provider/Germany/Berlin.php b/src/Yasumi/Provider/Germany/Berlin.php index 6771ad0bf..288fb8b3d 100755 --- a/src/Yasumi/Provider/Germany/Berlin.php +++ b/src/Yasumi/Provider/Germany/Berlin.php @@ -12,8 +12,11 @@ namespace Yasumi\Provider\Germany; +use DateTime; +use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; use Yasumi\Provider\Germany; /** @@ -49,5 +52,43 @@ public function initialize(): void if ($this->year >= 2019) { $this->addHoliday($this->internationalWomensDay($this->year, $this->timezone, $this->locale)); } + + if ($this->year == 2020) { + $this->addHoliday($this->dayOfLiberation($this->timezone, $this->locale)); + } + } + + /** + * Day of Liberation + * + * Day of Liberation (Tag der Befreiung) is celebrated on May 8 2020 to commemorate the 75th anniversary + * of the German Instrument of Surrender. + * + * @link https://de.wikipedia.org/wiki/Tag_der_Befreiung + * + * @param string $timezone the timezone in which Day of Liberation is celebrated + * @param string $locale the locale for which Day of Liberation needs to be displayed in. + * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, + * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. + * + * @return Holiday + * + * @throws InvalidDateException + * @throws UnknownLocaleException + * @throws \InvalidArgumentException + * @throws \Exception + */ + public function dayOfLiberation( + string $timezone, + string $locale, + string $type = Holiday::TYPE_OFFICIAL + ): Holiday { + return new Holiday( + 'dayOfLiberation', + [], + new DateTime('2020-05-08', new DateTimeZone($timezone)), + $locale, + $type + ); } } diff --git a/src/Yasumi/data/translations/dayOfLiberation.php b/src/Yasumi/data/translations/dayOfLiberation.php new file mode 100644 index 000000000..ed03b050a --- /dev/null +++ b/src/Yasumi/data/translations/dayOfLiberation.php @@ -0,0 +1,17 @@ + + */ + +// Translations for Day of Liberation +return [ + 'de' => 'Tag der Befreiung', + 'en' => 'Day of Liberation', +]; diff --git a/tests/Germany/Berlin/DayOfLiberation2020Test.php b/tests/Germany/Berlin/DayOfLiberation2020Test.php new file mode 100644 index 000000000..84842284e --- /dev/null +++ b/tests/Germany/Berlin/DayOfLiberation2020Test.php @@ -0,0 +1,105 @@ + + */ + +namespace Yasumi\tests\Germany\Berlin; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Day of Liberation 2020 in Berlin (Germany). + */ +class DayOfLiberation2020Test extends BerlinBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'dayOfLiberation'; + + /** + * The year in which the holiday takes place + */ + public const YEAR = 2020; + + /** + * Test the holiday defined in this test + * @throws Exception + * @throws ReflectionException + */ + public function testHolidayInYear() + { + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + self::YEAR, + new DateTime(self::YEAR . '-05-08', new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Test the holiday defined in this test in the years before + * @throws ReflectionException + */ + public function testHolidayBeforeYear() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::YEAR - 1) + ); + } + + /** + * Test the holiday defined in this test in the years after + * @throws ReflectionException + */ + public function testHolidayAfterYear() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::YEAR + 1) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + self::YEAR, + [self::LOCALE => 'Tag der Befreiung'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + self::YEAR, + Holiday::TYPE_OFFICIAL + ); + } +} From 39ac324da7c038b8b3c4bcac3a6e464c14351436 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 12 Jan 2020 15:48:30 +0100 Subject: [PATCH 040/115] Use typographical apostrophe (#197) --- src/Yasumi/Provider/Australia.php | 4 +- src/Yasumi/Provider/Australia/ACT.php | 2 +- src/Yasumi/Provider/Australia/NSW.php | 2 +- src/Yasumi/Provider/Australia/NT.php | 2 +- src/Yasumi/Provider/Australia/Queensland.php | 2 +- .../Australia/Queensland/Brisbane.php | 2 +- src/Yasumi/Provider/Australia/SA.php | 2 +- src/Yasumi/Provider/Australia/Tasmania.php | 2 +- src/Yasumi/Provider/Australia/Victoria.php | 2 +- src/Yasumi/Provider/Australia/WA.php | 2 +- src/Yasumi/Provider/Bosnia.php | 2 +- src/Yasumi/Provider/Ireland.php | 2 +- src/Yasumi/Provider/Japan.php | 2 +- src/Yasumi/Provider/Netherlands.php | 6 +- src/Yasumi/Provider/NewZealand.php | 2 +- src/Yasumi/Provider/Romania.php | 4 +- src/Yasumi/Provider/Russia.php | 2 +- src/Yasumi/Provider/SouthAfrica.php | 2 +- src/Yasumi/Provider/SouthKorea.php | 6 +- src/Yasumi/Provider/Spain.php | 2 +- src/Yasumi/Provider/USA.php | 4 +- .../UnitedKingdom/NorthernIreland.php | 2 +- src/Yasumi/data/translations/allSaintsDay.php | 2 +- src/Yasumi/data/translations/allSaintsEve.php | 2 +- .../data/translations/assumptionOfMary.php | 2 +- .../data/translations/dayAfterNewYearsDay.php | 2 +- src/Yasumi/data/translations/easterMonday.php | 2 +- src/Yasumi/data/translations/fathersDay.php | 2 +- .../translations/internationalWomensDay.php | 2 +- .../translations/internationalWorkersDay.php | 4 +- src/Yasumi/data/translations/mothersDay.php | 2 +- src/Yasumi/data/translations/newYearsDay.php | 6 +- src/Yasumi/data/translations/newYearsEve.php | 2 +- .../data/translations/queensBirthday.php | 21 ++++++ src/Yasumi/data/translations/stAndrewsDay.php | 2 +- src/Yasumi/data/translations/stDavidsDay.php | 2 +- .../data/translations/stFloriansDay.php | 2 +- src/Yasumi/data/translations/stGeorgesDay.php | 2 +- src/Yasumi/data/translations/stJohnsDay.php | 2 +- src/Yasumi/data/translations/stJohnsEve.php | 2 +- src/Yasumi/data/translations/stJosephsDay.php | 2 +- .../data/translations/stLeopoldsDay.php | 2 +- src/Yasumi/data/translations/stMartinsDay.php | 2 +- src/Yasumi/data/translations/stRupertsDay.php | 2 +- .../data/translations/stStephensDay.php | 2 +- .../data/translations/valentinesDay.php | 2 +- tests/Australia/ACT/QueensBirthdayTest.php | 2 +- tests/Australia/NSW/QueensBirthdayTest.php | 2 +- tests/Australia/NT/QueensBirthdayTest.php | 2 +- tests/Australia/NewYearsDayTest.php | 4 +- .../Queensland/Brisbane/PeoplesDayTest.php | 2 +- .../Queensland/QueensBirthdayTest.php | 2 +- tests/Australia/SA/QueensBirthdayTest.php | 2 +- .../Australia/Tasmania/QueensBirthdayTest.php | 2 +- .../Australia/Victoria/QueensBirthdayTest.php | 2 +- tests/Australia/WA/QueensBirthdayTest.php | 2 +- tests/Base/HolidayTest.php | 8 +-- tests/Base/TranslationsTest.php | 22 +++--- tests/France/NewYearsDayTest.php | 2 +- tests/Ireland/NewYearsDayTest.php | 2 +- tests/Ireland/StPatricksDayTest.php | 2 +- tests/Ireland/StStephensDayTest.php | 2 +- tests/Italy/EasterMondayTest.php | 2 +- tests/Latvia/NewYearsEveDayTest.php | 2 +- tests/NewZealand/DayAfterNewYearsDayTest.php | 2 +- tests/NewZealand/NewYearsDayTest.php | 2 +- tests/NewZealand/QueensBirthdayTest.php | 2 +- tests/SouthAfrica/NationalWomensDayTest.php | 2 +- tests/SouthAfrica/NewYearsDayTest.php | 2 +- tests/SouthAfrica/WorkersDayTest.php | 2 +- tests/TypographyTest.php | 67 +++++++++++++++++++ tests/USA/MartinLutherKingDayTest.php | 2 +- tests/USA/NewYearsDayTest.php | 2 +- tests/USA/WashingtonsBirthdayTest.php | 2 +- .../UnitedKingdom/England/NewYearsDayTest.php | 2 +- tests/UnitedKingdom/NewYearsDayTest.php | 2 +- .../NorthernIreland/NewYearsDayTest.php | 2 +- .../NorthernIreland/StPatricksDayTest.php | 2 +- .../Scotland/NewYearsDayTest.php | 2 +- .../Scotland/StAndrewsDayTest.php | 2 +- tests/UnitedKingdom/Wales/NewYearsDayTest.php | 2 +- 81 files changed, 191 insertions(+), 103 deletions(-) create mode 100644 src/Yasumi/data/translations/queensBirthday.php create mode 100644 tests/TypographyTest.php diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index bc3883fe7..4e08f9eb0 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -75,11 +75,11 @@ private function calculateNewYearHolidays(): void switch ($newyearsday->format('w')) { case 0: // sunday $newyearsday->add(new DateInterval('P1D')); - $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year\'s Holiday'], false, false); + $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year’s Holiday'], false, false); break; case 6: // saturday $newyearsday->add(new DateInterval('P2D')); - $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year\'s Holiday'], false, false); + $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year’s Holiday'], false, false); break; } } diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index a8ee4533a..6c0429e22 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -144,7 +144,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NSW.php index cb7b56d94..3c5d73c36 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NSW.php @@ -107,7 +107,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NT.php index f9e66df87..b400f7be6 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NT.php @@ -106,7 +106,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/Queensland.php b/src/Yasumi/Provider/Australia/Queensland.php index bfdb1b1e0..6ad30542d 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -73,7 +73,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime($birthDay, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php index 297c07764..13432aace 100644 --- a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php +++ b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php @@ -72,6 +72,6 @@ private function calculatePeoplesDay(): void $date = $date->add(new DateInterval('P7D')); } $date = $date->add(new DateInterval('P5D')); - $this->addHoliday(new Holiday('peoplesDay', ['en' => 'Ekka People\'s Day'], $date, $this->locale)); + $this->addHoliday(new Holiday('peoplesDay', ['en' => 'Ekka People’s Day'], $date, $this->locale)); } } diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index 4207392b5..a9c228618 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -114,7 +114,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index d05b29ced..681556ab3 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -80,7 +80,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => 'Queen\'s Birthday'], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index fed3b03a8..6392d5b83 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -156,7 +156,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), - ['en' => 'Queen\'s Birthday'], + [], false, false ); diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WA.php index 4520c9194..9a8bb04cb 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WA.php @@ -77,7 +77,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', new DateTime($birthDay, new DateTimeZone($this->timezone)), - ['en' => "Queen's Birthday"], + [], false, false ); diff --git a/src/Yasumi/Provider/Bosnia.php b/src/Yasumi/Provider/Bosnia.php index f003e99c9..d8aee8f87 100644 --- a/src/Yasumi/Provider/Bosnia.php +++ b/src/Yasumi/Provider/Bosnia.php @@ -85,7 +85,7 @@ public function initialize(): void * Day after New Years Day */ $this->addHoliday(new Holiday('dayAfterNewYearsDay', [ - 'en' => 'Day after New Year\'s Day', + 'en' => 'Day after New Year’s Day', 'bs_Latn' => 'Nova godina - drugi dan', ], new DateTime("$this->year-01-02", new DateTimeZone($this->timezone)), $this->locale)); diff --git a/src/Yasumi/Provider/Ireland.php b/src/Yasumi/Provider/Ireland.php index 74156c313..2a2cf8749 100644 --- a/src/Yasumi/Provider/Ireland.php +++ b/src/Yasumi/Provider/Ireland.php @@ -242,7 +242,7 @@ private function calculateStPatricksDay(): void } $holiday = new Holiday( 'stPatricksDay', - ['en' => 'St. Patrick\'s Day', 'ga' => 'Lá Fhéile Pádraig'], + ['en' => 'St. Patrick’s Day', 'ga' => 'Lá Fhéile Pádraig'], new DateTime($this->year . '-3-17', new DateTimeZone($this->timezone)), $this->locale ); diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index 7848dabb2..9d4922015 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -180,7 +180,7 @@ private function calculateChildrensDay(): void $this->addHoliday(new Holiday( 'childrensDay', [ - 'en' => 'Children\'s Day', + 'en' => 'Children’s Day', 'ja' => 'こどもの日', ], new DateTime("$this->year-5-5", new DateTimeZone($this->timezone)), diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php index 1bd3c7119..14ca841aa 100755 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -186,7 +186,7 @@ private function calculateStNicholasDay(): void */ $this->addHoliday(new Holiday( 'stNicholasDay', - ['en' => 'St. Nicholas\' Day', 'nl' => 'Sinterklaas'], + ['en' => 'St. Nicholas’ Day', 'nl' => 'Sinterklaas'], new DateTime("$this->year-12-5", new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE @@ -228,7 +228,7 @@ private function calculatePrincesDay(): void { $this->addHoliday(new Holiday( 'princesDay', - ['en' => 'Prince\'s Day', 'nl' => 'Prinsjesdag'], + ['en' => 'Prince’s Day', 'nl' => 'Prinsjesdag'], new DateTime("third tuesday of september $this->year", new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER @@ -259,7 +259,7 @@ private function calculateQueensday(): void $this->addHoliday(new Holiday( 'queensDay', - ['en' => 'Queen\'s Day', 'nl' => 'Koninginnedag'], + ['en' => 'Queen’s Day', 'nl' => 'Koninginnedag'], $date, $this->locale )); diff --git a/src/Yasumi/Provider/NewZealand.php b/src/Yasumi/Provider/NewZealand.php index 5890fe985..9a9bd887e 100644 --- a/src/Yasumi/Provider/NewZealand.php +++ b/src/Yasumi/Provider/NewZealand.php @@ -184,7 +184,7 @@ private function calculateQueensBirthday(): void $this->addHoliday(new Holiday( 'queensBirthday', - ['en' => 'Queens Birthday'], + [], new DateTime("first monday of june $this->year", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Romania.php b/src/Yasumi/Provider/Romania.php index ad6e3d6e2..be917f7e2 100755 --- a/src/Yasumi/Provider/Romania.php +++ b/src/Yasumi/Provider/Romania.php @@ -233,7 +233,7 @@ private function calculateChildrensDay(): void $this->addHoliday(new Holiday( 'childrensDay', [ - 'en' => 'International Children\'s Day', + 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', ], new DateTime("$this->year-06-01", new DateTimeZone($this->timezone)), @@ -244,7 +244,7 @@ private function calculateChildrensDay(): void if ($this->year >= 2017) { $this->addHoliday(new Holiday('childrensDay', [ - 'en' => 'International Children\'s Day', + 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', ], new DateTime("$this->year-06-01", new DateTimeZone($this->timezone)), $this->locale)); } diff --git a/src/Yasumi/Provider/Russia.php b/src/Yasumi/Provider/Russia.php index 68ce6742c..809d84ef5 100644 --- a/src/Yasumi/Provider/Russia.php +++ b/src/Yasumi/Provider/Russia.php @@ -67,7 +67,7 @@ private function addNewYearsHolidays(): void foreach ($holidayDays as $day) { $this->addHoliday(new Holiday('newYearHolidaysDay' . $day, [ - 'en' => 'New Year\'s holidays', + 'en' => 'New Year’s holidays', 'ru' => 'Новогодние каникулы', ], new \DateTime("{$this->year}-01-{$day}", new \DateTimeZone($this->timezone)), $this->locale)); } diff --git a/src/Yasumi/Provider/SouthAfrica.php b/src/Yasumi/Provider/SouthAfrica.php index 57abdd6f5..c3a274f4d 100644 --- a/src/Yasumi/Provider/SouthAfrica.php +++ b/src/Yasumi/Provider/SouthAfrica.php @@ -223,7 +223,7 @@ private function calculateNationalWomensDay(): void { $this->addHoliday(new Holiday( 'nationalWomensDay', - ['en' => 'National Women\'s Day'], + ['en' => 'National Women’s Day'], new DateTime($this->year . '-8-9', new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 1d71fe162..769099604 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -172,7 +172,7 @@ public function calculateNewYearsDay(): void if ($this->year <= 1990) { $this->addHoliday(new Holiday( 'twoDaysLaterNewYearsDay', - ['en' => 'Two Days Later New Year\'s Day', 'ko' => '새해 연휴'], + ['en' => 'Two Days Later New Year’s Day', 'ko' => '새해 연휴'], new DateTime("$this->year-1-3", new DateTimeZone($this->timezone)), $this->locale )); @@ -231,7 +231,7 @@ public function calculateBuddhasBirthday(): void if ($this->year >= 1975 && isset(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year])) { $this->addHoliday(new Holiday( 'buddhasBirthday', - ['en' => 'Buddha\'s Birthday', 'ko' => '부처님오신날'], + ['en' => 'Buddha’s Birthday', 'ko' => '부처님오신날'], new DateTime(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year], new DateTimeZone($this->timezone)), $this->locale )); @@ -332,7 +332,7 @@ public function calculateChildrensDay(): void if ($this->year >= 1970) { $this->addHoliday(new Holiday( 'childrensDay', - ['en' => 'Children\'s Day', 'ko' => '어린이날'], + ['en' => 'Children’s Day', 'ko' => '어린이날'], new DateTime("$this->year-5-5", new DateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Spain.php b/src/Yasumi/Provider/Spain.php index 7b356fef9..76a6313f1 100755 --- a/src/Yasumi/Provider/Spain.php +++ b/src/Yasumi/Provider/Spain.php @@ -84,7 +84,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday( 'nationalDay', [ - 'ca' => 'Festa Nacional d\'Espanya', + 'ca' => 'Festa Nacional d’Espanya', 'es' => 'Fiesta Nacional de España', ], new DateTime("$this->year-10-12", new DateTimeZone($this->timezone)), diff --git a/src/Yasumi/Provider/USA.php b/src/Yasumi/Provider/USA.php index 42f9736e9..4f9f971f6 100755 --- a/src/Yasumi/Provider/USA.php +++ b/src/Yasumi/Provider/USA.php @@ -78,7 +78,7 @@ private function calculateMartinLutherKingday(): void { if ($this->year >= 1986) { $this->addHoliday(new Holiday('martinLutherKingDay', [ - 'en' => 'Dr. Martin Luther King Jr\'s Birthday', + 'en' => 'Dr. Martin Luther King Jr’s Birthday', ], new DateTime("third monday of january $this->year", new DateTimeZone($this->timezone)), $this->locale)); } } @@ -106,7 +106,7 @@ private function calculateWashingtonsBirthday(): void $date = new DateTime("third monday of february $this->year", new DateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('washingtonsBirthday', [ - 'en' => 'Washington\'s Birthday', + 'en' => 'Washington’s Birthday', ], $date, $this->locale)); } } diff --git a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php index da7eb78be..6575b016f 100644 --- a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php +++ b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php @@ -78,7 +78,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', - ['en' => 'St. Patrick\'s Day'], + ['en' => 'St. Patrick’s Day'], new DateTime($this->year . '-3-17', new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php index 43145060b..84a4aba10 100755 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -16,7 +16,7 @@ 'ca' => 'Dia de Tots Sants', 'de' => 'Allerheiligen', 'el' => 'Άγιοι Πάντες', - 'en' => 'All Saints\' Day', + 'en' => 'All Saints’ Day', 'es' => 'Día de todos los Santos', 'fi' => 'Pyhäinpäivä', 'fr_BE' => 'La Toussaint', diff --git a/src/Yasumi/data/translations/allSaintsEve.php b/src/Yasumi/data/translations/allSaintsEve.php index 052834a23..939e9d02d 100755 --- a/src/Yasumi/data/translations/allSaintsEve.php +++ b/src/Yasumi/data/translations/allSaintsEve.php @@ -14,6 +14,6 @@ // Translations for All Saints' Eve return [ 'da' => 'allehelgensaften', - 'en' => 'All Saints\' Eve', + 'en' => 'All Saints’ Eve', 'sv' => 'alla helgons afton', ]; diff --git a/src/Yasumi/data/translations/assumptionOfMary.php b/src/Yasumi/data/translations/assumptionOfMary.php index fec1c415c..b18af1ceb 100755 --- a/src/Yasumi/data/translations/assumptionOfMary.php +++ b/src/Yasumi/data/translations/assumptionOfMary.php @@ -13,7 +13,7 @@ // Translations for Assumption of Mary return [ - 'ca' => 'l\'Assumpció', + 'ca' => 'l’Assumpció', 'de' => 'Mariä Himmelfahrt', 'el' => 'Κοίμηση της Θεοτόκου', 'en' => 'Assumption of Mary', diff --git a/src/Yasumi/data/translations/dayAfterNewYearsDay.php b/src/Yasumi/data/translations/dayAfterNewYearsDay.php index 0681f6fbf..4e1af3fff 100644 --- a/src/Yasumi/data/translations/dayAfterNewYearsDay.php +++ b/src/Yasumi/data/translations/dayAfterNewYearsDay.php @@ -13,7 +13,7 @@ // Translations for Day after New Year's Day return [ - 'en' => 'Day after New Year\'s Day', + 'en' => 'Day after New Year’s Day', 'ko' => '새해 연휴', 'ro' => 'A doua zi după Anul Nou', ]; diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index b6e4eaff8..a4603bb46 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -26,7 +26,7 @@ 'ga' => 'Luan Cásca', 'hr' => 'Uskršnji ponedjeljak', 'hu' => 'Húsvéthétfő', - 'it' => 'Lunedì dell\'Angelo', + 'it' => 'Lunedì dell’Angelo', 'it_CH' => 'Lunedi di Pasqua', 'lt' => 'Antroji Velykų diena', 'lv' => 'Otrās Lieldienas', diff --git a/src/Yasumi/data/translations/fathersDay.php b/src/Yasumi/data/translations/fathersDay.php index 3077f4683..395e9a4dd 100755 --- a/src/Yasumi/data/translations/fathersDay.php +++ b/src/Yasumi/data/translations/fathersDay.php @@ -15,7 +15,7 @@ return [ 'de' => 'Vatertag', 'el' => 'Γιορτή του πατέρα', - 'en' => 'Father\'s Day', + 'en' => 'Father’s Day', 'fr' => 'Fête des pères', 'it' => 'Festa del papà', 'nl' => 'Vaderdag', diff --git a/src/Yasumi/data/translations/internationalWomensDay.php b/src/Yasumi/data/translations/internationalWomensDay.php index f242b8a78..23181bd63 100755 --- a/src/Yasumi/data/translations/internationalWomensDay.php +++ b/src/Yasumi/data/translations/internationalWomensDay.php @@ -14,7 +14,7 @@ // Translations for International Women's Day return [ 'de' => 'Internationaler Frauentag', - 'en' => 'International Women\'s Day', + 'en' => 'International Women’s Day', 'ko' => '국제 여성의 날', 'ru' => 'Международный женский день', 'uk' => 'Міжнародний жіночий день', diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php index 0c0124a66..b3ef5a30a 100755 --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -20,8 +20,8 @@ 'de' => 'Tag der Arbeit', 'de_AT' => 'Staatsfeiertag', 'el' => 'Εργατική Πρωτομαγιά', - 'en_US' => 'International Workers\' Day', - 'en_ZA' => 'Workers\' Day', + 'en_US' => 'International Workers’ Day', + 'en_ZA' => 'Workers’ Day', 'es' => 'Día del Trabajador', 'et' => 'Kevadpüha', 'fi' => 'Vappu', diff --git a/src/Yasumi/data/translations/mothersDay.php b/src/Yasumi/data/translations/mothersDay.php index 42d87f322..3d0eda88c 100755 --- a/src/Yasumi/data/translations/mothersDay.php +++ b/src/Yasumi/data/translations/mothersDay.php @@ -15,7 +15,7 @@ return [ 'de' => 'Muttertag', 'el' => 'Ημέρα της μητέρας', - 'en' => 'Mother\'s Day', + 'en' => 'Mother’s Day', 'fr' => 'Fête des mères', 'it' => 'Festa della mamma', 'nl' => 'Moederdag', diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php index 121ba621b..5cfa6dc96 100755 --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -14,19 +14,19 @@ // Translations for New Year's Day return [ 'bs_Latn' => 'Nova godina', - 'ca' => 'Cap d\'any', + 'ca' => 'Cap d’any', 'cs' => 'Nový rok', 'cy' => 'Dydd Calan', 'da' => 'nytårsdag', 'de' => 'Neujahr', 'el' => 'Πρωτοχρονιά', - 'en' => 'New Year\'s Day', + 'en' => 'New Year’s Day', 'es' => 'Año Nuevo', 'et' => 'Uusaasta', 'fi' => 'Uudenvuodenpäivä', 'fr_BE' => 'Nouvel An', 'fr_CH' => 'Nouvel An', - 'fr' => 'Jour de l\'An', + 'fr' => 'Jour de l’An', 'ga' => 'Lá Caille', 'hr' => 'Nova godina', 'hu' => 'Újév', diff --git a/src/Yasumi/data/translations/newYearsEve.php b/src/Yasumi/data/translations/newYearsEve.php index 17b9356ef..20433b385 100755 --- a/src/Yasumi/data/translations/newYearsEve.php +++ b/src/Yasumi/data/translations/newYearsEve.php @@ -14,7 +14,7 @@ // Translations for New Year's Eve return [ 'da' => 'nytårsaften', - 'en' => 'New Year\'s Eve', + 'en' => 'New Year’s Eve', 'ko' => '신년전야', 'lv' => 'Vecgada vakars', 'sv' => 'nyårsafton', diff --git a/src/Yasumi/data/translations/queensBirthday.php b/src/Yasumi/data/translations/queensBirthday.php new file mode 100644 index 000000000..bfbf7a660 --- /dev/null +++ b/src/Yasumi/data/translations/queensBirthday.php @@ -0,0 +1,21 @@ + + */ + +// Translations for Queen's Birthday +return [ + 'da' => 'Dronningens fødselsdag', + 'en' => 'Queen’s Birthday', + 'pt' => 'Aniversário da Rainha', + 'fr' => 'Anniversaire officiel de la reine', + 'ru' => 'Официальный день рождения королевы', +]; diff --git a/src/Yasumi/data/translations/stAndrewsDay.php b/src/Yasumi/data/translations/stAndrewsDay.php index 2793fb98c..de1f75a41 100644 --- a/src/Yasumi/data/translations/stAndrewsDay.php +++ b/src/Yasumi/data/translations/stAndrewsDay.php @@ -13,6 +13,6 @@ // Translations for St. Andrew's Day return [ - 'en' => 'St. Andrew\'s Day', + 'en' => 'St. Andrew’s Day', 'ro' => 'Sfântul Andrei', ]; diff --git a/src/Yasumi/data/translations/stDavidsDay.php b/src/Yasumi/data/translations/stDavidsDay.php index e43557f37..be03a879c 100644 --- a/src/Yasumi/data/translations/stDavidsDay.php +++ b/src/Yasumi/data/translations/stDavidsDay.php @@ -14,5 +14,5 @@ // Translations for St. David's Day return [ 'cy' => 'Dydd Gŵyl Dewi', - 'en' => 'St. David\'s Day', + 'en' => 'St. David’s Day', ]; diff --git a/src/Yasumi/data/translations/stFloriansDay.php b/src/Yasumi/data/translations/stFloriansDay.php index 77cdd0bda..c9641f74a 100644 --- a/src/Yasumi/data/translations/stFloriansDay.php +++ b/src/Yasumi/data/translations/stFloriansDay.php @@ -13,6 +13,6 @@ // Translations for Saint Florian's Day. return [ - 'en' => 'Saint Florian\'s Day', + 'en' => 'Saint Florian’s Day', 'de_AT' => 'Florian', ]; diff --git a/src/Yasumi/data/translations/stGeorgesDay.php b/src/Yasumi/data/translations/stGeorgesDay.php index 22bb731b8..b0bccb8c4 100644 --- a/src/Yasumi/data/translations/stGeorgesDay.php +++ b/src/Yasumi/data/translations/stGeorgesDay.php @@ -15,6 +15,6 @@ return [ 'ca' => 'Sant Jordi', 'el' => 'Αγίου Γεωργίου', - 'en' => 'St. George\'s Day', + 'en' => 'St. George’s Day', 'es' => 'San Jorge', ]; diff --git a/src/Yasumi/data/translations/stJohnsDay.php b/src/Yasumi/data/translations/stJohnsDay.php index e817f242d..647bdc789 100644 --- a/src/Yasumi/data/translations/stJohnsDay.php +++ b/src/Yasumi/data/translations/stJohnsDay.php @@ -16,7 +16,7 @@ 'ca' => 'Sant Joan', 'da' => 'sankthansaften', 'el' => 'Σύναξις Προφήτου Προδρόμου και Βαπτιστού Ιωάννου', - 'en' => 'St. John\'s Day', + 'en' => 'St. John’s Day', 'es' => 'Sant Joan', 'et' => 'Jaanipäev', 'fi' => 'Juhannuspäivä', diff --git a/src/Yasumi/data/translations/stJohnsEve.php b/src/Yasumi/data/translations/stJohnsEve.php index 69dcba900..9418d44e8 100644 --- a/src/Yasumi/data/translations/stJohnsEve.php +++ b/src/Yasumi/data/translations/stJohnsEve.php @@ -14,6 +14,6 @@ // Translations for St. John's Eve return [ 'da' => 'sankthansaften', - 'en' => 'St. John\'s Eve', + 'en' => 'St. John’s Eve', 'sv' => 'midsommarafton', ]; diff --git a/src/Yasumi/data/translations/stJosephsDay.php b/src/Yasumi/data/translations/stJosephsDay.php index dd32038ed..46fd0a378 100644 --- a/src/Yasumi/data/translations/stJosephsDay.php +++ b/src/Yasumi/data/translations/stJosephsDay.php @@ -15,7 +15,7 @@ return [ 'ca' => 'Sant Josep', 'de' => 'Josephstag', - 'en' => 'St. Joseph\'s Day', + 'en' => 'St. Joseph’s Day', 'es' => 'San José', 'fr' => 'Saint-Joseph', 'it' => 'San Giuseppe', diff --git a/src/Yasumi/data/translations/stLeopoldsDay.php b/src/Yasumi/data/translations/stLeopoldsDay.php index 8044f6b88..1f4b6f0de 100644 --- a/src/Yasumi/data/translations/stLeopoldsDay.php +++ b/src/Yasumi/data/translations/stLeopoldsDay.php @@ -13,6 +13,6 @@ // Translations for Saint Leopold's Day. return [ - 'en' => 'Saint Leopold\'s Day', + 'en' => 'Saint Leopold’s Day', 'de_AT' => 'Leopold', ]; diff --git a/src/Yasumi/data/translations/stMartinsDay.php b/src/Yasumi/data/translations/stMartinsDay.php index c49f4f69a..bf0ce13bb 100644 --- a/src/Yasumi/data/translations/stMartinsDay.php +++ b/src/Yasumi/data/translations/stMartinsDay.php @@ -13,7 +13,7 @@ // Translations for St. Martin's Day return [ - 'en' => 'St. Martin\'s Day', + 'en' => 'St. Martin’s Day', 'nl' => 'Sint Maarten', 'de_AT' => 'Martin', ]; diff --git a/src/Yasumi/data/translations/stRupertsDay.php b/src/Yasumi/data/translations/stRupertsDay.php index 7294d8e27..5d4471fd5 100644 --- a/src/Yasumi/data/translations/stRupertsDay.php +++ b/src/Yasumi/data/translations/stRupertsDay.php @@ -13,6 +13,6 @@ // Translations for Saint Rupert's Day. return [ - 'en' => 'Saint Rupert\'s Day', + 'en' => 'Saint Rupert’s Day', 'de_AT' => 'Rupert', ]; diff --git a/src/Yasumi/data/translations/stStephensDay.php b/src/Yasumi/data/translations/stStephensDay.php index 7ad3ffedd..ec09b09fb 100644 --- a/src/Yasumi/data/translations/stStephensDay.php +++ b/src/Yasumi/data/translations/stStephensDay.php @@ -16,7 +16,7 @@ 'ca' => 'Sant Esteve', 'cy' => 'Gŵyl San Steffan', 'de' => 'Stephanstag', - 'en' => 'St. Stephen\'s Day', + 'en' => 'St. Stephen’s Day', 'es' => 'Sant Esteve', 'fr' => 'Saint-Étienne', 'ga' => 'Lá Fhéile Stiofáin', diff --git a/src/Yasumi/data/translations/valentinesDay.php b/src/Yasumi/data/translations/valentinesDay.php index 5a9fd3fd2..b8be09ea5 100644 --- a/src/Yasumi/data/translations/valentinesDay.php +++ b/src/Yasumi/data/translations/valentinesDay.php @@ -16,7 +16,7 @@ 'ca' => 'Dia de Sant Valentí', 'de' => 'Valentinstag', 'el' => 'Αγίου Βαλεντίνου', - 'en' => 'Valentine\'s Day', + 'en' => 'Valentine’s Day', 'es' => 'San Valentín', 'fr' => 'Saint-Valentin', 'it' => 'San Valentino', diff --git a/tests/Australia/ACT/QueensBirthdayTest.php b/tests/Australia/ACT/QueensBirthdayTest.php index d433c0f11..658704d3d 100644 --- a/tests/Australia/ACT/QueensBirthdayTest.php +++ b/tests/Australia/ACT/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/NSW/QueensBirthdayTest.php b/tests/Australia/NSW/QueensBirthdayTest.php index 0bfe1ad91..8cbc96af7 100644 --- a/tests/Australia/NSW/QueensBirthdayTest.php +++ b/tests/Australia/NSW/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/NT/QueensBirthdayTest.php b/tests/Australia/NT/QueensBirthdayTest.php index 998021d79..55b02e85c 100644 --- a/tests/Australia/NT/QueensBirthdayTest.php +++ b/tests/Australia/NT/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/NewYearsDayTest.php b/tests/Australia/NewYearsDayTest.php index 05228c802..dc72a6aa2 100644 --- a/tests/Australia/NewYearsDayTest.php +++ b/tests/Australia/NewYearsDayTest.php @@ -101,13 +101,13 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); $this->assertTranslatedHolidayName( $this->region, self::HOLIDAY2, 2017, - [self::LOCALE => 'New Year\'s Holiday'] + [self::LOCALE => 'New Year’s Holiday'] ); } diff --git a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php index 5899b312c..61344c1e8 100644 --- a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php +++ b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php @@ -84,7 +84,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(1990), - [self::LOCALE => 'Ekka People\'s Day'] + [self::LOCALE => 'Ekka People’s Day'] ); } diff --git a/tests/Australia/Queensland/QueensBirthdayTest.php b/tests/Australia/Queensland/QueensBirthdayTest.php index a4f543995..d11372cfb 100644 --- a/tests/Australia/Queensland/QueensBirthdayTest.php +++ b/tests/Australia/Queensland/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/SA/QueensBirthdayTest.php b/tests/Australia/SA/QueensBirthdayTest.php index dd612f10c..ddb3f621a 100644 --- a/tests/Australia/SA/QueensBirthdayTest.php +++ b/tests/Australia/SA/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/Tasmania/QueensBirthdayTest.php b/tests/Australia/Tasmania/QueensBirthdayTest.php index 561fcd706..2beb3b1b6 100644 --- a/tests/Australia/Tasmania/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/Victoria/QueensBirthdayTest.php b/tests/Australia/Victoria/QueensBirthdayTest.php index 03e30e294..733187d74 100644 --- a/tests/Australia/Victoria/QueensBirthdayTest.php +++ b/tests/Australia/Victoria/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Australia/WA/QueensBirthdayTest.php b/tests/Australia/WA/QueensBirthdayTest.php index 6cdb9b2ee..f14685db6 100644 --- a/tests/Australia/WA/QueensBirthdayTest.php +++ b/tests/Australia/WA/QueensBirthdayTest.php @@ -89,7 +89,7 @@ public function testTranslation(): void $this->region, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queen\'s Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index 8aded6efb..50ef9e192 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -168,7 +168,7 @@ public function testHolidayGetNameWithGlobalTranslations(): void $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translations = [ - 'en_US' => 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'pl_PL' => 'Nowy Rok', ]; @@ -194,7 +194,7 @@ public function testHolidayGetNameWithGlobalParentLocaleTranslations(): void $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translations = [ - 'en_US' => 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'pl' => 'Nowy Rok', ]; @@ -220,7 +220,7 @@ public function testHolidayGetNameWithGlobalAndCustomTranslations(): void $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translations = [ - 'en_US' => 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'pl_PL' => 'Nowy Rok', ]; @@ -252,7 +252,7 @@ public function testHolidayGetNameWithOverridenGlobalTranslations(): void $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translations = [ - 'en_US' => 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'pl_PL' => 'Nowy Rok', ]; diff --git a/tests/Base/TranslationsTest.php b/tests/Base/TranslationsTest.php index 4f16714a5..22715ce14 100644 --- a/tests/Base/TranslationsTest.php +++ b/tests/Base/TranslationsTest.php @@ -40,7 +40,7 @@ public function testAddTranslation(): void $locale = 'en_US'; $shortName = 'newYearsDay'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $this->assertNull($translations->getTranslation($shortName, $locale)); $this->assertEmpty($translations->getTranslations($shortName)); @@ -65,7 +65,7 @@ public function testAddMultipleTranslations(): void $firstLocale = 'en_US'; $firstShortName = 'newYearsDay'; - $firstTranslation = 'New Year\'s Day'; + $firstTranslation = 'New Year’s Day'; $translations->addTranslation($firstShortName, $firstLocale, $firstTranslation); @@ -121,7 +121,7 @@ public function testAddTranslationUnknownLocaleException(): void $unknownLocale = 'en_XY'; $shortName = 'newYearsDay'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $translations->addTranslation($shortName, $unknownLocale, $translation); } @@ -135,7 +135,7 @@ public function testNoTranslationForUnknownHoliday(): void $locale = 'en_US'; $shortName = 'newYearsDay'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $unknownShortName = 'unknownHoliday'; @@ -154,7 +154,7 @@ public function testNoTranslationForNotTranslatedLocale(): void $locale = 'en_US'; $shortName = 'newYearsDay'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $unknownLocale = 'pl_PL'; @@ -172,7 +172,7 @@ public function testLoadingTranslationsFromDirectory(): void $fileContents = <<<'FILE' 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'nl_NL' => 'Nieuwjaar', 'pl_PL' => 'Nowy Rok', ]; @@ -184,7 +184,7 @@ public function testLoadingTranslationsFromDirectory(): void $translations->loadTranslations(vfsStream::url('root/lang')); $locale = 'en_US'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $this->assertNotNull($translations->getTranslations($shortName)); $this->assertNotEmpty($translations->getTranslations($shortName)); @@ -201,7 +201,7 @@ public function testNotLoadingTranslationsFromFileWithInvalidExtension(): void $fileContents = <<<'FILE' 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'nl_NL' => 'Nieuwjaar', 'pl_PL' => 'Nowy Rok', ]; @@ -228,7 +228,7 @@ public function testLoadingTranslationsFromDirectoryWithUnknownLocaleException() $fileContents = <<<'FILE' 'New Year\'s Day', + 'en_XY' => 'New Year’s Day', 'nl_NL' => 'Nieuwjaar', ]; FILE; @@ -262,7 +262,7 @@ public function testLoadingMultipleTranslationsFromDirectory(): void $firstFileContents = <<<'FILE' 'New Year\'s Day', + 'en_US' => 'New Year’s Day', 'nl_NL' => 'Nieuwjaar', 'pl_PL' => 'Nowy Rok', ]; @@ -289,7 +289,7 @@ public function testLoadingMultipleTranslationsFromDirectory(): void $translations->loadTranslations(vfsStream::url('root/lang')); $locale = 'en_US'; - $translation = 'New Year\'s Day'; + $translation = 'New Year’s Day'; $this->assertNotNull($translations->getTranslations($firstShortName)); $this->assertNotEmpty($translations->getTranslations($firstShortName)); diff --git a/tests/France/NewYearsDayTest.php b/tests/France/NewYearsDayTest.php index d00fc59fd..dc9f267ca 100644 --- a/tests/France/NewYearsDayTest.php +++ b/tests/France/NewYearsDayTest.php @@ -53,7 +53,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Jour de l\'An'] + [self::LOCALE => 'Jour de l’An'] ); } diff --git a/tests/Ireland/NewYearsDayTest.php b/tests/Ireland/NewYearsDayTest.php index a3bd6d98e..4e3799a37 100644 --- a/tests/Ireland/NewYearsDayTest.php +++ b/tests/Ireland/NewYearsDayTest.php @@ -99,7 +99,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); $this->assertTranslatedHolidayName( self::REGION, diff --git a/tests/Ireland/StPatricksDayTest.php b/tests/Ireland/StPatricksDayTest.php index a01a2e79e..fa6723959 100644 --- a/tests/Ireland/StPatricksDayTest.php +++ b/tests/Ireland/StPatricksDayTest.php @@ -99,7 +99,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'St. Patrick\'s Day'] + [self::LOCALE => 'St. Patrick’s Day'] ); $this->assertTranslatedHolidayName( self::REGION, diff --git a/tests/Ireland/StStephensDayTest.php b/tests/Ireland/StStephensDayTest.php index d8f595696..05c956c1d 100644 --- a/tests/Ireland/StStephensDayTest.php +++ b/tests/Ireland/StStephensDayTest.php @@ -81,7 +81,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'St. Stephen\'s Day'] + [self::LOCALE => 'St. Stephen’s Day'] ); $this->assertTranslatedHolidayName( self::REGION, diff --git a/tests/Italy/EasterMondayTest.php b/tests/Italy/EasterMondayTest.php index 18dca2ec5..7542ac0ab 100644 --- a/tests/Italy/EasterMondayTest.php +++ b/tests/Italy/EasterMondayTest.php @@ -55,7 +55,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => "Lunedì dell'Angelo"] + [self::LOCALE => 'Lunedì dell’Angelo'] ); } diff --git a/tests/Latvia/NewYearsEveDayTest.php b/tests/Latvia/NewYearsEveDayTest.php index a7b7f3009..3d51fb1b4 100644 --- a/tests/Latvia/NewYearsEveDayTest.php +++ b/tests/Latvia/NewYearsEveDayTest.php @@ -63,7 +63,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Vecgada vakars', 'en' => 'New Year\'s Eve'] + [self::LOCALE => 'Vecgada vakars', 'en' => 'New Year’s Eve'] ); } diff --git a/tests/NewZealand/DayAfterNewYearsDayTest.php b/tests/NewZealand/DayAfterNewYearsDayTest.php index fa828b665..7cbe3334e 100644 --- a/tests/NewZealand/DayAfterNewYearsDayTest.php +++ b/tests/NewZealand/DayAfterNewYearsDayTest.php @@ -61,7 +61,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Day after New Year\'s Day'] + [self::LOCALE => 'Day after New Year’s Day'] ); } diff --git a/tests/NewZealand/NewYearsDayTest.php b/tests/NewZealand/NewYearsDayTest.php index 1b334c4ea..7145a1883 100644 --- a/tests/NewZealand/NewYearsDayTest.php +++ b/tests/NewZealand/NewYearsDayTest.php @@ -90,7 +90,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/NewZealand/QueensBirthdayTest.php b/tests/NewZealand/QueensBirthdayTest.php index 5177eb6d8..fa09a5895 100644 --- a/tests/NewZealand/QueensBirthdayTest.php +++ b/tests/NewZealand/QueensBirthdayTest.php @@ -87,7 +87,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Queens Birthday'] + [self::LOCALE => 'Queen’s Birthday'] ); } diff --git a/tests/SouthAfrica/NationalWomensDayTest.php b/tests/SouthAfrica/NationalWomensDayTest.php index 064fa6d77..1950ed25f 100644 --- a/tests/SouthAfrica/NationalWomensDayTest.php +++ b/tests/SouthAfrica/NationalWomensDayTest.php @@ -104,7 +104,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'National Women\'s Day'] + [self::LOCALE => 'National Women’s Day'] ); } diff --git a/tests/SouthAfrica/NewYearsDayTest.php b/tests/SouthAfrica/NewYearsDayTest.php index 4504a8df1..ec51c43e2 100644 --- a/tests/SouthAfrica/NewYearsDayTest.php +++ b/tests/SouthAfrica/NewYearsDayTest.php @@ -104,7 +104,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/SouthAfrica/WorkersDayTest.php b/tests/SouthAfrica/WorkersDayTest.php index e2829000b..d1799d08e 100644 --- a/tests/SouthAfrica/WorkersDayTest.php +++ b/tests/SouthAfrica/WorkersDayTest.php @@ -104,7 +104,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Workers\' Day'] + [self::LOCALE => 'Workers’ Day'] ); } diff --git a/tests/TypographyTest.php b/tests/TypographyTest.php new file mode 100644 index 000000000..9d0269214 --- /dev/null +++ b/tests/TypographyTest.php @@ -0,0 +1,67 @@ + + */ + +namespace Yasumi\tests; + +use PHPUnit\Framework\TestCase; +use Yasumi\Translations; +use Yasumi\Yasumi; + +/** + * Class TypographyTest. + * + * Verifies that translations uses typographic apostrophe (’) and quotation marks (“ ”) + * rather than their typewriter versions (' and "). + * + * @link https://en.wikipedia.org/wiki/Apostrophe + * @link https://en.wikipedia.org/wiki/Quotation_mark + */ +class TypographyTest extends TestCase +{ + use YasumiBase; + + /** + * @dataProvider translationProvider + * + * @param string $name The localized holiday name + * @param string $class The provider + * @param string $shortName The short name (internal name) of the holiday + * @param string $locale The locale + */ + public function testTranslations($name, $class, $shortName, $locale) + { + $this->assertStringNotContainsString("'", $name, 'Translation contains typewriter apostrophe'); + $this->assertStringNotContainsString('"', $name, 'Translation contains typewriter quote'); + } + + /** + * Provides test data for testProvider(). + */ + public function translationProvider(): array + { + $classes = Yasumi::getProviders(); + + $tests = []; + + foreach ($classes as $class) { + $provider = Yasumi::create($class, $this->generateRandomYear()); + + foreach ($provider->getHolidays() as $holiday) { + foreach ($holiday->translations as $locale => $name) { + $tests[$name] = [$name, $class, $holiday->shortName, $locale]; + } + } + } + + return \array_values($tests); + } +} diff --git a/tests/USA/MartinLutherKingDayTest.php b/tests/USA/MartinLutherKingDayTest.php index f7e616f0f..46c93d2f2 100644 --- a/tests/USA/MartinLutherKingDayTest.php +++ b/tests/USA/MartinLutherKingDayTest.php @@ -75,7 +75,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Dr. Martin Luther King Jr\'s Birthday'] + [self::LOCALE => 'Dr. Martin Luther King Jr’s Birthday'] ); } diff --git a/tests/USA/NewYearsDayTest.php b/tests/USA/NewYearsDayTest.php index 119b9053a..78f54ca45 100644 --- a/tests/USA/NewYearsDayTest.php +++ b/tests/USA/NewYearsDayTest.php @@ -88,7 +88,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/USA/WashingtonsBirthdayTest.php b/tests/USA/WashingtonsBirthdayTest.php index f08c17703..1001502fa 100644 --- a/tests/USA/WashingtonsBirthdayTest.php +++ b/tests/USA/WashingtonsBirthdayTest.php @@ -92,7 +92,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Washington\'s Birthday'] + [self::LOCALE => 'Washington’s Birthday'] ); } diff --git a/tests/UnitedKingdom/England/NewYearsDayTest.php b/tests/UnitedKingdom/England/NewYearsDayTest.php index b9d142c9e..0693204bc 100644 --- a/tests/UnitedKingdom/England/NewYearsDayTest.php +++ b/tests/UnitedKingdom/England/NewYearsDayTest.php @@ -108,7 +108,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/UnitedKingdom/NewYearsDayTest.php b/tests/UnitedKingdom/NewYearsDayTest.php index 4b33eab83..e8760c6d2 100644 --- a/tests/UnitedKingdom/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NewYearsDayTest.php @@ -108,7 +108,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php index 27d539539..afa47f9ec 100644 --- a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php @@ -108,7 +108,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php index 812a7037f..6872c0f6a 100644 --- a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php @@ -99,7 +99,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'St. Patrick\'s Day'] + [self::LOCALE => 'St. Patrick’s Day'] ); } diff --git a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php index d1f083048..bceaab964 100644 --- a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php @@ -118,7 +118,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } diff --git a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php index d8a63da34..93d3e9871 100644 --- a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php +++ b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php @@ -86,7 +86,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'St. Andrew\'s Day'] + [self::LOCALE => 'St. Andrew’s Day'] ); } diff --git a/tests/UnitedKingdom/Wales/NewYearsDayTest.php b/tests/UnitedKingdom/Wales/NewYearsDayTest.php index f85dedf5c..a0eaa04de 100644 --- a/tests/UnitedKingdom/Wales/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Wales/NewYearsDayTest.php @@ -108,7 +108,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'New Year\'s Day'] + [self::LOCALE => 'New Year’s Day'] ); } From 7d9738b634703a4b76f7e94aefc028d6644c4722 Mon Sep 17 00:00:00 2001 From: livingBEEF Date: Tue, 14 Jan 2020 14:21:27 +0100 Subject: [PATCH 041/115] Add AbstractProvider::isWeekendDay function (#139) Expose the ability to recognize weekend days in a separate public function. This can be useful if the user needs to know why a given day isn't a working day. TODO: Need to fix a few things and unit tests are missing. Co-authored-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 26 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 492a934a5..0f82db7c6 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -193,24 +193,32 @@ public function removeHoliday(string $shortName): void */ public function isWorkingDay(\DateTimeInterface $date): bool { - $isWorkingDay = true; - - // First check if the given date is a holiday - if ($this->isHoliday($date)) { - $isWorkingDay = false; - } + return !$this->isHoliday($date) && !$this->isWeekendDay($date); + } + /** + * Determines whether a date represents a weekend day or not. + * + * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, + * \DateTime) + * + * @throws \Yasumi\Exception\InvalidDateException + * + * @return bool true if date represents a weekend day, otherwise false + */ + public function isWeekendDay(\DateTimeInterface $date): bool + { // Check if given date is a falls in the weekend or not // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. // @TODO Ideally avoid late static binding here (static::ID) $weekendData = self::WEEKEND_DATA; $weekendDays = $weekendData[$this::ID] ?? [0, 6]; - if (\in_array((int)$date->format('w'), $weekendDays, true)) { - $isWorkingDay = false; + if (\in_array((int)$date->format('w'), $weekend_days, true)) { + return true; } - return $isWorkingDay; + return false; } /** From daf0dea03077626d0faddb9ede01d8c96f6f28fa Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 14 Jan 2020 23:25:53 +0900 Subject: [PATCH 042/115] Fixed issue with incorrect variable. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 0f82db7c6..6a1a39261 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -202,19 +202,19 @@ public function isWorkingDay(\DateTimeInterface $date): bool * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, * \DateTime) * + * @return bool true if date represents a weekend day, otherwise false * @throws \Yasumi\Exception\InvalidDateException * - * @return bool true if date represents a weekend day, otherwise false */ public function isWeekendDay(\DateTimeInterface $date): bool { - // Check if given date is a falls in the weekend or not // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. - // @TODO Ideally avoid late static binding here (static::ID) - $weekendData = self::WEEKEND_DATA; - $weekendDays = $weekendData[$this::ID] ?? [0, 6]; - - if (\in_array((int)$date->format('w'), $weekend_days, true)) { + if (\in_array( + (int)$date->format('w'), + self::WEEKEND_DATA[$this::ID] ?? [0, 6], + true + ) + ) { return true; } From d76b6482824dd7041c036d119cd753e42958c825 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 14 Jan 2020 23:35:04 +0900 Subject: [PATCH 043/115] Added clarification. Signed-off-by: Sacha Telgenhof --- tests/Base/YasumiTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index 3f799ec1d..68225d0a0 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -354,6 +354,10 @@ public function testGetProvidersStaticCall(): void /** * Tests that the isHoliday function returns a boolean true for a date that is defined as a holiday. + * + * Note that this function does *NOT* determine whether a date is a working or non-working day. It + * only asserts that it is a date calculated by the Holiday Provider. + * * @throws Exception * @throws ReflectionException * @throws Exception @@ -380,6 +384,10 @@ public function testIsHoliday(): void /** * Tests that the isHoliday function returns a boolean false for a date that is not defined as a holiday. + * + * Note that this function does *NOT* determine whether a date is a working or non-working day. It + * only asserts that it is a date calculated by the Holiday Provider. + * * @throws Exception * @throws ReflectionException * @throws Exception @@ -407,6 +415,7 @@ public function testIsNotHoliday(): void /** * Tests that the isHoliday function throws a TypeError when the given argument is not an instance that * implements the DateTimeInterface (e.g. DateTime or DateTimeImmutable) + * * @throws ReflectionException */ public function testIsHolidayException(): void From 08e78381c858916eecd9d8bb4fa135e13c5dbddb Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 15 Jan 2020 00:11:56 +0900 Subject: [PATCH 044/115] Added tests for the isWeekendDay function. This covers only for those countries that follow the global, common definition for weekend days. Signed-off-by: Sacha Telgenhof --- tests/Base/WeekendTest.php | 115 +++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 tests/Base/WeekendTest.php diff --git a/tests/Base/WeekendTest.php b/tests/Base/WeekendTest.php new file mode 100644 index 000000000..1185d6df2 --- /dev/null +++ b/tests/Base/WeekendTest.php @@ -0,0 +1,115 @@ + + */ + +namespace Yasumi\tests\Base; + +use PHPUnit\Framework\TestCase; +use Yasumi\Yasumi; + +/** + * Class containing various tests pertaining to the determination of a date + * being a weekend (i.e. non-working day) or not. + */ +class WeekendTest extends TestCase +{ + private const HOLIDAY_PROVIDER = 'Belgium'; + + /** + * Tests that the isWeekendDay function correctly assesses that the given date falls into the + * weekend. + * + * Note: this test uses Belgium as a representative country for the global, common weekend definition. + * Tests for countries that deviate from the global definition will be added as soon as their respective + * Holiday Provider is created. + * + * @dataProvider dataProviderWeekendDays + * + * @param \DateTimeImmutable $date + * @throws \ReflectionException + */ + public function testWeekendDay(\DateTimeImmutable $date): void + { + $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int)$date->format('Y')); + $isWeekendDay = $yasumiProvider->isWeekendDay($date); + + $this->assertIsBool($isWeekendDay); + $this->assertTrue($isWeekendDay); + } + + /** + * @return array + * @throws \Exception + */ + public function dataProviderWeekendDays(): array + { + return [ + [ + new \DateTimeImmutable('2020-04-19'), + ], + [ + new \DateTimeImmutable('2019-12-29'), + ], + [ + new \DateTimeImmutable('2019-12-28'), + ], + [ + new \DateTimeImmutable('2018-06-16'), + ], + ]; + } + + /** + * Tests that the isWeekendDay function correctly assesses that the given date does not + * fall into the weekend. + * + * Note: this test uses Belgium as a representative country for the global, common weekend definition. + * Tests for countries that deviate from the global definition will be added as soon as their respective + * Holiday Provider is created. + * + * @dataProvider dataProviderNonWeekendDays + * + * @param \DateTimeImmutable $date + * @throws \ReflectionException + */ + public function testNonWeekendDay(\DateTimeImmutable $date): void + { + $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int)$date->format('Y')); + $isWeekendDay = $yasumiProvider->isWeekendDay($date); + + $this->assertIsBool($isWeekendDay); + $this->assertFalse($isWeekendDay); + } + + /** + * @return array + * @throws \Exception + */ + public function dataProviderNonWeekendDays(): array + { + return [ + [ + new \DateTimeImmutable('2020-04-20'), + ], + [ + new \DateTimeImmutable('2019-12-30'), + ], + [ + new \DateTimeImmutable('2019-12-27'), + ], + [ + new \DateTimeImmutable('2018-06-15'), + ], + ]; + } +} From adfb747e1d56b8e94b6ca3463f02d258368c7faf Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 15 Jan 2020 00:20:45 +0900 Subject: [PATCH 045/115] Minor reformatting --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b6c365558..d44a9af57 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Introduction ------------ Yasumi (Japanese for 'Holiday'「休み」) is an easy PHP library to help you calculate the dates and names of holidays and other -special celebrations from various countries/states. Many services exist on the internet that provide holidays, however +special celebrations from various countries/states. + +Many services exist on the internet that provide holidays, however are either not free or offer only limited information. In addition, no complete PHP library seems to exist today that covers a wide range of holidays and countries, except maybe [PEAR's Date_Holidays](https://pear.php.net/package/Date_Holidays) which unfortunately hasn't been updated for a long time. From 3b3165148d91ffa9e764ab85991077c6e3cf915e Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 4 Feb 2020 00:22:28 +0900 Subject: [PATCH 046/115] Removed unnecessary qualifier. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 6a1a39261..3455bca25 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -203,7 +203,7 @@ public function isWorkingDay(\DateTimeInterface $date): bool * \DateTime) * * @return bool true if date represents a weekend day, otherwise false - * @throws \Yasumi\Exception\InvalidDateException + * @throws InvalidDateException * */ public function isWeekendDay(\DateTimeInterface $date): bool From ff5f2ce112c3bf6b996dc64df5cca00f55dab3b2 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 4 Feb 2020 00:22:42 +0900 Subject: [PATCH 047/115] Used stronger type checking. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Germany/Berlin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/Germany/Berlin.php b/src/Yasumi/Provider/Germany/Berlin.php index 288fb8b3d..81231360b 100755 --- a/src/Yasumi/Provider/Germany/Berlin.php +++ b/src/Yasumi/Provider/Germany/Berlin.php @@ -53,7 +53,7 @@ public function initialize(): void $this->addHoliday($this->internationalWomensDay($this->year, $this->timezone, $this->locale)); } - if ($this->year == 2020) { + if (2020 === $this->year) { $this->addHoliday($this->dayOfLiberation($this->timezone, $this->locale)); } } From c9f53d58842275c8700820ef4d6a9a4db9424fb0 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 4 Feb 2020 00:45:48 +0900 Subject: [PATCH 048/115] No need to use variable as structure can be returned without it. Signed-off-by: Sacha Telgenhof --- tests/Australia/ACT/CanberraDayTest.php | 4 +--- tests/Australia/ACT/LabourDayTest.php | 4 +--- tests/Australia/ACT/QueensBirthdayTest.php | 4 +--- tests/Australia/ACT/ReconciliationDayTest.php | 4 +--- tests/Australia/AnzacDayTest.php | 4 +--- tests/Australia/AustraliaDayTest.php | 4 +--- tests/Australia/BoxingDayTest.php | 4 +--- tests/Australia/ChristmasDayTest.php | 4 +--- tests/Australia/EasterMondayTest.php | 4 +--- tests/Australia/NSW/BankHolidayTest.php | 4 +--- tests/Australia/NSW/LabourDayTest.php | 4 +--- tests/Australia/NSW/QueensBirthdayTest.php | 4 +--- tests/Australia/NT/MayDayTest.php | 4 +--- tests/Australia/NT/PicnicDayTest.php | 4 +--- tests/Australia/NT/QueensBirthdayTest.php | 4 +--- tests/Australia/NewYearsDayTest.php | 4 +--- tests/Australia/Queensland/Brisbane/PeoplesDayTest.php | 4 +--- tests/Australia/Queensland/LabourDayTest.php | 4 +--- tests/Australia/Queensland/QueensBirthdayTest.php | 4 +--- tests/Australia/SA/AdelaideCupDayTest.php | 4 +--- tests/Australia/SA/ChristmasDayTest.php | 4 +--- tests/Australia/SA/LabourDayTest.php | 4 +--- tests/Australia/SA/ProclamationDayTest.php | 4 +--- tests/Australia/SA/QueensBirthdayTest.php | 4 +--- tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php | 4 +--- tests/Australia/Tasmania/EightHourDayTest.php | 4 +--- .../Tasmania/FlindersIsland/FlindersIslandShowTest.php | 4 +--- tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php | 4 +--- tests/Australia/Tasmania/Northeast/LauncestonShowTest.php | 4 +--- tests/Australia/Tasmania/Northwest/BurnieShowTest.php | 4 +--- .../Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php | 4 +--- tests/Australia/Tasmania/QueensBirthdayTest.php | 4 +--- tests/Australia/Tasmania/RecreationDayTest.php | 4 +--- tests/Australia/Tasmania/South/HobartShowTest.php | 4 +--- .../Australia/Tasmania/South/Southeast/HobartRegattaTest.php | 4 +--- tests/Australia/Victoria/AFLGrandFinalFridayTest.php | 4 +--- tests/Australia/Victoria/LabourDayTest.php | 4 +--- tests/Australia/Victoria/MelbourneCupDayTest.php | 4 +--- tests/Australia/Victoria/QueensBirthdayTest.php | 4 +--- tests/Australia/WA/LabourDayTest.php | 4 +--- tests/Australia/WA/QueensBirthdayTest.php | 4 +--- tests/Australia/WA/WesternAustraliaDayTest.php | 4 +--- 42 files changed, 42 insertions(+), 126 deletions(-) diff --git a/tests/Australia/ACT/CanberraDayTest.php b/tests/Australia/ACT/CanberraDayTest.php index 10e247a8a..433f10681 100644 --- a/tests/Australia/ACT/CanberraDayTest.php +++ b/tests/Australia/ACT/CanberraDayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-03-08'], [2011, '2011-03-14'], [2012, '2012-03-12'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-11'], [2020, '2020-03-09'], ]; - - return $data; } /** diff --git a/tests/Australia/ACT/LabourDayTest.php b/tests/Australia/ACT/LabourDayTest.php index 46c1b4ea2..01fa22668 100644 --- a/tests/Australia/ACT/LabourDayTest.php +++ b/tests/Australia/ACT/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-04'], [2011, '2011-10-03'], [2012, '2012-10-01'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-07'], [2020, '2020-10-05'], ]; - - return $data; } /** diff --git a/tests/Australia/ACT/QueensBirthdayTest.php b/tests/Australia/ACT/QueensBirthdayTest.php index 658704d3d..132e87d33 100644 --- a/tests/Australia/ACT/QueensBirthdayTest.php +++ b/tests/Australia/ACT/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/ACT/ReconciliationDayTest.php b/tests/Australia/ACT/ReconciliationDayTest.php index eb4a479c2..346e18056 100644 --- a/tests/Australia/ACT/ReconciliationDayTest.php +++ b/tests/Australia/ACT/ReconciliationDayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2018, '2018-05-28'], [2019, '2019-05-27'], [2020, '2020-06-01'], @@ -77,8 +77,6 @@ public function HolidayDataProvider(): array [2029, '2029-05-28'], [2030, '2030-05-27'], ]; - - return $data; } /** diff --git a/tests/Australia/AnzacDayTest.php b/tests/Australia/AnzacDayTest.php index d38b705da..2151f5183 100644 --- a/tests/Australia/AnzacDayTest.php +++ b/tests/Australia/AnzacDayTest.php @@ -71,7 +71,7 @@ public function testNotHoliday() */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-04-25'], [2011, '2011-04-25'], [2012, '2012-04-25'], @@ -85,8 +85,6 @@ public function HolidayDataProvider(): array [2019, '2019-04-25'], [2020, '2020-04-25'], ]; - - return $data; } /** diff --git a/tests/Australia/AustraliaDayTest.php b/tests/Australia/AustraliaDayTest.php index 9a9b4afaa..7c9da1fd3 100644 --- a/tests/Australia/AustraliaDayTest.php +++ b/tests/Australia/AustraliaDayTest.php @@ -81,7 +81,7 @@ public function testHolidayType(): void */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-01-26'], [2011, '2011-01-26'], [2012, '2012-01-26'], @@ -94,7 +94,5 @@ public function HolidayDataProvider(): array [2019, '2019-01-28'], [2020, '2020-01-27'], ]; - - return $data; } } diff --git a/tests/Australia/BoxingDayTest.php b/tests/Australia/BoxingDayTest.php index 18620e912..5c6c4a8ef 100644 --- a/tests/Australia/BoxingDayTest.php +++ b/tests/Australia/BoxingDayTest.php @@ -73,7 +73,7 @@ public function testHoliday($year, $expected, $expectedExtra) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-12-26', '2010-12-28'], [2011, '2011-12-26', null], [2012, '2012-12-26', null], @@ -86,8 +86,6 @@ public function HolidayDataProvider(): array [2019, '2019-12-26', null], [2020, '2020-12-26', '2020-12-28'], ]; - - return $data; } /** diff --git a/tests/Australia/ChristmasDayTest.php b/tests/Australia/ChristmasDayTest.php index 6660716f2..5fab37045 100644 --- a/tests/Australia/ChristmasDayTest.php +++ b/tests/Australia/ChristmasDayTest.php @@ -73,7 +73,7 @@ public function testHoliday($year, $expected, $expectedExtra) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-12-25', '2010-12-27'], [2011, '2011-12-25', '2011-12-27'], [2012, '2012-12-25', null], @@ -86,8 +86,6 @@ public function HolidayDataProvider(): array [2019, '2019-12-25', null], [2020, '2020-12-25', null], ]; - - return $data; } /** diff --git a/tests/Australia/EasterMondayTest.php b/tests/Australia/EasterMondayTest.php index e6309ef98..be695b2db 100644 --- a/tests/Australia/EasterMondayTest.php +++ b/tests/Australia/EasterMondayTest.php @@ -101,14 +101,12 @@ public function HolidayDataProvider(): array */ public function HolidayDataProvider2(): array { - $data = [ + return [ [2011, '2011-04-26'], [2038, '2038-04-27'], [2095, '2095-04-26'], [2163, '2163-04-26'], ]; - - return $data; } /** diff --git a/tests/Australia/NSW/BankHolidayTest.php b/tests/Australia/NSW/BankHolidayTest.php index e02e17a1c..5911c6ab4 100644 --- a/tests/Australia/NSW/BankHolidayTest.php +++ b/tests/Australia/NSW/BankHolidayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-08-02'], [2011, '2011-08-01'], [2012, '2012-08-06'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-08-05'], [2020, '2020-08-03'], ]; - - return $data; } /** diff --git a/tests/Australia/NSW/LabourDayTest.php b/tests/Australia/NSW/LabourDayTest.php index 2078aaf57..eff77a06f 100644 --- a/tests/Australia/NSW/LabourDayTest.php +++ b/tests/Australia/NSW/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-04'], [2011, '2011-10-03'], [2012, '2012-10-01'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-07'], [2020, '2020-10-05'], ]; - - return $data; } /** diff --git a/tests/Australia/NSW/QueensBirthdayTest.php b/tests/Australia/NSW/QueensBirthdayTest.php index 8cbc96af7..7806c3f3e 100644 --- a/tests/Australia/NSW/QueensBirthdayTest.php +++ b/tests/Australia/NSW/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/NT/MayDayTest.php b/tests/Australia/NT/MayDayTest.php index bb9552fd3..642aae82f 100644 --- a/tests/Australia/NT/MayDayTest.php +++ b/tests/Australia/NT/MayDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-05-03'], [2011, '2011-05-02'], [2012, '2012-05-07'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-05-06'], [2020, '2020-05-04'], ]; - - return $data; } /** diff --git a/tests/Australia/NT/PicnicDayTest.php b/tests/Australia/NT/PicnicDayTest.php index 447454a78..556f3fb03 100644 --- a/tests/Australia/NT/PicnicDayTest.php +++ b/tests/Australia/NT/PicnicDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-08-02'], [2011, '2011-08-01'], [2012, '2012-08-06'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-08-05'], [2020, '2020-08-03'], ]; - - return $data; } /** diff --git a/tests/Australia/NT/QueensBirthdayTest.php b/tests/Australia/NT/QueensBirthdayTest.php index 55b02e85c..758e71612 100644 --- a/tests/Australia/NT/QueensBirthdayTest.php +++ b/tests/Australia/NT/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/NewYearsDayTest.php b/tests/Australia/NewYearsDayTest.php index dc72a6aa2..e493721d3 100644 --- a/tests/Australia/NewYearsDayTest.php +++ b/tests/Australia/NewYearsDayTest.php @@ -73,7 +73,7 @@ public function testHoliday($year, $expected, $expectedExtra) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-01-01', null], [2011, '2011-01-01', '2011-01-03'], [2012, '2012-01-01', '2012-01-02'], @@ -86,8 +86,6 @@ public function HolidayDataProvider(): array [2019, '2019-01-01', null], [2020, '2020-01-01', null], ]; - - return $data; } /** diff --git a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php index 61344c1e8..add610548 100644 --- a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php +++ b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-08-11'], [2011, '2011-08-10'], [2012, '2012-08-15'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-08-14'], [2020, '2020-08-12'], ]; - - return $data; } /** diff --git a/tests/Australia/Queensland/LabourDayTest.php b/tests/Australia/Queensland/LabourDayTest.php index 890fe7cc0..825f3febe 100644 --- a/tests/Australia/Queensland/LabourDayTest.php +++ b/tests/Australia/Queensland/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-05-03'], [2011, '2011-05-02'], [2012, '2012-05-07'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-05-06'], [2020, '2020-05-04'], ]; - - return $data; } /** diff --git a/tests/Australia/Queensland/QueensBirthdayTest.php b/tests/Australia/Queensland/QueensBirthdayTest.php index d11372cfb..57d8f34af 100644 --- a/tests/Australia/Queensland/QueensBirthdayTest.php +++ b/tests/Australia/Queensland/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-10-01'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-07'], [2020, '2020-10-05'], ]; - - return $data; } /** diff --git a/tests/Australia/SA/AdelaideCupDayTest.php b/tests/Australia/SA/AdelaideCupDayTest.php index 1de44f8e0..ad47fa8e4 100644 --- a/tests/Australia/SA/AdelaideCupDayTest.php +++ b/tests/Australia/SA/AdelaideCupDayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2000, '2000-05-15'], [2001, '2001-05-21'], [2002, '2002-05-20'], @@ -85,8 +85,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-11'], [2020, '2020-03-09'], ]; - - return $data; } /** diff --git a/tests/Australia/SA/ChristmasDayTest.php b/tests/Australia/SA/ChristmasDayTest.php index ce6766158..c9bc92671 100644 --- a/tests/Australia/SA/ChristmasDayTest.php +++ b/tests/Australia/SA/ChristmasDayTest.php @@ -73,7 +73,7 @@ public function testHoliday($year, $expected, $expectedExtra) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-12-25', '2010-12-27'], [2011, '2011-12-25', '2011-12-26'], [2012, '2012-12-25', null], @@ -86,8 +86,6 @@ public function HolidayDataProvider(): array [2019, '2019-12-25', null], [2020, '2020-12-25', null], ]; - - return $data; } /** diff --git a/tests/Australia/SA/LabourDayTest.php b/tests/Australia/SA/LabourDayTest.php index 2625e5a20..30d5de9a8 100644 --- a/tests/Australia/SA/LabourDayTest.php +++ b/tests/Australia/SA/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-04'], [2011, '2011-10-03'], [2012, '2012-10-01'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-07'], [2020, '2020-10-05'], ]; - - return $data; } /** diff --git a/tests/Australia/SA/ProclamationDayTest.php b/tests/Australia/SA/ProclamationDayTest.php index 65187b42c..6a1287855 100644 --- a/tests/Australia/SA/ProclamationDayTest.php +++ b/tests/Australia/SA/ProclamationDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-12-28'], [2011, '2011-12-27'], [2012, '2012-12-26'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-12-26'], [2020, '2020-12-28'], ]; - - return $data; } /** diff --git a/tests/Australia/SA/QueensBirthdayTest.php b/tests/Australia/SA/QueensBirthdayTest.php index ddb3f621a..c202d8ce8 100644 --- a/tests/Australia/SA/QueensBirthdayTest.php +++ b/tests/Australia/SA/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php index 7a5dcda03..a5a9dce8c 100644 --- a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php +++ b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-11-26'], [2011, '2011-11-25'], [2012, '2012-11-30'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-11-29'], [2020, '2020-11-27'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/EightHourDayTest.php b/tests/Australia/Tasmania/EightHourDayTest.php index 377e9d5a9..a3346339a 100644 --- a/tests/Australia/Tasmania/EightHourDayTest.php +++ b/tests/Australia/Tasmania/EightHourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-03-08'], [2011, '2011-03-14'], [2012, '2012-03-12'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-11'], [2020, '2020-03-09'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php index 7ecae1e99..15017f18d 100644 --- a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-15'], [2011, '2011-10-14'], [2012, '2012-10-19'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-18'], [2020, '2020-10-16'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php index 78c66d80c..328ae2aef 100644 --- a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php +++ b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-03-02'], [2011, '2011-03-01'], [2012, '2012-03-06'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-05'], [2020, '2020-03-03'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php index 8b48aa856..696d54bf0 100644 --- a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php +++ b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-07'], [2011, '2011-10-06'], [2012, '2012-10-11'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-10'], [2020, '2020-10-08'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php index ef47c743b..ecec82595 100644 --- a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php +++ b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-01'], [2011, '2011-09-30'], [2012, '2012-10-05'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-04'], [2020, '2020-10-02'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php index a07f5b962..3ded129af 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-05-07'], [2011, '2011-05-06'], [2012, '2012-05-04'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-05-03'], [2020, '2020-05-08'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/QueensBirthdayTest.php b/tests/Australia/Tasmania/QueensBirthdayTest.php index 2beb3b1b6..4b6455ddf 100644 --- a/tests/Australia/Tasmania/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/RecreationDayTest.php b/tests/Australia/Tasmania/RecreationDayTest.php index 70e1fa6be..e98d0c251 100644 --- a/tests/Australia/Tasmania/RecreationDayTest.php +++ b/tests/Australia/Tasmania/RecreationDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-11-01'], [2011, '2011-11-07'], [2012, '2012-11-05'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-11-04'], [2020, '2020-11-02'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/South/HobartShowTest.php b/tests/Australia/Tasmania/South/HobartShowTest.php index b19f82dc7..943839f83 100644 --- a/tests/Australia/Tasmania/South/HobartShowTest.php +++ b/tests/Australia/Tasmania/South/HobartShowTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-10-21'], [2011, '2011-10-20'], [2012, '2012-10-25'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-10-24'], [2020, '2020-10-22'], ]; - - return $data; } /** diff --git a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php index e5b97e692..40e187b8d 100644 --- a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php +++ b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-02-08'], [2011, '2011-02-14'], [2012, '2012-02-13'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-02-11'], [2020, '2020-02-10'], ]; - - return $data; } /** diff --git a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php index 2ab3dfb3b..841d9bad3 100644 --- a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php +++ b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php @@ -98,7 +98,7 @@ public function testNotHoliday() */ public function HolidayDataProvider(): array { - $data = [ + return [ [2015, '2015-10-02'], [2016, '2016-09-30'], [2017, '2017-09-29'], @@ -106,7 +106,5 @@ public function HolidayDataProvider(): array [2019, '2019-09-27'], [2020, '2020-09-25'], ]; - - return $data; } } diff --git a/tests/Australia/Victoria/LabourDayTest.php b/tests/Australia/Victoria/LabourDayTest.php index 65f5745d0..4d1afdbea 100644 --- a/tests/Australia/Victoria/LabourDayTest.php +++ b/tests/Australia/Victoria/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-03-08'], [2011, '2011-03-14'], [2012, '2012-03-12'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-11'], [2020, '2020-03-09'], ]; - - return $data; } /** diff --git a/tests/Australia/Victoria/MelbourneCupDayTest.php b/tests/Australia/Victoria/MelbourneCupDayTest.php index 567ee4c5c..9ead58882 100644 --- a/tests/Australia/Victoria/MelbourneCupDayTest.php +++ b/tests/Australia/Victoria/MelbourneCupDayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-11-02'], [2011, '2011-11-01'], [2012, '2012-11-06'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-11-05'], [2020, '2020-11-03'], ]; - - return $data; } /** diff --git a/tests/Australia/Victoria/QueensBirthdayTest.php b/tests/Australia/Victoria/QueensBirthdayTest.php index 733187d74..5410cdd2e 100644 --- a/tests/Australia/Victoria/QueensBirthdayTest.php +++ b/tests/Australia/Victoria/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-14'], [2011, '2011-06-13'], [2012, '2012-06-11'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-10'], [2020, '2020-06-08'], ]; - - return $data; } /** diff --git a/tests/Australia/WA/LabourDayTest.php b/tests/Australia/WA/LabourDayTest.php index 07168dc94..332ead2f1 100644 --- a/tests/Australia/WA/LabourDayTest.php +++ b/tests/Australia/WA/LabourDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-03-01'], [2011, '2011-03-07'], [2012, '2012-03-05'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-03-04'], [2020, '2020-03-02'], ]; - - return $data; } /** diff --git a/tests/Australia/WA/QueensBirthdayTest.php b/tests/Australia/WA/QueensBirthdayTest.php index f14685db6..06f362d2c 100644 --- a/tests/Australia/WA/QueensBirthdayTest.php +++ b/tests/Australia/WA/QueensBirthdayTest.php @@ -62,7 +62,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-09-27'], [2011, '2011-10-28'], [2012, '2012-10-01'], @@ -75,8 +75,6 @@ public function HolidayDataProvider(): array [2019, '2019-09-30'], [2020, '2020-09-28'], ]; - - return $data; } /** diff --git a/tests/Australia/WA/WesternAustraliaDayTest.php b/tests/Australia/WA/WesternAustraliaDayTest.php index 92f970995..9618ea515 100644 --- a/tests/Australia/WA/WesternAustraliaDayTest.php +++ b/tests/Australia/WA/WesternAustraliaDayTest.php @@ -57,7 +57,7 @@ public function testHoliday($year, $expected) */ public function HolidayDataProvider(): array { - $data = [ + return [ [2010, '2010-06-07'], [2011, '2011-06-06'], [2012, '2012-06-04'], @@ -70,8 +70,6 @@ public function HolidayDataProvider(): array [2019, '2019-06-03'], [2020, '2020-06-01'], ]; - - return $data; } /** From 931c993098310b0a3e7466a816f2b8e4120d8ca8 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Tue, 4 Feb 2020 00:47:03 +0900 Subject: [PATCH 049/115] Added missing strict type declaration. Added missing return type. Signed-off-by: Sacha Telgenhof --- tests/TypographyTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/TypographyTest.php b/tests/TypographyTest.php index 9d0269214..f59c52867 100644 --- a/tests/TypographyTest.php +++ b/tests/TypographyTest.php @@ -1,4 +1,5 @@ assertStringNotContainsString("'", $name, 'Translation contains typewriter apostrophe'); $this->assertStringNotContainsString('"', $name, 'Translation contains typewriter quote'); From 88f609c7a0cbd950db1ff53c1b0a5e294c446bdf Mon Sep 17 00:00:00 2001 From: HeinrichConvidera <49152239+HeinrichConvidera@users.noreply.github.com> Date: Wed, 5 Feb 2020 15:54:32 +0100 Subject: [PATCH 050/115] Update ukraine holidays (#202) --- CHANGELOG.md | 3 + src/Yasumi/Holiday.php | 1 + src/Yasumi/Provider/Ukraine.php | 77 +++++++- tests/Base/WeekendTest.php | 3 +- tests/Ukraine/CatholicChristmasDayTest.php | 104 ++++++++++ .../SecondInternationalWorkersDayTest.php | 36 +++- tests/Ukraine/SubstitutedHolidayTest.php | 184 ++++++++++++++++++ tests/Ukraine/UkraineTest.php | 38 +++- 8 files changed, 432 insertions(+), 14 deletions(-) create mode 100644 tests/Ukraine/CatholicChristmasDayTest.php create mode 100644 tests/Ukraine/SubstitutedHolidayTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 81bdb306a..dffa5eaea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) - Added missing return (correct) and parameter types in various methods. - Day of Liberation (Tag der Befreiung) is an one-time official holiday in 2020 in Berlin (Germany). +- Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Changed - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) @@ -21,12 +22,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Refactored various conditional structures. - Changed signature of some methods as parameters with defaults should come after required parameters. - Updated third party dependencies. +- Second International Workers Day was an official holiday only until 2018. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Fixed - Fixed issue if the next working day happens to be in the next year (i.e. not in the year of the Yasumi instance) [\#192](https://github.com/azuyalabs/yasumi/issues/192) ([tniemann](https://github.com/tniemann)) - Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) - Fix locale fallback for substitute holidays [\#180](https://github.com/azuyalabs/yasumi/pull/180) ([c960657](https://github.com/c960657)) - Fixed compound conditions that are always true by simplifying the condition steps. +- Fixed Ukraine holidays on weekends. These days need to be substituted. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Removed - PHP 7.1 Support, as it has reached its end of life. diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 9a185db50..55841b65a 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -1,4 +1,5 @@ timezone = 'Europe/Kiev'; // Add common holidays - $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale)); + // New Years Day will not be substituted to an monday if it's on a weekend! + $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale), false); $this->addHoliday($this->internationalWorkersDay($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->internationalWomensDay($this->year, $this->timezone, $this->locale)); @@ -63,6 +66,42 @@ public function initialize(): void $this->calculateConstitutionDay(); $this->calculateIndependenceDay(); $this->calculateDefenderOfUkraineDay(); + $this->calculateCatholicChristmasDay(); + } + + /** + * Adds a holiday to the holidays providers (i.e. country/state) list of holidays. + * + * @param Holiday $holiday Holiday instance (representing a holiday) to be added to the internal list + * of holidays of this country. + * @param bool $substitutable Holidays on a weekend will be substituted to the next monday. + * + * @throws InvalidDateException + * @throws UnknownLocaleException + * @throws \InvalidArgumentException + * @throws \Exception + */ + public function addHoliday(Holiday $holiday, bool $substitutable = true): void + { + parent::addHoliday($holiday); + + if (!$substitutable) { + return; + } + + // Substitute holiday is on the next available weekday + // if a holiday falls on a Saturday or Sunday. + if ($this->isWeekendDay($holiday)) { + $date = clone $holiday; + $date->modify('next monday'); + + parent::addHoliday(new SubstituteHoliday( + $holiday, + [], + $date, + $this->locale + )); + } } /** @@ -85,6 +124,7 @@ private function calculateChristmasDay(): void /** * International Workers' Day. + * National holiday until 2018. * * @link https://en.wikipedia.org/wiki/International_Workers%27_Day#Ukraine * @@ -95,6 +135,10 @@ private function calculateChristmasDay(): void */ private function calculateSecondInternationalWorkersDay(): void { + if ($this->year >= 2018) { + return; + } + $this->addHoliday(new Holiday('secondInternationalWorkersDay', [ 'uk' => 'День міжнародної солідарності трудящих', 'ru' => 'День международной солидарности трудящихся', @@ -222,4 +266,35 @@ public function calculateEaster(int $year, string $timezone): \DateTime { return $this->calculateOrthodoxEaster($year, $timezone); } + + /** + * Catholic Christmas Day. + * (since 2017 instead of International Workers' Day 2. May) + * + * @link https://en.wikipedia.org/wiki/Christmas_in_Ukraine + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateCatholicChristmasDay(): void + { + if ($this->year < 2017) { + return; + } + + $this->addHoliday( + new Holiday( + 'catholicChristmasDay', + [ + 'uk' => 'Католицький день Різдва', + 'ru' => 'Католическое рождество', + ], + new \DateTime("$this->year-12-25", new \DateTimeZone($this->timezone)), + $this->locale + ), + false // Catholic Christmas Day will not be substituted to an monday if it's on a weekend! + ); + } } diff --git a/tests/Base/WeekendTest.php b/tests/Base/WeekendTest.php index 1185d6df2..ef4c3cfbc 100644 --- a/tests/Base/WeekendTest.php +++ b/tests/Base/WeekendTest.php @@ -1,5 +1,4 @@ - + */ + +namespace Yasumi\tests\Ukraine; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; +use Yasumi\Yasumi; + +/** + * Class CatholicChristmasDayTest + * @package Yasumi\tests\Ukraine + */ +class CatholicChristmasDayTest extends UkraineBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'catholicChristmasDay'; + + /** + * Tests Catholic Christmas Day. + * + * @dataProvider CatholicChristmasDayDataProvider + * + * @param int $year the year for which International Workers' Day needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testCatholicChristmasDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Tests Catholic Christmas Day before 2017. + * @throws ReflectionException + */ + public function testNoCatholicChristmasDayBefore2017() + { + $year = $this->generateRandomYear(null, 2016); + $holidays = Yasumi::create(self::REGION, $year); + $holiday = $holidays->getHoliday(self::HOLIDAY); + + $this->assertNull($holiday); + + unset($year, $holiday, $holidays); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(2017), + [self::LOCALE => 'Католицький день Різдва'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(2017), Holiday::TYPE_OFFICIAL); + } + + /** + * Returns a list of random test dates used for assertion of Catholic Christmas Day. + * + * @return array list of test dates for Catholic Christmas Day + * @throws Exception + */ + public function CatholicChristmasDayDataProvider(): array + { + $data = []; + + for ($y = 0; $y < 10; $y++) { + $year = $this->generateRandomYear(2017); + $data[] = [$year, new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE))]; + } + + return $data; + } +} diff --git a/tests/Ukraine/SecondInternationalWorkersDayTest.php b/tests/Ukraine/SecondInternationalWorkersDayTest.php index 10c6fb859..9fff35ba3 100644 --- a/tests/Ukraine/SecondInternationalWorkersDayTest.php +++ b/tests/Ukraine/SecondInternationalWorkersDayTest.php @@ -1,4 +1,5 @@ assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } + /** + * Tests International Workers' Day since 2018. + * @throws ReflectionException + */ + public function testNoSecondInternationalWorkersDaySince2018() + { + $year = $this->generateRandomYear(2018); + $holidays = Yasumi::create(self::REGION, $year); + $holiday = $holidays->getHoliday(self::HOLIDAY); + + $this->assertNull($holiday); + + unset($year, $holiday, $holidays); + } + /** * Tests translated name of the holiday defined in this test. * @throws ReflectionException @@ -53,7 +69,7 @@ public function testTranslation(): void $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(), + $this->generateRandomYear(null, 2017), [self::LOCALE => 'День міжнародної солідарності трудящих'] ); } @@ -64,7 +80,12 @@ public function testTranslation(): void */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(null, 2017), + Holiday::TYPE_OFFICIAL + ); } /** @@ -75,6 +96,13 @@ public function testHolidayType(): void */ public function SecondInternationalWorkersDayDataProvider(): array { - return $this->generateRandomDates(5, 2, self::TIMEZONE); + $data = []; + + for ($y = 0; $y < 10; $y++) { + $year = $this->generateRandomYear(null, 2017); + $data[] = [$year, new \DateTime("$year-05-02", new \DateTimeZone(self::TIMEZONE))]; + } + + return $data; } } diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php new file mode 100644 index 000000000..b8e8db952 --- /dev/null +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -0,0 +1,184 @@ + + */ + +namespace Yasumi\tests\Ukraine; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\SubstituteHoliday; +use Yasumi\tests\YasumiTestCaseInterface; +use Yasumi\Yasumi; + +/** + * Class SubstitutedHolidayTest + * @package Yasumi\tests\Ukraine + */ +class SubstitutedHolidayTest extends UkraineBaseTestCase implements YasumiTestCaseInterface +{ + /** + * Tests the substitution of holidays on saturday (weekend). + * @throws Exception + * @throws ReflectionException + */ + public function testSaturdaySubstitution() + { + // 2020-05-09 victoryDay (День перемоги) + $year = 2020; + $holiday = 'victoryDay'; + + $this->assertHolidayWithSubstitution( + self::REGION, + $holiday, + $year, + new DateTime("$year-05-09", new DateTimeZone(self::TIMEZONE)), + new DateTime("$year-05-11", new DateTimeZone(self::TIMEZONE)) + ); + + unset($year, $holiday); + } + + /** + * Tests the substitution of holidays on sunday (weekend). + * @throws Exception + * @throws ReflectionException + */ + public function testSundaySubstitution(): void + { + // 2020-06-28 constitutionDay (День Конституції) + $year = 2020; + $holiday = 'constitutionDay'; + + $this->assertHolidayWithSubstitution( + self::REGION, + $holiday, + $year, + new DateTime("$year-06-28", new DateTimeZone(self::TIMEZONE)), + new DateTime("$year-06-29", new DateTimeZone(self::TIMEZONE)) + ); + + unset($year, $holiday); + } + + /** + * Tests the substitution of new year (1. January) on a weekend. + * Special: no substitution at new year (1. January) on a weekend. + * @throws Exception + * @throws ReflectionException + */ + public function testNewYearNoSubstitution(): void + { + // 2022-01-01 (Saturday) constitutionDay (Новий Рік) + $year = 2022; + $holiday = 'newYearsDay'; + + $this->assertHolidayWithSubstitution( + self::REGION, + $holiday, + $year, + new DateTime("$year-01-01", new DateTimeZone(self::TIMEZONE)) + ); + + unset($year, $holiday); + } + + /** + * Tests the substitution of Catholic Christmas Day (25. December) on a weekend. + * Special: no substitution at Catholic Christmas Day (25. December) on a weekend. + * @throws Exception + * @throws ReflectionException + */ + public function testCatholicChristmasDayNoSubstitution(): void + { + // 2022-12-25 (Sunday) catholicChristmasDay (Католицький день Різдва) + $year = 2022; + $holiday = 'catholicChristmasDay'; + + $this->assertHolidayWithSubstitution( + self::REGION, + $holiday, + $year, + new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + ); + + unset($year, $holiday); + } + + /** + * Dummy: Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTrue(true); + } + + /** + * Dummy: Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertTrue(true); + } + + /** + * Asserts that the expected date is indeed a holiday for that given year and name + * + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $shortName string the short name of the holiday to be checked against + * @param int $year holiday calendar year + * @param DateTime $expected the official date to be checked against + * @param DateTime $expected the substituted date to be checked against + * + * @throws UnknownLocaleException + * @throws InvalidDateException + * @throws InvalidArgumentException + * @throws RuntimeException + * @throws AssertionFailedError + * @throws ReflectionException + */ + public function assertHolidayWithSubstitution( + string $provider, + string $shortName, + int $year, + DateTime $expectedOfficial, + DateTime $expectedSubstitution = null + ): void { + $holidays = Yasumi::create($provider, $year); + + $holidayOfficial = $holidays->getHoliday($shortName); + $this->assertInstanceOf(Holiday::class, $holidayOfficial); + $this->assertNotNull($holidayOfficial); + $this->assertEquals($expectedOfficial, $holidayOfficial); + $this->assertTrue($holidays->isHoliday($holidayOfficial)); + $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); + + $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->shortName); + if ($expectedSubstitution === null) { + // without substitution + $this->assertNull($holidaySubstitution); + } else { + // with substitution + $this->assertNotNull($holidaySubstitution); + $this->assertInstanceOf(SubstituteHoliday::class, $holidaySubstitution); + $this->assertEquals($expectedSubstitution, $holidaySubstitution); + $this->assertTrue($holidays->isHoliday($holidaySubstitution)); + $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidaySubstitution->getType()); + } + + unset($holidayOfficial, $holidaySubstitution, $holidays); + } +} diff --git a/tests/Ukraine/UkraineTest.php b/tests/Ukraine/UkraineTest.php index 6ceb4a95f..6c82c390e 100644 --- a/tests/Ukraine/UkraineTest.php +++ b/tests/Ukraine/UkraineTest.php @@ -1,4 +1,5 @@ assertDefinedHolidays([ + $holidays = [ 'newYearsDay', 'internationalWorkersDay', - 'secondInternationalWorkersDay', 'christmasDay', 'easter', 'pentecost', 'internationalWomensDay', 'victoryDay', - 'constitutionDay', - 'independenceDay', - 'defenderOfUkraineDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 1996) { + $holidays[] = 'constitutionDay'; + } + + if ($this->year >= 1991) { + $holidays[] = 'independenceDay'; + } + + if ($this->year >= 2015) { + $holidays[] = 'defenderOfUkraineDay'; + } + + if ($this->year < 2018) { + $holidays[] = 'secondInternationalWorkersDay'; + } + + if ($this->year >= 2017) { + $holidays[] = 'catholicChristmasDay'; + } + + $this->assertDefinedHolidays( + $holidays, + self::REGION, + $this->year, + Holiday::TYPE_OFFICIAL + ); } /** @@ -88,6 +112,6 @@ public function testOtherHolidays(): void */ protected function setUp(): void { - $this->year = $this->generateRandomYear(2015, 2025); + $this->year = $this->generateRandomYear(); } } From dfaec2cac8b0a5d8adc7749b9bdaaca954d96cb8 Mon Sep 17 00:00:00 2001 From: Marko Kruljac Date: Sun, 16 Feb 2020 12:47:37 +0100 Subject: [PATCH 051/115] Updates to the holidays of Croatia, starting from the year 2020 (#203) * Add updates to the holidays starting from the year 2020 Changes can be found https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html Includes changes to Croatia holidays starting from 2020 --- CHANGELOG.md | 4 + src/Yasumi/Provider/Croatia.php | 85 +++++++++++++---- tests/Croatia/HomelandThanksgivingDayTest.php | 20 +++- tests/Croatia/IndependenceDayTest.php | 24 ++++- tests/Croatia/RemembranceDayTest.php | 94 +++++++++++++++++++ tests/Croatia/StatehoodDayTest.php | 23 ++++- 6 files changed, 224 insertions(+), 26 deletions(-) create mode 100644 tests/Croatia/RemembranceDayTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index dffa5eaea..7821de4ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +- Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Independence Day is no longer an official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) ### Added - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index bc019de60..4b1b38fa2 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -69,34 +69,85 @@ public function initialize(): void ], new DateTime("$this->year-6-22", new DateTimeZone($this->timezone)), $this->locale)); } - /** - * Croatian Statehood Day - */ - if ($this->year >= 1991) { + $this->calculateStatehoodDay(); + $this->calculateHomelandThanksgivingDay(); + $this->calculateIndependenceDay(); + $this->calculateRemembranceDayForHomelandWarVictims(); + } + + /** + * Starting from the year 2020. statehood day is celebrated at a new date + * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + */ + private function calculateStatehoodDay(): void + { + $statehoodDayDate = null; + + if ($this->year >= 1991 && $this->year < 2020) { + $statehoodDayDate = new DateTime("$this->year-6-25", new DateTimeZone($this->timezone)); + } elseif ($this->year >= 2020) { + $statehoodDayDate = new DateTime("$this->year-5-30", new DateTimeZone($this->timezone)); + } + + if ($statehoodDayDate != null) { $this->addHoliday(new Holiday('statehoodDay', [ 'en' => 'Statehood Day', 'hr' => 'Dan državnosti', - ], new DateTime("$this->year-6-25", new DateTimeZone($this->timezone)), $this->locale)); + ], $statehoodDayDate, $this->locale)); } + } - /** - * Homeland Thanksgiving Day - */ - if ($this->year >= 1995) { - $this->addHoliday(new Holiday('homelandThanksgiving', [ - 'en' => 'Homeland Thanksgiving Day', - 'hr' => 'Dan domovinske zahvalnosti', - ], new DateTime("$this->year-8-5", new DateTimeZone($this->timezone)), $this->locale)); + /** + * Starting from the year 2020. Homeland Thanksgiving Day name is slightly changed + * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + */ + private function calculateHomelandThanksgivingDay(): void + { + $names = null; + if ($this->year >= 1995 && $this->year < 2020) { + $names['en'] = 'Homeland Thanksgiving Day'; + $names['hr'] = 'Dan domovinske zahvalnosti'; + } elseif ($this->year >= 2020) { + $names['en'] = 'Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders'; + $names['hr'] = 'Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja'; } - /** - * Independence Day - */ - if ($this->year >= 1991) { + if ($names != null) { + $this->addHoliday(new Holiday( + 'homelandThanksgiving', + $names, + new DateTime("$this->year-8-5", new DateTimeZone($this->timezone)), + $this->locale + )); + } + } + + /** + * Starting from the year 2020. Independence Day is no longer an official holiday, + * but is still remembered under a different name as Croatian Parliament Day (Dan Hrvatskog sabora) + * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + */ + private function calculateIndependenceDay(): void + { + if ($this->year >= 1991 && $this->year < 2020) { $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'hr' => 'Dan neovisnosti', ], new DateTime("$this->year-10-8", new DateTimeZone($this->timezone)), $this->locale)); } } + + /** + * Starting from the year 2020. a new holiday was added + * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + */ + private function calculateRemembranceDayForHomelandWarVictims(): void + { + if ($this->year >= 2020) { + $this->addHoliday(new Holiday('remembranceDay', [ + 'en' => 'Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja', + 'hr' => 'Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje', + ], new DateTime("$this->year-11-18", new DateTimeZone($this->timezone)), $this->locale)); + } + } } diff --git a/tests/Croatia/HomelandThanksgivingDayTest.php b/tests/Croatia/HomelandThanksgivingDayTest.php index 703847e72..24ee36efd 100644 --- a/tests/Croatia/HomelandThanksgivingDayTest.php +++ b/tests/Croatia/HomelandThanksgivingDayTest.php @@ -34,6 +34,11 @@ class HomelandThanksgivingDayTest extends CroatiaBaseTestCase implements YasumiT */ public const ESTABLISHMENT_YEAR = 1995; + /** + * The year in which the holiday name was changed + */ + public const NAME_CHANGED_YEAR = 2020; + /** * Tests Homeland Thanksgiving Day on or after 1995. * @throws Exception @@ -69,11 +74,22 @@ public function testHomelandThanksgivingDayBefore1995() */ public function testTranslation(): void { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::NAME_CHANGED_YEAR - 1); + $expectedText = 'Dan domovinske zahvalnosti'; $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Dan domovinske zahvalnosti'] + $year, + [self::LOCALE => $expectedText] + ); + + $year = $this->generateRandomYear(self::NAME_CHANGED_YEAR); + $expectedText = 'Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja'; + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $year, + [self::LOCALE => $expectedText] ); } diff --git a/tests/Croatia/IndependenceDayTest.php b/tests/Croatia/IndependenceDayTest.php index 13dc5cc62..95a40d791 100644 --- a/tests/Croatia/IndependenceDayTest.php +++ b/tests/Croatia/IndependenceDayTest.php @@ -34,6 +34,11 @@ class IndependenceDayTest extends CroatiaBaseTestCase implements YasumiTestCaseI */ public const ESTABLISHMENT_YEAR = 1991; + /** + * The year after which this is no longer a holiday + */ + public const DISBANDMENT_YEAR = 2020; + /** * Tests Independence Day on or after 1991. * @throws Exception @@ -41,7 +46,7 @@ class IndependenceDayTest extends CroatiaBaseTestCase implements YasumiTestCaseI */ public function testIndependenceDayOnAfter1991() { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DISBANDMENT_YEAR - 1); $this->assertHoliday( self::REGION, self::HOLIDAY, @@ -63,6 +68,19 @@ public function testIndependenceDayBefore1991() ); } + /** + * Tests Independence Day before 1991. + * @throws ReflectionException + */ + public function testIndependenceDayAfterDisbandment() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::DISBANDMENT_YEAR) + ); + } + /** * Tests translated name of Independence Day. * @throws ReflectionException @@ -72,7 +90,7 @@ public function testTranslation(): void $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DISBANDMENT_YEAR - 1), [self::LOCALE => 'Dan neovisnosti'] ); } @@ -86,7 +104,7 @@ public function testHolidayType(): void $this->assertHolidayType( self::REGION, self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DISBANDMENT_YEAR - 1), Holiday::TYPE_OFFICIAL ); } diff --git a/tests/Croatia/RemembranceDayTest.php b/tests/Croatia/RemembranceDayTest.php new file mode 100644 index 000000000..3d58faa0d --- /dev/null +++ b/tests/Croatia/RemembranceDayTest.php @@ -0,0 +1,94 @@ + + */ + +namespace Yasumi\tests\Croatia; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for Statehood Day in Croatia. + */ +class RemembranceDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'remembranceDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 2020; + + /** + * Tests Remembrance Day + * @throws Exception + * @throws ReflectionException + */ + public function testRemembranceDayAfterItWasEstablished() + { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-11-18", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Remembrance Day + * @throws Exception + * @throws ReflectionException + */ + public function testRemembranceDayBeforeItWasEstablished() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of Remembrance Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Croatia/StatehoodDayTest.php b/tests/Croatia/StatehoodDayTest.php index 95429a1cd..a8d1100d2 100644 --- a/tests/Croatia/StatehoodDayTest.php +++ b/tests/Croatia/StatehoodDayTest.php @@ -35,18 +35,33 @@ class StatehoodDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInte public const ESTABLISHMENT_YEAR = 1991; /** - * Tests Statehood Day on or after 1991. + * The year in which the holiday celebration date has changed + */ + public const DATE_CHANGE_YEAR = 2020; + + /** + * Tests Statehood Day * @throws Exception * @throws ReflectionException */ - public function testStatehoodDayOnAfter1991() + public function testStatehoodDay() { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DATE_CHANGE_YEAR - 1); + $expectedDate = "$year-6-25"; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime($expectedDate, new DateTimeZone(self::TIMEZONE)) + ); + + $year = $this->generateRandomYear(self::DATE_CHANGE_YEAR); + $expectedDate = "$year-5-30"; $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-25", new DateTimeZone(self::TIMEZONE)) + new DateTime($expectedDate, new DateTimeZone(self::TIMEZONE)) ); } From 1127c0dc2586455b4fa1cd9f91009ec17a4af888 Mon Sep 17 00:00:00 2001 From: Arkounay Date: Tue, 18 Feb 2020 16:30:11 +0100 Subject: [PATCH 052/115] Added Luxembourg Provider (#205) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Luxembourg.php | 103 ++++++++++++++++++ src/Yasumi/data/translations/allSaintsDay.php | 1 + src/Yasumi/data/translations/ascensionDay.php | 1 + .../data/translations/assumptionOfMary.php | 1 + src/Yasumi/data/translations/christmasDay.php | 1 + src/Yasumi/data/translations/easterMonday.php | 1 + .../translations/internationalWorkersDay.php | 1 + src/Yasumi/data/translations/newYearsDay.php | 1 + .../data/translations/pentecostMonday.php | 7 +- .../data/translations/secondChristmasDay.php | 1 + tests/Luxembourg/AllSaintsDayTest.php | 79 ++++++++++++++ tests/Luxembourg/AscensionDayTest.php | 70 ++++++++++++ tests/Luxembourg/AssumptionOfMaryTest.php | 79 ++++++++++++++ tests/Luxembourg/ChristmasDayTest.php | 79 ++++++++++++++ tests/Luxembourg/EasterMondayTest.php | 70 ++++++++++++ tests/Luxembourg/EuropeDayTest.php | 93 ++++++++++++++++ .../InternationalWorkersDayTest.php | 79 ++++++++++++++ tests/Luxembourg/LuxembourgBaseTestCase.php | 39 +++++++ tests/Luxembourg/LuxembourgTest.php | 92 ++++++++++++++++ tests/Luxembourg/NationalDayTest.php | 79 ++++++++++++++ tests/Luxembourg/NewYearsDayTest.php | 79 ++++++++++++++ tests/Luxembourg/PentecostMondayTest.php | 70 ++++++++++++ tests/Luxembourg/SecondChristmasDayTest.php | 79 ++++++++++++++ 24 files changed, 1103 insertions(+), 3 deletions(-) create mode 100755 src/Yasumi/Provider/Luxembourg.php create mode 100644 tests/Luxembourg/AllSaintsDayTest.php create mode 100644 tests/Luxembourg/AscensionDayTest.php create mode 100644 tests/Luxembourg/AssumptionOfMaryTest.php create mode 100644 tests/Luxembourg/ChristmasDayTest.php create mode 100644 tests/Luxembourg/EasterMondayTest.php create mode 100644 tests/Luxembourg/EuropeDayTest.php create mode 100644 tests/Luxembourg/InternationalWorkersDayTest.php create mode 100644 tests/Luxembourg/LuxembourgBaseTestCase.php create mode 100644 tests/Luxembourg/LuxembourgTest.php create mode 100644 tests/Luxembourg/NationalDayTest.php create mode 100644 tests/Luxembourg/NewYearsDayTest.php create mode 100644 tests/Luxembourg/PentecostMondayTest.php create mode 100644 tests/Luxembourg/SecondChristmasDayTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 7821de4ca..0a6dd65c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) ### Added +- Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php new file mode 100755 index 000000000..d6d179560 --- /dev/null +++ b/src/Yasumi/Provider/Luxembourg.php @@ -0,0 +1,103 @@ +timezone = 'Europe/Luxembourg'; + + // Add common holidays + $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->easterMonday($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->internationalWorkersDay($this->year, $this->timezone, $this->locale)); + $this->calculateEuropeDay(); + $this->addHoliday($this->ascensionDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->pentecostMonday($this->year, $this->timezone, $this->locale)); + $this->calculateNationalDay(); + $this->addHoliday($this->assumptionOfMary($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->christmasDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->secondChristmasDay($this->year, $this->timezone, $this->locale)); + } + + /** + * Europe Day. + * + * Europe Day is celebrated on 5 May by the Council of Europe and on 9 May by the European Union. + * The first recognition of Europe Day was by the Council of Europe, introduced in 1964. + * The European Union later started to celebrate its own European Day in commemoration of the 1950 + * Schuman Declaration, leading it to be referred to by some as "Schuman Day". + * Both days are celebrated by displaying the Flag of Europe. + * + * @link https://en.wikipedia.org/wiki/Europe_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function calculateEuropeDay(): void + { + if ($this->year >= 2019) { + $this->addHoliday(new Holiday('europeDay', [ + 'en_US' => 'Europe day', + 'fr_FR' => 'La Journée de l\'Europe', + 'lu' => 'La Journée de l\'Europe', + ], new DateTime("$this->year-5-9", new DateTimeZone($this->timezone)), $this->locale)); + } + } + + /** + * Luxembourgish National Day. + * + * The Grand Duke's Official Birthday (French: Célébration publique de l'anniversaire du souverain), + * also known as Luxembourgish National Day (French: Fête nationale luxembourgeoise, Luxembourgish: + * Lëtzebuerger Nationalfeierdag), is celebrated as the annual national holiday of Luxembourg. + * It is celebrated on 23 June, although this has never been the actual birthday of any ruler of Luxembourg. + * When the monarch of Luxembourg is female, it is known as the Grand Duchess' Official Birthday. + * + * @link https://en.wikipedia.org/wiki/Grand_Duke%27s_Official_Birthday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function calculateNationalDay(): void + { + $this->addHoliday(new Holiday('nationalDay', [ + 'en_US' => 'National day', + 'fr_FR' => 'La Fête nationale', + 'lu' => 'La Fête nationale', + ], new DateTime("$this->year-6-23", new DateTimeZone($this->timezone)), $this->locale)); + } +} diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php index 84a4aba10..f5e6fc5c3 100755 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -26,6 +26,7 @@ 'it' => 'Festa di Tutti i Santi', 'it_CH' => 'Ognissanti', 'lt' => 'Visų šventųjų diena (Vėlinės)', + 'lu' => 'Toussaint', 'nl' => 'Allerheiligen', 'pl' => 'Uroczystość Wszystkich Świętych', 'pt' => 'Dia de todos os Santos', diff --git a/src/Yasumi/data/translations/ascensionDay.php b/src/Yasumi/data/translations/ascensionDay.php index ecf9ff78e..ee10b670d 100644 --- a/src/Yasumi/data/translations/ascensionDay.php +++ b/src/Yasumi/data/translations/ascensionDay.php @@ -21,6 +21,7 @@ 'fi' => 'Helatorstai', 'fr' => 'Ascension', 'it' => 'Ascensione', + 'lu' => 'Ascension', 'nb' => 'Kristi himmelfartsdag', 'nl' => 'Hemelvaart', 'sv' => 'Kristi himmelsfärdsdag', diff --git a/src/Yasumi/data/translations/assumptionOfMary.php b/src/Yasumi/data/translations/assumptionOfMary.php index b18af1ceb..e61d5895c 100755 --- a/src/Yasumi/data/translations/assumptionOfMary.php +++ b/src/Yasumi/data/translations/assumptionOfMary.php @@ -23,6 +23,7 @@ 'it' => 'Assunzione di Maria Vergine', 'it_CH' => 'Assunzione', 'lt' => 'Žolinė (Švč. Mergelės Marijos ėmimo į dangų diena)', + 'lu' => 'Assomption', 'nl' => 'Onze Lieve Vrouw hemelvaart', 'pl' => 'Wniebowzięcie Najświętszej Marii Panny', 'pt' => 'Assunção de Nossa Senhora', diff --git a/src/Yasumi/data/translations/christmasDay.php b/src/Yasumi/data/translations/christmasDay.php index e9130bbaf..9c4ffcf0e 100755 --- a/src/Yasumi/data/translations/christmasDay.php +++ b/src/Yasumi/data/translations/christmasDay.php @@ -33,6 +33,7 @@ 'it' => 'Natale', 'ko' => '기독탄신일', 'lt' => 'Šv. Kalėdos', + 'lu' => 'Noël', 'lv' => 'Ziemassvētki', 'nb' => 'første juledag', 'nl' => 'eerste kerstdag', diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index a4603bb46..be4f3adb8 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -29,6 +29,7 @@ 'it' => 'Lunedì dell’Angelo', 'it_CH' => 'Lunedi di Pasqua', 'lt' => 'Antroji Velykų diena', + 'lu' => 'Lundi de Pâques', 'lv' => 'Otrās Lieldienas', 'nb' => 'andre påskedag', 'nl_BE' => 'paasmaandag', diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php index b3ef5a30a..7cc183d3a 100755 --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -33,6 +33,7 @@ 'ja' => '労働の日', 'ko' => '노동절', 'lt' => 'Tarptautinė darbo diena', + 'lu' => 'Fête du Travail', 'lv' => 'Darba svētki', 'nb' => 'arbeidernes dag', 'nl' => 'Dag van de arbeid', diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php index 5cfa6dc96..495d8e4c5 100755 --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -34,6 +34,7 @@ 'ja' => '元日', 'ko' => '새해', 'lt' => 'Naujųjų metų diena', + 'lu' => 'Jour de l\'An', 'lv' => 'Jaunais Gads', 'nb' => 'første nyttårsdag', 'nl' => 'Nieuwjaar', diff --git a/src/Yasumi/data/translations/pentecostMonday.php b/src/Yasumi/data/translations/pentecostMonday.php index 4c83c14f4..1f3dd85b8 100755 --- a/src/Yasumi/data/translations/pentecostMonday.php +++ b/src/Yasumi/data/translations/pentecostMonday.php @@ -21,8 +21,9 @@ 'ga' => 'Luan Cincíse', 'hu' => 'Pünkösdhétfő', 'it' => 'Lunedi di Pentecoste', - 'nb' => 'andre pinsedag', - 'nl' => 'tweede pinksterdag', - 'nl_BE' => 'pinkstermaandag', + 'lu' => 'Lundi de Pentecôte', + 'nb' => 'Andre pinsedag', + 'nl' => 'Tweede pinksterdag', + 'nl_BE' => 'Pinkstermaandag', 'ro' => 'A doua zi de Rusalii', ]; diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php index 763cb84c1..e080bfb7e 100755 --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -27,6 +27,7 @@ 'hu' => 'Karácsony másnapja', 'ko' => '성탄절 연휴', 'lt' => 'Kalėdos (antra diena)', + 'lu' => 'Lendemain de Noël', 'lv' => 'Otrie Ziemassvētki', 'nb' => 'andre juledag', 'nl' => 'tweede kerstdag', diff --git a/tests/Luxembourg/AllSaintsDayTest.php b/tests/Luxembourg/AllSaintsDayTest.php new file mode 100644 index 000000000..719868284 --- /dev/null +++ b/tests/Luxembourg/AllSaintsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing All Saints' Day in Luxembourg. + */ +class AllSaintsDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'allSaintsDay'; + + /** + * Tests All Saints' Day. + * + * @dataProvider AllSaintsDayDataProvider + * + * @param int $year the year for which All Saints' Day needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testAllSaintsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Tests translated name of All Saints' Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Toussaint'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } + + /** + * Returns a list of random test dates used for assertion of All Saints' Day. + * + * @return array list of test dates for All Saints' Day + * @throws Exception + */ + public function AllSaintsDayDataProvider(): array + { + return $this->generateRandomDates(11, 1, self::TIMEZONE); + } +} diff --git a/tests/Luxembourg/AscensionDayTest.php b/tests/Luxembourg/AscensionDayTest.php new file mode 100644 index 000000000..8fdbf386e --- /dev/null +++ b/tests/Luxembourg/AscensionDayTest.php @@ -0,0 +1,70 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Ascension Day in Luxembourg. + */ +class AscensionDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'ascensionDay'; + + /** + * Tests Ascension Day. + * @throws Exception + * @throws ReflectionException + */ + public function testAscensionDay() + { + $year = 1901; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests translated name of Ascension Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Ascension'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/AssumptionOfMaryTest.php b/tests/Luxembourg/AssumptionOfMaryTest.php new file mode 100644 index 000000000..277483f6e --- /dev/null +++ b/tests/Luxembourg/AssumptionOfMaryTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing the day of the Assumption of Mary in Luxembourg. + */ +class AssumptionOfMaryTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'assumptionOfMary'; + + /** + * Tests the holiday defined in this test. + * + * @dataProvider HolidayDataProvider + * + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testHoliday($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of the holiday defined in this test + * + * @return array list of test dates for the holiday defined in this test + * @throws Exception + */ + public function HolidayDataProvider(): array + { + return $this->generateRandomDates(8, 15, self::TIMEZONE); + } + + /** + * Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Assomption'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/ChristmasDayTest.php b/tests/Luxembourg/ChristmasDayTest.php new file mode 100644 index 000000000..1b242dca9 --- /dev/null +++ b/tests/Luxembourg/ChristmasDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Christmas in Luxembourg. + */ +class ChristmasDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'christmasDay'; + + /** + * Tests Christmas Day. + * + * @dataProvider ChristmasDayDataProvider + * + * @param int $year the year for which Christmas Day needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testChristmasDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of Christmas Day. + * + * @return array list of test dates for Christmas Day + * @throws Exception + */ + public function ChristmasDayDataProvider(): array + { + return $this->generateRandomDates(12, 25, self::TIMEZONE); + } + + /** + * Tests translated name of Christmas Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Noël'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/EasterMondayTest.php b/tests/Luxembourg/EasterMondayTest.php new file mode 100644 index 000000000..a9e5b3bb8 --- /dev/null +++ b/tests/Luxembourg/EasterMondayTest.php @@ -0,0 +1,70 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for Easter Monday in Luxembourg. + */ +class EasterMondayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'easterMonday'; + + /** + * Tests Easter Monday. + * @throws Exception + * @throws ReflectionException + */ + public function testEasterMonday() + { + $year = 2016; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests translated name of Easter Monday. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Lundi de Pâques'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/EuropeDayTest.php b/tests/Luxembourg/EuropeDayTest.php new file mode 100644 index 000000000..3836f8f67 --- /dev/null +++ b/tests/Luxembourg/EuropeDayTest.php @@ -0,0 +1,93 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for Europe Day in Luxembourg. + */ +class EuropeDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'europeDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 2019; + + /** + * Tests Europe Day on or after 2019. + * @throws Exception + * @throws ReflectionException + */ + public function testEuropeDayOnAfter2019() + { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-5-9", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Europe Day before 2019. + * @throws ReflectionException + */ + public function testEuropeDayBefore2019() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of Europe Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'La Journée de l\'Europe'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Luxembourg/InternationalWorkersDayTest.php b/tests/Luxembourg/InternationalWorkersDayTest.php new file mode 100644 index 000000000..735de22c2 --- /dev/null +++ b/tests/Luxembourg/InternationalWorkersDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for International Workers' Day (i.e. Labour Day) in Luxembourg. + */ +class InternationalWorkersDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'internationalWorkersDay'; + + /** + * Tests International Workers' Day. + * + * @dataProvider InternationalWorkersDayDataProvider + * + * @param int $year the year for which International Workers' Day needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testInternationalWorkersDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Tests translated name of International Workers' Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Fête du Travail'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } + + /** + * Returns a list of random test dates used for assertion of International Workers' Day. + * + * @return array list of test dates for International Workers' Day + * @throws Exception + */ + public function InternationalWorkersDayDataProvider(): array + { + return $this->generateRandomDates(5, 1, self::TIMEZONE); + } +} diff --git a/tests/Luxembourg/LuxembourgBaseTestCase.php b/tests/Luxembourg/LuxembourgBaseTestCase.php new file mode 100644 index 000000000..12474f1f8 --- /dev/null +++ b/tests/Luxembourg/LuxembourgBaseTestCase.php @@ -0,0 +1,39 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use PHPUnit\Framework\TestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the France holiday provider. + */ +abstract class LuxembourgBaseTestCase extends TestCase +{ + use YasumiBase; + + /** + * Country (name) to be tested + */ + public const REGION = 'Luxembourg'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'Europe/Luxembourg'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'lu'; +} diff --git a/tests/Luxembourg/LuxembourgTest.php b/tests/Luxembourg/LuxembourgTest.php new file mode 100644 index 000000000..ab5727d76 --- /dev/null +++ b/tests/Luxembourg/LuxembourgTest.php @@ -0,0 +1,92 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\Provider\Luxembourg; + +/** + * Class for testing holidays in Luxembourg. + */ +class LuxembourgTest extends LuxembourgBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Luxembourg are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $holidays = [ + 'newYearsDay', + 'easterMonday', + 'internationalWorkersDay', + 'ascensionDay', + 'pentecostMonday', + 'nationalDay', + 'assumptionOfMary', + 'allSaintsDay', + 'christmasDay', + 'secondChristmasDay', + ]; + + $year = $this->generateRandomYear(); + + if ($year >= Luxembourg::EUROPE_DAY_START_YEAR) { + $holidays[] = 'europeDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Luxembourg are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->generateRandomYear(), Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Luxembourg are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->generateRandomYear(), Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Luxembourg are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->generateRandomYear(), Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Luxembourg are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->generateRandomYear(), Holiday::TYPE_OTHER); + } +} diff --git a/tests/Luxembourg/NationalDayTest.php b/tests/Luxembourg/NationalDayTest.php new file mode 100644 index 000000000..4103f8787 --- /dev/null +++ b/tests/Luxembourg/NationalDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing the National Day of Luxembourg. + */ +class NationalDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'nationalDay'; + + /** + * Tests the holiday defined in this test. + * + * @dataProvider HolidayDataProvider + * + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testHoliday($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of the holiday defined in this test + * + * @return array list of test dates for the holiday defined in this test + * @throws Exception + */ + public function HolidayDataProvider(): array + { + return $this->generateRandomDates(6, 23, self::TIMEZONE); + } + + /** + * Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'La Fête nationale'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/NewYearsDayTest.php b/tests/Luxembourg/NewYearsDayTest.php new file mode 100644 index 000000000..97d3cbf5f --- /dev/null +++ b/tests/Luxembourg/NewYearsDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for New Years Day in France. + */ +class NewYearsDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'newYearsDay'; + + /** + * Tests New Years Day. + * + * @dataProvider NewYearsDayDataProvider + * + * @param int $year the year for which New Years Day needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testNewYearsDay($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Tests translated name of New Years Day. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Jour de l\'An'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } + + /** + * Returns a list of random test dates used for assertion of New Years Day. + * + * @return array list of test dates for New Years Day + * @throws Exception + */ + public function NewYearsDayDataProvider(): array + { + return $this->generateRandomDates(1, 1, self::TIMEZONE); + } +} diff --git a/tests/Luxembourg/PentecostMondayTest.php b/tests/Luxembourg/PentecostMondayTest.php new file mode 100644 index 000000000..7a86a32a2 --- /dev/null +++ b/tests/Luxembourg/PentecostMondayTest.php @@ -0,0 +1,70 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Pentecost Monday in Luxembourg. + */ +class PentecostMondayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'pentecostMonday'; + + /** + * Tests Pentecost Monday. + * @throws Exception + * @throws ReflectionException + */ + public function testPentecostMonday() + { + $year = 1977; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests translated name of Pentecost Monday. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Lundi de Pentecôte'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Luxembourg/SecondChristmasDayTest.php b/tests/Luxembourg/SecondChristmasDayTest.php new file mode 100644 index 000000000..297f0831c --- /dev/null +++ b/tests/Luxembourg/SecondChristmasDayTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Luxembourg; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing the Second Christmas Day in Luxembourg. + */ +class SecondChristmasDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'secondChristmasDay'; + + /** + * Tests the holiday defined in this test. + * + * @dataProvider HolidayDataProvider + * + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testHoliday($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of the holiday defined in this test + * + * @return array list of test dates for the holiday defined in this test + * @throws Exception + */ + public function HolidayDataProvider(): array + { + return $this->generateRandomDates(12, 26, self::TIMEZONE); + } + + /** + * Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Lendemain de Noël'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} From 6c53b0d9104aab31dad8632edc4c4bb8379f6f6e Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 4 Mar 2020 22:04:30 +0900 Subject: [PATCH 053/115] Create stale.yml --- .github/workflows/stale.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..5deeb3bf9 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has been open 30 days with no activity. Please remove the stale label or comment, or this will be closed in 5 days' + stale-pr-message: 'This pull request has been open 30 days with no activity. Please remove the stale label or comment, or this will be closed in 5 days' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + days-before-stale: 30 + days-before-close: 5 From 80ec54727dbe10b73f6ae8876bb0fc21e52f19dd Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 4 Mar 2020 22:19:04 +0900 Subject: [PATCH 054/115] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 56 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index cb48dfbfe..48cdd3a95 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,11 +2,17 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. ## Our Standards -Examples of behavior that contributes to creating a positive environment include: +Examples of behavior that contributes to creating a positive environment +include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences @@ -16,31 +22,55 @@ Examples of behavior that contributes to creating a positive environment include Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances +* The use of sexualized language or imagery and unwelcome sexual attention or + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at me@sachatelgenhof.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at me@sachatelgenhof.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html -[homepage]: https://contributor-covenant.org -[version]: https://contributor-covenant.org/version/1/4/ +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 4793a282237c05e107d7729c46a8ab12c1ed8441 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Thu, 5 Mar 2020 11:13:03 +0900 Subject: [PATCH 055/115] Increased the days The default number of days is a bit short, as activity is usually low. --- .github/workflows/stale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5deeb3bf9..7d6e7df7d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,9 +13,9 @@ jobs: - uses: actions/stale@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been open 30 days with no activity. Please remove the stale label or comment, or this will be closed in 5 days' - stale-pr-message: 'This pull request has been open 30 days with no activity. Please remove the stale label or comment, or this will be closed in 5 days' + stale-issue-message: 'This issue has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.' + stale-pr-message: 'This pull request has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.' stale-issue-label: 'no-issue-activity' stale-pr-label: 'no-pr-activity' - days-before-stale: 30 - days-before-close: 5 + days-before-stale: 60 + days-before-close: 10 From 5324c0881447bd168de10bed2ad9ae593ba5476b Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Thu, 12 Mar 2020 15:37:32 +0100 Subject: [PATCH 056/115] Use fr_LU as locale identifier for Luxembourg (#209) --- src/Yasumi/Provider/Luxembourg.php | 6 ++---- src/Yasumi/data/translations/allSaintsDay.php | 1 - src/Yasumi/data/translations/ascensionDay.php | 1 - src/Yasumi/data/translations/assumptionOfMary.php | 1 - src/Yasumi/data/translations/christmasDay.php | 1 - src/Yasumi/data/translations/easterMonday.php | 1 - src/Yasumi/data/translations/internationalWorkersDay.php | 1 - src/Yasumi/data/translations/newYearsDay.php | 1 - src/Yasumi/data/translations/pentecostMonday.php | 7 +++---- src/Yasumi/data/translations/secondChristmasDay.php | 1 - tests/Luxembourg/EuropeDayTest.php | 2 +- tests/Luxembourg/LuxembourgBaseTestCase.php | 2 +- tests/Luxembourg/NewYearsDayTest.php | 2 +- 13 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php index d6d179560..f40e46ed6 100755 --- a/src/Yasumi/Provider/Luxembourg.php +++ b/src/Yasumi/Provider/Luxembourg.php @@ -70,8 +70,7 @@ public function calculateEuropeDay(): void if ($this->year >= 2019) { $this->addHoliday(new Holiday('europeDay', [ 'en_US' => 'Europe day', - 'fr_FR' => 'La Journée de l\'Europe', - 'lu' => 'La Journée de l\'Europe', + 'fr' => 'La Journée de l’Europe', ], new DateTime("$this->year-5-9", new DateTimeZone($this->timezone)), $this->locale)); } } @@ -96,8 +95,7 @@ public function calculateNationalDay(): void { $this->addHoliday(new Holiday('nationalDay', [ 'en_US' => 'National day', - 'fr_FR' => 'La Fête nationale', - 'lu' => 'La Fête nationale', + 'fr' => 'La Fête nationale', ], new DateTime("$this->year-6-23", new DateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php index f5e6fc5c3..84a4aba10 100755 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -26,7 +26,6 @@ 'it' => 'Festa di Tutti i Santi', 'it_CH' => 'Ognissanti', 'lt' => 'Visų šventųjų diena (Vėlinės)', - 'lu' => 'Toussaint', 'nl' => 'Allerheiligen', 'pl' => 'Uroczystość Wszystkich Świętych', 'pt' => 'Dia de todos os Santos', diff --git a/src/Yasumi/data/translations/ascensionDay.php b/src/Yasumi/data/translations/ascensionDay.php index ee10b670d..ecf9ff78e 100644 --- a/src/Yasumi/data/translations/ascensionDay.php +++ b/src/Yasumi/data/translations/ascensionDay.php @@ -21,7 +21,6 @@ 'fi' => 'Helatorstai', 'fr' => 'Ascension', 'it' => 'Ascensione', - 'lu' => 'Ascension', 'nb' => 'Kristi himmelfartsdag', 'nl' => 'Hemelvaart', 'sv' => 'Kristi himmelsfärdsdag', diff --git a/src/Yasumi/data/translations/assumptionOfMary.php b/src/Yasumi/data/translations/assumptionOfMary.php index e61d5895c..b18af1ceb 100755 --- a/src/Yasumi/data/translations/assumptionOfMary.php +++ b/src/Yasumi/data/translations/assumptionOfMary.php @@ -23,7 +23,6 @@ 'it' => 'Assunzione di Maria Vergine', 'it_CH' => 'Assunzione', 'lt' => 'Žolinė (Švč. Mergelės Marijos ėmimo į dangų diena)', - 'lu' => 'Assomption', 'nl' => 'Onze Lieve Vrouw hemelvaart', 'pl' => 'Wniebowzięcie Najświętszej Marii Panny', 'pt' => 'Assunção de Nossa Senhora', diff --git a/src/Yasumi/data/translations/christmasDay.php b/src/Yasumi/data/translations/christmasDay.php index 9c4ffcf0e..e9130bbaf 100755 --- a/src/Yasumi/data/translations/christmasDay.php +++ b/src/Yasumi/data/translations/christmasDay.php @@ -33,7 +33,6 @@ 'it' => 'Natale', 'ko' => '기독탄신일', 'lt' => 'Šv. Kalėdos', - 'lu' => 'Noël', 'lv' => 'Ziemassvētki', 'nb' => 'første juledag', 'nl' => 'eerste kerstdag', diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index be4f3adb8..a4603bb46 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -29,7 +29,6 @@ 'it' => 'Lunedì dell’Angelo', 'it_CH' => 'Lunedi di Pasqua', 'lt' => 'Antroji Velykų diena', - 'lu' => 'Lundi de Pâques', 'lv' => 'Otrās Lieldienas', 'nb' => 'andre påskedag', 'nl_BE' => 'paasmaandag', diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php index 7cc183d3a..b3ef5a30a 100755 --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -33,7 +33,6 @@ 'ja' => '労働の日', 'ko' => '노동절', 'lt' => 'Tarptautinė darbo diena', - 'lu' => 'Fête du Travail', 'lv' => 'Darba svētki', 'nb' => 'arbeidernes dag', 'nl' => 'Dag van de arbeid', diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php index 495d8e4c5..5cfa6dc96 100755 --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -34,7 +34,6 @@ 'ja' => '元日', 'ko' => '새해', 'lt' => 'Naujųjų metų diena', - 'lu' => 'Jour de l\'An', 'lv' => 'Jaunais Gads', 'nb' => 'første nyttårsdag', 'nl' => 'Nieuwjaar', diff --git a/src/Yasumi/data/translations/pentecostMonday.php b/src/Yasumi/data/translations/pentecostMonday.php index 1f3dd85b8..4c83c14f4 100755 --- a/src/Yasumi/data/translations/pentecostMonday.php +++ b/src/Yasumi/data/translations/pentecostMonday.php @@ -21,9 +21,8 @@ 'ga' => 'Luan Cincíse', 'hu' => 'Pünkösdhétfő', 'it' => 'Lunedi di Pentecoste', - 'lu' => 'Lundi de Pentecôte', - 'nb' => 'Andre pinsedag', - 'nl' => 'Tweede pinksterdag', - 'nl_BE' => 'Pinkstermaandag', + 'nb' => 'andre pinsedag', + 'nl' => 'tweede pinksterdag', + 'nl_BE' => 'pinkstermaandag', 'ro' => 'A doua zi de Rusalii', ]; diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php index e080bfb7e..763cb84c1 100755 --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -27,7 +27,6 @@ 'hu' => 'Karácsony másnapja', 'ko' => '성탄절 연휴', 'lt' => 'Kalėdos (antra diena)', - 'lu' => 'Lendemain de Noël', 'lv' => 'Otrie Ziemassvētki', 'nb' => 'andre juledag', 'nl' => 'tweede kerstdag', diff --git a/tests/Luxembourg/EuropeDayTest.php b/tests/Luxembourg/EuropeDayTest.php index 3836f8f67..0a3fdfe83 100644 --- a/tests/Luxembourg/EuropeDayTest.php +++ b/tests/Luxembourg/EuropeDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'La Journée de l\'Europe'] + [self::LOCALE => 'La Journée de l’Europe'] ); } diff --git a/tests/Luxembourg/LuxembourgBaseTestCase.php b/tests/Luxembourg/LuxembourgBaseTestCase.php index 12474f1f8..fa0c4645a 100644 --- a/tests/Luxembourg/LuxembourgBaseTestCase.php +++ b/tests/Luxembourg/LuxembourgBaseTestCase.php @@ -35,5 +35,5 @@ abstract class LuxembourgBaseTestCase extends TestCase /** * Locale that is considered common for this provider */ - public const LOCALE = 'lu'; + public const LOCALE = 'fr_LU'; } diff --git a/tests/Luxembourg/NewYearsDayTest.php b/tests/Luxembourg/NewYearsDayTest.php index 97d3cbf5f..1ecbf48de 100644 --- a/tests/Luxembourg/NewYearsDayTest.php +++ b/tests/Luxembourg/NewYearsDayTest.php @@ -53,7 +53,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Jour de l\'An'] + [self::LOCALE => 'Jour de l’An'] ); } From 32b8c634165e1a78b3cb6fc14671eb294073ecf0 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 15 Mar 2020 13:20:04 +0100 Subject: [PATCH 057/115] Update translation for fr_LU and fr_CA (#211) * Update translation for fr_LU and fr_CA * Update translation for fr_LU --- src/Yasumi/data/translations/secondChristmasDay.php | 4 +++- tests/Luxembourg/SecondChristmasDayTest.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php index 763cb84c1..3e45b5071 100755 --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -23,7 +23,9 @@ 'en_ZA' => 'Day of Goodwill', 'et' => 'Teine Jõulupüha', 'fi' => '2. joulupäivä', - 'fr' => 'Lendemain de Noël', + 'fr' => 'Saint-Étienne', + 'fr_CA' => 'Lendemain de Noël', + 'fr_LU' => 'Deuxième jour de Noël', 'hu' => 'Karácsony másnapja', 'ko' => '성탄절 연휴', 'lt' => 'Kalėdos (antra diena)', diff --git a/tests/Luxembourg/SecondChristmasDayTest.php b/tests/Luxembourg/SecondChristmasDayTest.php index 297f0831c..5981a4549 100644 --- a/tests/Luxembourg/SecondChristmasDayTest.php +++ b/tests/Luxembourg/SecondChristmasDayTest.php @@ -64,7 +64,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(), - [self::LOCALE => 'Lendemain de Noël'] + [self::LOCALE => 'Deuxième jour de Noël'] ); } From 51aed0e43f4e9f4bd59803624dbf7bbe90f9fbd7 Mon Sep 17 00:00:00 2001 From: Pierrick V Date: Wed, 29 Apr 2020 12:46:26 +0200 Subject: [PATCH 058/115] Save CPU time resources on DateTimeZone creation (#213) Co-authored-by: Pierrick VIGNAND --- src/Yasumi/Provider/Australia.php | 11 ++-- src/Yasumi/Provider/Australia/ACT.php | 10 ++-- src/Yasumi/Provider/Australia/NSW.php | 8 +-- src/Yasumi/Provider/Australia/NT.php | 8 +-- src/Yasumi/Provider/Australia/Queensland.php | 8 +-- .../Australia/Queensland/Brisbane.php | 4 +- src/Yasumi/Provider/Australia/SA.php | 10 ++-- src/Yasumi/Provider/Australia/Tasmania.php | 8 +-- .../Australia/Tasmania/CentralNorth.php | 4 +- .../Australia/Tasmania/FlindersIsland.php | 4 +- .../Australia/Tasmania/KingIsland.php | 4 +- .../Provider/Australia/Tasmania/Northeast.php | 4 +- .../Provider/Australia/Tasmania/Northwest.php | 4 +- .../Tasmania/Northwest/CircularHead.php | 4 +- .../Provider/Australia/Tasmania/South.php | 4 +- .../Australia/Tasmania/South/Southeast.php | 4 +- src/Yasumi/Provider/Australia/Victoria.php | 10 ++-- src/Yasumi/Provider/Australia/WA.php | 8 +-- src/Yasumi/Provider/Belgium.php | 3 +- src/Yasumi/Provider/Bosnia.php | 11 ++-- src/Yasumi/Provider/Brazil.php | 11 ++-- src/Yasumi/Provider/ChristianHolidays.php | 31 ++++++----- src/Yasumi/Provider/CommonHolidays.php | 25 +++++---- src/Yasumi/Provider/Croatia.php | 13 +++-- src/Yasumi/Provider/DateTimeZoneFactory.php | 33 ++++++++++++ src/Yasumi/Provider/Denmark.php | 5 +- src/Yasumi/Provider/Finland.php | 7 ++- src/Yasumi/Provider/France.php | 3 +- src/Yasumi/Provider/Germany/Berlin.php | 4 +- src/Yasumi/Provider/Germany/Saxony.php | 4 +- src/Yasumi/Provider/Greece.php | 9 ++-- src/Yasumi/Provider/Hungary.php | 7 ++- src/Yasumi/Provider/Ireland.php | 15 +++--- src/Yasumi/Provider/Italy.php | 5 +- src/Yasumi/Provider/Japan.php | 51 +++++++++---------- src/Yasumi/Provider/Luxembourg.php | 5 +- src/Yasumi/Provider/Netherlands.php | 17 +++---- src/Yasumi/Provider/NewZealand.php | 17 +++---- src/Yasumi/Provider/Norway.php | 3 +- src/Yasumi/Provider/Poland.php | 5 +- src/Yasumi/Provider/Portugal.php | 9 ++-- src/Yasumi/Provider/Romania.php | 15 +++--- src/Yasumi/Provider/Slovakia.php | 13 +++-- src/Yasumi/Provider/SouthAfrica.php | 17 +++---- src/Yasumi/Provider/SouthKorea.php | 29 +++++------ src/Yasumi/Provider/Spain.php | 5 +- src/Yasumi/Provider/Spain/Andalusia.php | 4 +- src/Yasumi/Provider/Spain/Asturias.php | 4 +- src/Yasumi/Provider/Spain/BalearicIslands.php | 4 +- src/Yasumi/Provider/Spain/BasqueCountry.php | 4 +- src/Yasumi/Provider/Spain/CanaryIslands.php | 4 +- src/Yasumi/Provider/Spain/Cantabria.php | 4 +- src/Yasumi/Provider/Spain/CastileAndLeon.php | 4 +- .../Provider/Spain/CastillaLaMancha.php | 4 +- src/Yasumi/Provider/Spain/Catalonia.php | 4 +- src/Yasumi/Provider/Spain/Ceuta.php | 4 +- .../Provider/Spain/CommunityOfMadrid.php | 4 +- src/Yasumi/Provider/Spain/Extremadura.php | 4 +- src/Yasumi/Provider/Spain/Galicia.php | 6 +-- src/Yasumi/Provider/Spain/LaRioja.php | 4 +- src/Yasumi/Provider/Spain/RegionOfMurcia.php | 4 +- .../Provider/Spain/ValencianCommunity.php | 4 +- src/Yasumi/Provider/Sweden.php | 11 ++-- src/Yasumi/Provider/Switzerland.php | 9 ++-- src/Yasumi/Provider/Switzerland/Geneva.php | 6 +-- src/Yasumi/Provider/Switzerland/Glarus.php | 4 +- src/Yasumi/Provider/Switzerland/Jura.php | 4 +- src/Yasumi/Provider/Switzerland/Neuchatel.php | 4 +- src/Yasumi/Provider/Switzerland/Obwalden.php | 6 +-- src/Yasumi/Provider/Switzerland/Ticino.php | 4 +- src/Yasumi/Provider/USA.php | 23 ++++----- src/Yasumi/Provider/UnitedKingdom.php | 17 +++---- .../UnitedKingdom/NorthernIreland.php | 6 +-- .../Provider/UnitedKingdom/Scotland.php | 8 +-- 74 files changed, 330 insertions(+), 327 deletions(-) create mode 100644 src/Yasumi/Provider/DateTimeZoneFactory.php diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index 4e08f9eb0..8760dc629 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -70,7 +69,7 @@ public function initialize(): void */ private function calculateNewYearHolidays(): void { - $newyearsday = new DateTime("$this->year-01-01", new DateTimeZone($this->timezone)); + $newyearsday = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->calculateHoliday('newYearsDay', $newyearsday, [], false, false); switch ($newyearsday->format('w')) { case 0: // sunday @@ -135,7 +134,7 @@ public function calculateHoliday( */ private function calculateAustraliaDay(): void { - $date = new DateTime("$this->year-01-26", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-01-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->calculateHoliday('australiaDay', $date, ['en' => 'Australia Day']); } @@ -162,7 +161,7 @@ private function calculateAnzacDay(): void return; } - $date = new DateTime("$this->year-04-25", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->calculateHoliday('anzacDay', $date, [], false, false); $easter = $this->calculateEaster($this->year, $this->timezone); @@ -191,8 +190,8 @@ private function calculateAnzacDay(): void */ private function calculateChristmasDay(): void { - $christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone)); - $boxingDay = new DateTime("$this->year-12-26", new DateTimeZone($this->timezone)); + $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $boxingDay = new DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); $this->calculateHoliday('secondChristmasDay', $boxingDay, [], false, false); diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index 6c0429e22..8566794a4 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Australian Capital Territory (Australia). @@ -143,7 +143,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -157,7 +157,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -175,7 +175,7 @@ private function calculateCanberraDay(): void new Holiday( 'canberraDay', ['en' => 'Canberra Day'], - new DateTime($datePattern, new DateTimeZone($this->timezone)), + new DateTime($datePattern, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ) ); @@ -192,7 +192,7 @@ private function calculateReconciliationDay(): void return; } - $date = new DateTime($this->year . '-05-27', new DateTimeZone($this->timezone)); + $date = new DateTime($this->year . '-05-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)); $day = (int)$date->format('w'); if (1 !== $day) { $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P' . (8 - $day) . 'D')); diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NSW.php index 3c5d73c36..8ee2b06f8 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NSW.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in New South Wales (Australia). @@ -106,7 +106,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -120,7 +120,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -135,7 +135,7 @@ private function calculateBankHoliday(): void { $this->calculateHoliday( 'bankHoliday', - new DateTime('first monday of august ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Bank Holiday'], false, false, diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NT.php index b400f7be6..2953fdfce 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NT.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Northern Territory (Australia). @@ -105,7 +105,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -119,7 +119,7 @@ private function calculateQueensBirthday(): void */ private function calculateMayDay(): void { - $date = new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('mayDay', ['en' => 'May Day'], $date, $this->locale)); } @@ -136,7 +136,7 @@ private function calculatePicnicDay(): void { $this->calculateHoliday( 'picnicDay', - new DateTime('first monday of august ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Picnic Day'], false, false diff --git a/src/Yasumi/Provider/Australia/Queensland.php b/src/Yasumi/Provider/Australia/Queensland.php index 6ad30542d..bf94ea364 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Australia; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Queensland (Australia). @@ -72,7 +72,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', - new DateTime($birthDay, new DateTimeZone($this->timezone)), + new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -86,9 +86,9 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if (2013 === $this->year || 2014 === $this->year || 2015 === $this->year) { - $date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); diff --git a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php index 13432aace..33792a533 100644 --- a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php +++ b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Queensland; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Brisbane (Australia). @@ -67,7 +67,7 @@ public function initialize(): void */ private function calculatePeoplesDay(): void { - $date = new DateTime('first friday of august ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('first friday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($date->format('d') < 5) { $date = $date->add(new DateInterval('P7D')); } diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index a9c228618..0df4ba8ac 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in South Australia (Australia). @@ -113,7 +113,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -127,7 +127,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', ['en' => 'Labour Day'], $date, $this->locale)); } @@ -151,7 +151,7 @@ private function calculateAdelaideCupDay(): void $this->calculateHoliday( 'adelaideCup', - new DateTime($cupDay, new DateTimeZone($this->timezone)), + new DateTime($cupDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Adelaide Cup'], false, false @@ -166,7 +166,7 @@ private function calculateAdelaideCupDay(): void */ private function calculateProclamationDay(): void { - $christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone)); + $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); switch ($christmasDay->format('w')) { case 0: // sunday diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index 681556ab3..9da36a0f2 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Australia; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Tasmania (Australia). @@ -55,7 +55,7 @@ public function initialize(): void */ private function calculateEightHoursDay(): void { - $date = new DateTime("second monday of march $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('eightHourDay', ['en' => 'Eight Hour Day'], $date, $this->locale)); } @@ -79,7 +79,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -98,7 +98,7 @@ private function calculateRecreationDay(): void { $this->calculateHoliday( 'recreationDay', - new DateTime('first monday of november ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('first monday of november ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Recreation Day'], false, false diff --git a/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php b/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php index 599f8738d..6cd5fb86c 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php +++ b/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Australia\Tasmania; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in central north Tasmania (Australia). @@ -52,7 +52,7 @@ public function initialize(): void */ private function calculateDevonportShow(): void { - $date = new DateTime($this->year . '-12-02', new DateTimeZone($this->timezone)); + $date = new DateTime($this->year . '-12-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->modify('previous friday'); $this->addHoliday(new Holiday('devonportShow', ['en' => 'Devonport Show'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php index 6d13e38cb..3b05cf76e 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Flinders Island (Australia). @@ -53,7 +53,7 @@ public function initialize(): void */ private function calculateFlindersIslandShow(): void { - $date = new DateTime('third saturday of october ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('third saturday of october ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->sub(new DateInterval('P1D')); $this->addHoliday(new Holiday('flindersIslandShow', ['en' => 'Flinders Island Show'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php index fffabbb39..59772daf6 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php @@ -13,9 +13,9 @@ namespace Yasumi\Provider\Australia\Tasmania; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in King Island (Australia). @@ -53,7 +53,7 @@ private function calculateKingIslandShow(): void { $this->calculateHoliday( 'kingIslandShow', - new DateTime('first tuesday of march ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('first tuesday of march ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'King Island Show'], false, false diff --git a/src/Yasumi/Provider/Australia/Tasmania/Northeast.php b/src/Yasumi/Provider/Australia/Tasmania/Northeast.php index 1502d6282..fd6a3ff24 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northeast.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in northeastern Tasmania (Australia). @@ -53,7 +53,7 @@ public function initialize(): void */ private function calculateLauncestonShow(): void { - $date = new DateTime('second saturday of october ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('second saturday of october ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->sub(new DateInterval('P2D')); $this->addHoliday(new Holiday('launcestonShow', ['en' => 'Royal Launceston Show'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/Northwest.php b/src/Yasumi/Provider/Australia/Tasmania/Northwest.php index eaac5e36b..a5374294c 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in northwestern Tasmania (Australia). @@ -53,7 +53,7 @@ public function initialize(): void */ private function calculateBurnieShow(): void { - $date = new DateTime('first saturday of october ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('first saturday of october ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->sub(new DateInterval('P1D')); $this->addHoliday(new Holiday('burnieShow', ['en' => 'Burnie Show'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php b/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php index beb033f88..8e7571bba 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania\Northwest; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Circular Head (Australia). @@ -53,7 +53,7 @@ public function initialize(): void */ private function calculateAGFEST(): void { - $date = new DateTime('first thursday of may ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('first thursday of may ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->add(new DateInterval('P1D')); $this->addHoliday(new Holiday('agfest', ['en' => 'AGFEST'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/South.php b/src/Yasumi/Provider/Australia/Tasmania/South.php index ad72fcb6b..3e5c1a0ad 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in southern Tasmania (Australia). @@ -53,7 +53,7 @@ public function initialize(): void */ private function calculateHobartShow(): void { - $date = new DateTime('fourth saturday of october ' . $this->year, new DateTimeZone($this->timezone)); + $date = new DateTime('fourth saturday of october ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->sub(new DateInterval('P2D')); $this->addHoliday(new Holiday('hobartShow', ['en' => 'Royal Hobart Show'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php index 3211858cf..2887ad2ae 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php @@ -13,9 +13,9 @@ namespace Yasumi\Provider\Australia\Tasmania\South; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Australia\Tasmania\South; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in southeastern Tasmania (Australia). @@ -56,7 +56,7 @@ private function calculateHobartRegatta(): void { $this->calculateHoliday( 'hobartRegatta', - new DateTime('second monday of february ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of february ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Royal Hobart Regatta'], false, false diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index 6392d5b83..50eb34216 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Victoria (Australia). @@ -131,7 +131,7 @@ private function easterSaturday( */ private function calculateLabourDay(): void { - $date = new DateTime("second monday of march $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -155,7 +155,7 @@ private function calculateQueensBirthday(): void { $this->calculateHoliday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -169,7 +169,7 @@ private function calculateQueensBirthday(): void */ private function calculateMelbourneCupDay(): void { - $date = new DateTime('first Tuesday of November' . " $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime('first Tuesday of November' . " $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('melbourneCup', ['en' => 'Melbourne Cup'], $date, $this->locale)); } @@ -204,7 +204,7 @@ private function calculateAFLGrandFinalDay(): void return; } - $date = new DateTime($aflGrandFinalFriday, new DateTimeZone($this->timezone)); + $date = new DateTime($aflGrandFinalFriday, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'aflGrandFinalFriday', diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WA.php index 9a8bb04cb..f0e6dceb6 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WA.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Australia; use DateTime; -use DateTimeZone; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; +use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Western Australia (Australia). @@ -76,7 +76,7 @@ private function calculateQueensBirthday(): void $this->calculateHoliday( 'queensBirthday', - new DateTime($birthDay, new DateTimeZone($this->timezone)), + new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], false, false @@ -90,7 +90,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of march $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("first monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -107,7 +107,7 @@ private function calculateWesternAustraliaDay(): void { $this->calculateHoliday( 'westernAustraliaDay', - new DateTime('first monday of june ' . $this->year, new DateTimeZone($this->timezone)), + new DateTime('first monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Western Australia Day'], false, false diff --git a/src/Yasumi/Provider/Belgium.php b/src/Yasumi/Provider/Belgium.php index 23ae25505..aa7f4179c 100755 --- a/src/Yasumi/Provider/Belgium.php +++ b/src/Yasumi/Provider/Belgium.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -67,6 +66,6 @@ public function initialize(): void 'fr' => 'Fête nationale', 'en' => 'Belgian National Day', 'nl' => 'nationale feestdag', - ], new DateTime("$this->year-7-21", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-7-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Bosnia.php b/src/Yasumi/Provider/Bosnia.php index d8aee8f87..abd2b131e 100644 --- a/src/Yasumi/Provider/Bosnia.php +++ b/src/Yasumi/Provider/Bosnia.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -59,7 +58,7 @@ public function initialize(): void $this->addHoliday(new Holiday('orthodoxChristmasDay', [ 'en' => 'Orthodox Christmas Day', 'bs_Latn' => 'Pravoslavni Božić', - ], new DateTime("{$this->year}-01-07", new DateTimeZone($this->timezone)))); + ], new DateTime("{$this->year}-01-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)))); /** * Independence Day @@ -68,7 +67,7 @@ public function initialize(): void $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'bs_Latn' => 'Dan Nezavisnosti', - ], new DateTime("$this->year-3-1", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -78,7 +77,7 @@ public function initialize(): void $this->addHoliday(new Holiday('statehoodDay', [ 'en' => 'Statehood Day', 'bs_Latn' => 'Dan državnosti', - ], new DateTime("$this->year-11-25", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-11-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -87,7 +86,7 @@ public function initialize(): void $this->addHoliday(new Holiday('dayAfterNewYearsDay', [ 'en' => 'Day after New Year’s Day', 'bs_Latn' => 'Nova godina - drugi dan', - ], new DateTime("$this->year-01-02", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); /** * Second Labour day @@ -95,6 +94,6 @@ public function initialize(): void $this->addHoliday(new Holiday('secondLabourDay', [ 'en' => 'Second Labour Day', 'bs_Latn' => 'Praznik rada - drugi dan', - ], new DateTime("$this->year-05-02", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-05-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Brazil.php b/src/Yasumi/Provider/Brazil.php index f6a4bf08c..849691df7 100644 --- a/src/Yasumi/Provider/Brazil.php +++ b/src/Yasumi/Provider/Brazil.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -98,7 +97,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'tiradentesDay', ['pt' => 'Dia de Tiradentes'], - new DateTime("$this->year-04-21", new DateTimeZone($this->timezone)), + new DateTime("$this->year-04-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -115,7 +114,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'independenceDay', ['pt' => 'Dia da Independência do Brasil'], - new DateTime("$this->year-09-07", new DateTimeZone($this->timezone)), + new DateTime("$this->year-09-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -135,7 +134,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'ourLadyOfAparecidaDay', ['pt' => 'Dia de Nossa Senhora Aparecida'], - new DateTime("$this->year-10-12", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -151,7 +150,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'allSoulsDay', ['pt' => 'Dia de Finados'], - new DateTime("$this->year-11-02", new DateTimeZone($this->timezone)), + new DateTime("$this->year-11-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -169,7 +168,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'proclamationOfRepublicDay', ['pt' => 'Dia da Proclamação da República'], - new DateTime("$this->year-11-15", new DateTimeZone($this->timezone)), + new DateTime("$this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index 165cd83b7..67897824f 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -131,7 +130,7 @@ protected function calculateEaster(int $year, string $timezone): DateTime $easterDays = $pfm + $tmp + 1; // Easter as the number of days after 21st March } - $easter = new DateTime("$year-3-21", new DateTimeZone($timezone)); + $easter = new DateTime("$year-3-21", DateTimeZoneFactory::getDateTimeZone($timezone)); $easter->add(new DateInterval('P' . $easterDays . 'D')); return $easter; @@ -348,7 +347,7 @@ public function christmasEve( return new Holiday( 'christmasEve', [], - new DateTime("$year-12-24", new DateTimeZone($timezone)), + new DateTime("$year-12-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -383,7 +382,7 @@ public function christmasDay( return new Holiday( 'christmasDay', [], - new DateTime("$year-12-25", new DateTimeZone($timezone)), + new DateTime("$year-12-25", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -418,7 +417,7 @@ public function secondChristmasDay( return new Holiday( 'secondChristmasDay', [], - new DateTime("$year-12-26", new DateTimeZone($timezone)), + new DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -453,7 +452,7 @@ public function allSaintsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('allSaintsDay', [], new DateTime("$year-11-1", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('allSaintsDay', [], new DateTime("$year-11-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -487,7 +486,7 @@ public function assumptionOfMary( return new Holiday( 'assumptionOfMary', [], - new DateTime("$year-8-15", new DateTimeZone($timezone)), + new DateTime("$year-8-15", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -558,7 +557,7 @@ public function epiphany( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('epiphany', [], new DateTime("$year-1-6", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('epiphany', [], new DateTime("$year-1-6", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -630,7 +629,7 @@ public function immaculateConception( return new Holiday( 'immaculateConception', [], - new DateTime("$year-12-8", new DateTimeZone($timezone)), + new DateTime("$year-12-8", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -669,7 +668,7 @@ public function stStephensDay( return new Holiday( 'stStephensDay', [], - new DateTime("$year-12-26", new DateTimeZone($timezone)), + new DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -705,7 +704,7 @@ public function stJosephsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stJosephsDay', [], new DateTime("$year-3-19", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('stJosephsDay', [], new DateTime("$year-3-19", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -775,7 +774,7 @@ public function stGeorgesDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stGeorgesDay', [], new DateTime("$year-4-23", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('stGeorgesDay', [], new DateTime("$year-4-23", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -808,7 +807,7 @@ public function stJohnsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stJohnsDay', [], new DateTime("$year-06-24", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('stJohnsDay', [], new DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -844,7 +843,7 @@ public function annunciation( return new Holiday( 'annunciation', [], - new DateTime("$year-03-25", new DateTimeZone($timezone)), + new DateTime("$year-03-25", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -872,7 +871,7 @@ public function calculateOrthodoxEaster(int $year, string $timezone): DateTime $month = \floor(($d + $e + 114) / 31); $day = (($d + $e + 114) % 31) + 1; - return (new DateTime("$year-$month-$day", new DateTimeZone($timezone)))->add(new DateInterval('P13D')); + return (new DateTime("$year-$month-$day", DateTimeZoneFactory::getDateTimeZone($timezone)))->add(new DateInterval('P13D')); } /** @@ -912,7 +911,7 @@ public function reformationDay( return new Holiday( 'reformationDay', [], - new DateTime("$year-10-31", new DateTimeZone($timezone)), + new DateTime("$year-10-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index fd063c05c..c2cbd8eb3 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -54,7 +53,7 @@ public function newYearsEve( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('newYearsEve', [], new DateTime("$year-12-31", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('newYearsEve', [], new DateTime("$year-12-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -88,7 +87,7 @@ public function newYearsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('newYearsDay', [], new DateTime("$year-1-1", new DateTimeZone($timezone)), $locale, $type); + return new Holiday('newYearsDay', [], new DateTime("$year-1-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -124,7 +123,7 @@ public function internationalWorkersDay( return new Holiday( 'internationalWorkersDay', [], - new DateTime("$year-5-1", new DateTimeZone($timezone)), + new DateTime("$year-5-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -163,7 +162,7 @@ public function valentinesDay( return new Holiday( 'valentinesDay', [], - new DateTime("$year-2-14", new DateTimeZone($timezone)), + new DateTime("$year-2-14", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -200,7 +199,7 @@ public function worldAnimalDay( return new Holiday( 'worldAnimalDay', [], - new DateTime("$year-10-4", new DateTimeZone($timezone)), + new DateTime("$year-10-4", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -239,7 +238,7 @@ public function stMartinsDay( return new Holiday( 'stMartinsDay', [], - new DateTime("$year-11-11", new DateTimeZone($timezone)), + new DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -277,7 +276,7 @@ public function fathersDay( return new Holiday( 'fathersDay', [], - new DateTime("third sunday of june $year", new DateTimeZone($timezone)), + new DateTime("third sunday of june $year", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -315,7 +314,7 @@ public function mothersDay( return new Holiday( 'mothersDay', [], - new DateTime("second sunday of may $year", new DateTimeZone($timezone)), + new DateTime("second sunday of may $year", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -353,7 +352,7 @@ public function victoryInEuropeDay( return new Holiday( 'victoryInEuropeDay', [], - new DateTime("$year-5-8", new DateTimeZone($timezone)), + new DateTime("$year-5-8", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -393,7 +392,7 @@ public function armisticeDay( return new Holiday( 'armisticeDay', [], - new DateTime("$year-11-11", new DateTimeZone($timezone)), + new DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -428,7 +427,7 @@ public function internationalWomensDay( return new Holiday( 'internationalWomensDay', [], - new DateTime("$year-03-08", new DateTimeZone($timezone)), + new DateTime("$year-03-08", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -498,7 +497,7 @@ protected function calculateSummerWinterTime( string $timezone, bool $summer ): ?\DateTimeImmutable { - $zone = new DateTimeZone($timezone); + $zone = DateTimeZoneFactory::getDateTimeZone($timezone); $transitions = $zone->getTransitions(\mktime(0, 0, 0, 1, 1, $year), \mktime(23, 59, 59, 12, 31, $year)); diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index 4b1b38fa2..21b68f5f7 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -66,7 +65,7 @@ public function initialize(): void $this->addHoliday(new Holiday('antifascistStruggleDay', [ 'en' => 'Day of Antifascist Struggle', 'hr' => 'Dan antifašističke borbe', - ], new DateTime("$this->year-6-22", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-6-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } $this->calculateStatehoodDay(); @@ -84,9 +83,9 @@ private function calculateStatehoodDay(): void $statehoodDayDate = null; if ($this->year >= 1991 && $this->year < 2020) { - $statehoodDayDate = new DateTime("$this->year-6-25", new DateTimeZone($this->timezone)); + $statehoodDayDate = new DateTime("$this->year-6-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2020) { - $statehoodDayDate = new DateTime("$this->year-5-30", new DateTimeZone($this->timezone)); + $statehoodDayDate = new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($statehoodDayDate != null) { @@ -116,7 +115,7 @@ private function calculateHomelandThanksgivingDay(): void $this->addHoliday(new Holiday( 'homelandThanksgiving', $names, - new DateTime("$this->year-8-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-8-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -133,7 +132,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'hr' => 'Dan neovisnosti', - ], new DateTime("$this->year-10-8", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-10-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -147,7 +146,7 @@ private function calculateRemembranceDayForHomelandWarVictims(): void $this->addHoliday(new Holiday('remembranceDay', [ 'en' => 'Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja', 'hr' => 'Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje', - ], new DateTime("$this->year-11-18", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-11-18", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/DateTimeZoneFactory.php b/src/Yasumi/Provider/DateTimeZoneFactory.php new file mode 100644 index 000000000..dd82f5603 --- /dev/null +++ b/src/Yasumi/Provider/DateTimeZoneFactory.php @@ -0,0 +1,33 @@ + + */ + +namespace Yasumi\Provider; + +/** + * This factory keep references to already instantiated DateTimeZone to save CPU time resources + * + * @author Pierrick VIGNAND + */ +final class DateTimeZoneFactory +{ + /** @var array */ + private static $dateTimeZones; + + public static function getDateTimeZone(string $timezone): \DateTimeZone + { + if (!isset(self::$dateTimeZones[$timezone])) { + self::$dateTimeZones[$timezone] = new \DateTimeZone($timezone); + } + + return self::$dateTimeZones[$timezone]; + } +} diff --git a/src/Yasumi/Provider/Denmark.php b/src/Yasumi/Provider/Denmark.php index 295d551fb..73e45dbdb 100644 --- a/src/Yasumi/Provider/Denmark.php +++ b/src/Yasumi/Provider/Denmark.php @@ -14,7 +14,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -98,7 +97,7 @@ private function calculateGreatPrayerDay(): void $this->addHoliday(new Holiday( 'greatPrayerDay', ['da' => 'store bededag'], - new DateTime("fourth friday $easter", new DateTimeZone($this->timezone)), + new DateTime("fourth friday $easter", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -126,7 +125,7 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday( 'constitutionDay', ['da' => 'grundlovsdag'], - new DateTime("$this->year-6-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-6-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); diff --git a/src/Yasumi/Provider/Finland.php b/src/Yasumi/Provider/Finland.php index ea77ec1a4..05c66fc79 100644 --- a/src/Yasumi/Provider/Finland.php +++ b/src/Yasumi/Provider/Finland.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -90,7 +89,7 @@ private function calculateStJohnsDay(): void $this->addHoliday(new Holiday( 'stJohnsDay', [], - new DateTime($stJohnsDay, new DateTimeZone($this->timezone)), + new DateTime($stJohnsDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -122,7 +121,7 @@ private function calculateAllSaintsDay(): void $this->addHoliday(new Holiday( 'allSaintsDay', [], - new DateTime("$this->year-10-31 this saturday", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -151,7 +150,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday( 'independenceDay', ['fi' => 'Itsenäisyyspäivä'], - new DateTime("$this->year-12-6", new DateTimeZone($this->timezone)), + new DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/France.php b/src/Yasumi/Provider/France.php index 3f4611640..1a7801646 100755 --- a/src/Yasumi/Provider/France.php +++ b/src/Yasumi/Provider/France.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -90,7 +89,7 @@ private function calculateBastilleDay(): void $this->addHoliday(new Holiday('bastilleDay', [ 'en' => 'Bastille Day', 'fr' => 'La Fête nationale', - ], new DateTime("$this->year-7-14", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-7-14", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Germany/Berlin.php b/src/Yasumi/Provider/Germany/Berlin.php index 81231360b..9fdc7f75e 100755 --- a/src/Yasumi/Provider/Germany/Berlin.php +++ b/src/Yasumi/Provider/Germany/Berlin.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Germany; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Germany; /** @@ -86,7 +86,7 @@ public function dayOfLiberation( return new Holiday( 'dayOfLiberation', [], - new DateTime('2020-05-08', new DateTimeZone($timezone)), + new DateTime('2020-05-08', DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); diff --git a/src/Yasumi/Provider/Germany/Saxony.php b/src/Yasumi/Provider/Germany/Saxony.php index c0e9d4bdc..8b2c20d52 100755 --- a/src/Yasumi/Provider/Germany/Saxony.php +++ b/src/Yasumi/Provider/Germany/Saxony.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\Germany; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Germany; /** @@ -93,7 +93,7 @@ private function calculateRepentanceAndPrayerDay(): void $this->addHoliday(new Holiday( 'repentanceAndPrayerDay', ['de' => 'Buß- und Bettag'], - new DateTime("next wednesday $this->year-11-15", new DateTimeZone($this->timezone)), + new DateTime("next wednesday $this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/Greece.php b/src/Yasumi/Provider/Greece.php index c65a5edd2..1b56f3635 100644 --- a/src/Yasumi/Provider/Greece.php +++ b/src/Yasumi/Provider/Greece.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -86,7 +85,7 @@ private function calculateThreeHolyHierarchs(): void $this->addHoliday(new Holiday( 'threeHolyHierarchs', ['el' => 'Τριών Ιεραρχών'], - new DateTime("$this->year-1-30", new DateTimeZone($this->timezone)), + new DateTime("$this->year-1-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -150,7 +149,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday( 'independenceDay', ['el' => 'Εικοστή Πέμπτη Μαρτίου'], - new DateTime("$this->year-3-25", new DateTimeZone($this->timezone)), + new DateTime("$this->year-3-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -174,7 +173,7 @@ private function calculateOhiDay(): void $this->addHoliday(new Holiday( 'ohiDay', ['el' => 'Επέτειος του Όχι'], - new DateTime("$this->year-10-28", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -198,7 +197,7 @@ private function calculatePolytechnio(): void $this->addHoliday(new Holiday( 'polytechnio', ['el' => 'Πολυτεχνείο'], - new DateTime("$this->year-11-17", new DateTimeZone($this->timezone)), + new DateTime("$this->year-11-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Hungary.php b/src/Yasumi/Provider/Hungary.php index 7988e4282..f9ef68e67 100644 --- a/src/Yasumi/Provider/Hungary.php +++ b/src/Yasumi/Provider/Hungary.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -68,7 +67,7 @@ public function initialize(): void $this->addHoliday(new Holiday('memorialDay1848', [ 'en' => 'Memorial day of the 1848 Revolution', 'hu' => 'Az 1848-as forradalom ünnepe', - ], new DateTime("$this->year-3-15", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-3-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -78,7 +77,7 @@ public function initialize(): void $this->addHoliday(new Holiday('stateFoundation', [ 'en' => 'State Foundation Day', 'hu' => 'Az államalapítás ünnepe', - ], new DateTime("$this->year-8-20", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-8-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -88,7 +87,7 @@ public function initialize(): void $this->addHoliday(new Holiday('memorialDay1956', [ 'en' => 'Memorial day of the 1956 Revolution', 'hu' => 'Az 1956-os forradalom ünnepe', - ], new DateTime("$this->year-10-23", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-10-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Ireland.php b/src/Yasumi/Provider/Ireland.php index 2a2cf8749..74dfb009f 100644 --- a/src/Yasumi/Provider/Ireland.php +++ b/src/Yasumi/Provider/Ireland.php @@ -14,7 +14,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -69,7 +68,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'augustHoliday', ['en' => 'August Holiday', 'ga' => 'Lá Saoire i mí Lúnasa'], - new DateTime("next monday $this->year-7-31", new DateTimeZone($this->timezone)), + new DateTime("next monday $this->year-7-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); $this->calculateOctoberHoliday(); @@ -158,7 +157,7 @@ private function calculateChristmasDay(): void $holiday = new Holiday( 'christmasDay', ['en' => 'Christmas Day', 'ga' => 'Lá Nollag'], - new DateTime($this->year . '-12-25', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-12-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -198,7 +197,7 @@ private function calculateStStephensDay(): void $holiday = new Holiday( 'stStephensDay', [], - new DateTime($this->year . '-12-26', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -243,7 +242,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => 'St. Patrick’s Day', 'ga' => 'Lá Fhéile Pádraig'], - new DateTime($this->year . '-3-17', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -289,7 +288,7 @@ private function calculateMayDay(): void $this->addHoliday(new Holiday( 'mayDay', ['en' => 'May Day', 'ga' => 'Lá Bealtaine'], - new DateTime("next monday $this->year-4-30", new DateTimeZone($this->timezone)), + new DateTime("next monday $this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -317,7 +316,7 @@ private function calculateJuneHoliday(): void $this->addHoliday(new Holiday( 'juneHoliday', ['en' => 'June Holiday', 'ga' => 'Lá Saoire i mí an Mheithimh'], - new DateTime("next monday $this->year-5-31", new DateTimeZone($this->timezone)), + new DateTime("next monday $this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -344,7 +343,7 @@ private function calculateOctoberHoliday(): void $this->addHoliday(new Holiday( 'octoberHoliday', ['en' => 'October Holiday', 'ga' => 'Lá Saoire i mí Dheireadh Fómhair'], - new DateTime("previous monday $this->year-11-01", new DateTimeZone($this->timezone)), + new DateTime("previous monday $this->year-11-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Italy.php b/src/Yasumi/Provider/Italy.php index 859d86c88..c210944cc 100755 --- a/src/Yasumi/Provider/Italy.php +++ b/src/Yasumi/Provider/Italy.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -85,7 +84,7 @@ private function calculateLiberationDay(): void $this->addHoliday(new Holiday( 'liberationDay', ['it' => 'Festa della Liberazione'], - new DateTime("$this->year-4-25", new DateTimeZone($this->timezone)), + new DateTime("$this->year-4-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -113,7 +112,7 @@ private function calculateRepublicDay(): void $this->addHoliday(new Holiday( 'republicDay', ['it' => 'Festa della Repubblica'], - new DateTime("$this->year-6-2", new DateTimeZone($this->timezone)), + new DateTime("$this->year-6-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index 9d4922015..9d65991df 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -16,7 +16,6 @@ use DateInterval; use DateTime; use DateTimeInterface; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -123,7 +122,7 @@ private function calculateNationalFoundationDay(): void 'en' => 'National Foundation Day', 'ja' => '建国記念の日', ], - new DateTime("$this->year-2-11", new DateTimeZone($this->timezone)), + new DateTime("$this->year-2-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -143,7 +142,7 @@ private function calculateShowaDay(): void 'en' => 'Showa Day', 'ja' => '昭和の日', ], - new DateTime("$this->year-4-29", new DateTimeZone($this->timezone)), + new DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -163,7 +162,7 @@ private function calculateConstitutionMemorialDay(): void 'en' => 'Constitution Memorial Day', 'ja' => '憲法記念日', ], - new DateTime("$this->year-5-3", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -183,7 +182,7 @@ private function calculateChildrensDay(): void 'en' => 'Children’s Day', 'ja' => 'こどもの日', ], - new DateTime("$this->year-5-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -200,7 +199,7 @@ private function calculateCultureDay(): void $this->addHoliday(new Holiday( 'cultureDay', ['en' => 'Culture Day', 'ja' => '文化の日'], - new DateTime("$this->year-11-3", new DateTimeZone($this->timezone)), + new DateTime("$this->year-11-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -217,7 +216,7 @@ private function calculateLaborThanksgivingDay(): void $this->addHoliday(new Holiday( 'laborThanksgivingDay', ['en' => 'Labor Thanksgiving Day', 'ja' => '勤労感謝の日'], - new DateTime("$this->year-11-23", new DateTimeZone($this->timezone)), + new DateTime("$this->year-11-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -246,7 +245,7 @@ private function calculateEmperorsBirthday(): void $this->addHoliday(new Holiday( 'emperorsBirthday', ['en' => 'Emperors Birthday', 'ja' => '天皇誕生日'], - new DateTime($emperorsBirthday, new DateTimeZone($this->timezone)), + new DateTime($emperorsBirthday, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -285,7 +284,7 @@ private function calculateVernalEquinoxDay(): void $this->addHoliday(new Holiday( 'vernalEquinoxDay', ['en' => 'Vernal Equinox Day', 'ja' => '春分の日'], - new DateTime("$this->year-3-$day", new DateTimeZone($this->timezone)), + new DateTime("$this->year-3-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -307,9 +306,9 @@ private function calculateComingOfAgeDay(): void { $date = null; if ($this->year >= 2000) { - $date = new DateTime("second monday of january $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("second monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1948) { - $date = new DateTime("$this->year-1-15", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-1-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($date instanceof DateTimeInterface) { @@ -337,9 +336,9 @@ private function calculateGreeneryDay(): void { $date = null; if ($this->year >= 2007) { - $date = new DateTime("$this->year-5-4", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1989) { - $date = new DateTime("$this->year-4-29", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($date instanceof DateTimeInterface) { @@ -369,11 +368,11 @@ private function calculateMarineDay(): void { $date = null; if (2020 === $this->year) { - $date = new DateTime("$this->year-7-23", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-7-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2003) { - $date = new DateTime("third monday of july $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("third monday of july $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-7-20", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-7-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($date instanceof DateTimeInterface) { @@ -400,9 +399,9 @@ private function calculateMountainDay(): void { $date = null; if (2020 === $this->year) { - $date = new DateTime("$this->year-8-10", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-8-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2016) { - $date = new DateTime("$this->year-8-11", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-8-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($date instanceof DateTimeInterface) { @@ -431,9 +430,9 @@ private function calculateRespectForTheAgeDay(): void { $date = null; if ($this->year >= 2003) { - $date = new DateTime("third monday of september $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("third monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-9-15", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-9-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if ($date instanceof DateTimeInterface) { @@ -463,11 +462,11 @@ private function calculateSportsDay(): void { $date = null; if (2020 === $this->year) { - $date = new DateTime("$this->year-7-24", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-7-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2000) { - $date = new DateTime("second monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-10-10", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-10-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $holidayName = ['en' => 'Health And Sports Day', 'ja' => '体育の日']; @@ -518,7 +517,7 @@ private function calculateAutumnalEquinoxDay(): void $this->addHoliday(new Holiday( 'autumnalEquinoxDay', ['en' => 'Autumnal Equinox Day', 'ja' => '秋分の日'], - new DateTime("$this->year-9-$day", new DateTimeZone($this->timezone)), + new DateTime("$this->year-9-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -586,7 +585,7 @@ private function calculateCoronationDay(): void $this->addHoliday(new Holiday( 'coronationDay', ['en' => 'Coronation Day', 'ja' => '即位の日'], - new DateTime("$this->year-5-1", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -604,7 +603,7 @@ private function calculateEnthronementProclamationCeremony(): void $this->addHoliday(new Holiday( 'enthronementProclamationCeremony', ['en' => 'Enthronement Proclamation Ceremony', 'ja' => '即位礼正殿の儀'], - new DateTime("$this->year-10-22", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php index f40e46ed6..8c08b34f9 100755 --- a/src/Yasumi/Provider/Luxembourg.php +++ b/src/Yasumi/Provider/Luxembourg.php @@ -3,7 +3,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -71,7 +70,7 @@ public function calculateEuropeDay(): void $this->addHoliday(new Holiday('europeDay', [ 'en_US' => 'Europe day', 'fr' => 'La Journée de l’Europe', - ], new DateTime("$this->year-5-9", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-5-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -96,6 +95,6 @@ public function calculateNationalDay(): void $this->addHoliday(new Holiday('nationalDay', [ 'en_US' => 'National day', 'fr' => 'La Fête nationale', - ], new DateTime("$this->year-6-23", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-6-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php index 14ca841aa..0035d99ec 100755 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -187,7 +186,7 @@ private function calculateStNicholasDay(): void $this->addHoliday(new Holiday( 'stNicholasDay', ['en' => 'St. Nicholas’ Day', 'nl' => 'Sinterklaas'], - new DateTime("$this->year-12-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-12-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -210,7 +209,7 @@ private function calculateHalloween(): void $this->addHoliday(new Holiday( 'halloween', ['en' => 'Halloween', 'nl' => 'Halloween'], - new DateTime("$this->year-10-31", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -229,7 +228,7 @@ private function calculatePrincesDay(): void $this->addHoliday(new Holiday( 'princesDay', ['en' => 'Prince’s Day', 'nl' => 'Prinsjesdag'], - new DateTime("third tuesday of september $this->year", new DateTimeZone($this->timezone)), + new DateTime("third tuesday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -247,9 +246,9 @@ private function calculatePrincesDay(): void private function calculateQueensday(): void { if ($this->year >= 1891 && $this->year <= 2013) { - $date = new DateTime("$this->year-4-30", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year <= 1948) { - $date = new DateTime("$this->year-8-31", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-8-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } // Determine substitution day @@ -277,7 +276,7 @@ private function calculateQueensday(): void private function calculateKingsday(): void { if ($this->year >= 2014) { - $date = new DateTime("$this->year-4-27", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-4-27", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if (0 === (int)$date->format('w')) { $date->sub(new DateInterval('P1D')); @@ -305,14 +304,14 @@ private function calculateCommemorationLiberationDay(): void $this->addHoliday(new Holiday( 'commemorationDay', ['en' => 'Commemoration Day', 'nl' => 'dodenherdenking'], - new DateTime("$this->year-5-4", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); $this->addHoliday(new Holiday( 'liberationDay', ['en' => 'Liberation Day', 'nl' => 'Bevrijdingsdag'], - new DateTime("$this->year-5-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/NewZealand.php b/src/Yasumi/Provider/NewZealand.php index 9a9bd887e..d3d42256a 100644 --- a/src/Yasumi/Provider/NewZealand.php +++ b/src/Yasumi/Provider/NewZealand.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -75,8 +74,8 @@ public function initialize(): void */ private function calculateNewYearHolidays(): void { - $newYearsDay = new DateTime("$this->year-01-01", new DateTimeZone($this->timezone)); - $dayAfterNewYearsDay = new DateTime("$this->year-01-02", new DateTimeZone($this->timezone)); + $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $dayAfterNewYearsDay = new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)); switch ($newYearsDay->format('w')) { case 0: @@ -119,7 +118,7 @@ private function calculateWaitangiDay(): void return; } - $date = new DateTime("$this->year-02-6", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-02-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 2015 && !$this->isWorkingDay($date)) { $date->modify('next monday'); @@ -149,7 +148,7 @@ private function calculateAnzacDay(): void return; } - $date = new DateTime("$this->year-04-25", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 2015 && !$this->isWorkingDay($date)) { $date->modify('next monday'); @@ -185,7 +184,7 @@ private function calculateQueensBirthday(): void $this->addHoliday(new Holiday( 'queensBirthday', [], - new DateTime("first monday of june $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of june $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -217,7 +216,7 @@ private function calculateLabourDay(): void $date = new DateTime( ($this->year < 1910 ? 'second wednesday of october' : 'fourth monday of october') . " $this->year", - new DateTimeZone($this->timezone) + DateTimeZoneFactory::getDateTimeZone($this->timezone) ); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); @@ -240,8 +239,8 @@ private function calculateLabourDay(): void */ private function calculateChristmasHolidays(): void { - $christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone)); - $boxingDay = new DateTime("$this->year-12-26", new DateTimeZone($this->timezone)); + $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $boxingDay = new DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); switch ($christmasDay->format('w')) { case 0: diff --git a/src/Yasumi/Provider/Norway.php b/src/Yasumi/Provider/Norway.php index 5d3fdfcb0..24d380f3d 100644 --- a/src/Yasumi/Provider/Norway.php +++ b/src/Yasumi/Provider/Norway.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -86,7 +85,7 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday( 'constitutionDay', ['nb' => 'grunnlovsdagen'], - new DateTime("$this->year-5-17", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Poland.php b/src/Yasumi/Provider/Poland.php index f7d8f59e0..5bbd6c835 100755 --- a/src/Yasumi/Provider/Poland.php +++ b/src/Yasumi/Provider/Poland.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -88,7 +87,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'pl' => 'Narodowe Święto Niepodległości', - ], new DateTime("$this->year-11-11", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -116,6 +115,6 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday('constitutionDay', [ 'en' => 'Constitution Day', 'pl' => 'Święto Narodowe Trzeciego Maja', - ], new DateTime("$this->year-5-3", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Portugal.php b/src/Yasumi/Provider/Portugal.php index 4bf27f5d1..4e33ae7d6 100644 --- a/src/Yasumi/Provider/Portugal.php +++ b/src/Yasumi/Provider/Portugal.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -89,7 +88,7 @@ private function calculateCarnationRevolutionDay(): void $this->addHoliday(new Holiday( '25thApril', ['pt' => 'Dia da Liberdade'], - new DateTime("$this->year-04-25", new DateTimeZone($this->timezone)), + new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -136,7 +135,7 @@ private function calculatePortugalDay(): void $this->addHoliday(new Holiday( 'portugalDay', ['pt' => 'Dia de Portugal'], - new DateTime("$this->year-06-10", new DateTimeZone($this->timezone)), + new DateTime("$this->year-06-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -170,7 +169,7 @@ private function calculatePortugueseRepublicDay(): void $this->addHoliday(new Holiday( 'portugueseRepublic', ['pt' => 'Implantação da República Portuguesa'], - new DateTime("$this->year-10-05", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-05", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -226,7 +225,7 @@ private function calculateRestorationOfIndependenceDay(): void $this->addHoliday(new Holiday( 'restorationOfIndependence', ['pt' => 'Restauração da Independência'], - new DateTime("$this->year-12-01", new DateTimeZone($this->timezone)), + new DateTime("$this->year-12-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/Romania.php b/src/Yasumi/Provider/Romania.php index be917f7e2..eb7f909b3 100755 --- a/src/Yasumi/Provider/Romania.php +++ b/src/Yasumi/Provider/Romania.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -91,7 +90,7 @@ private function calculateDayAfterNewYearsDay(): void $this->addHoliday(new Holiday( 'dayAfterNewYearsDay', [], - new DateTime("$this->year-01-02", new DateTimeZone($this->timezone)), + new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -118,7 +117,7 @@ private function calculateUnitedPrincipalitiesDay(): void $this->addHoliday(new Holiday('unitedPrincipalitiesDay', [ 'en' => 'Union Day / Small Union', 'ro' => 'Unirea Principatelor Române / Mica Unire', - ], new DateTime("$this->year-01-24", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-01-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -140,7 +139,7 @@ private function calculateStAndrewDay(): void $this->addHoliday(new Holiday( 'stAndrewsDay', [], - new DateTime($this->year . '-11-30', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -183,7 +182,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday('nationalDay', [ 'en' => 'National Day', 'ro' => 'Ziua Națională', - ], new DateTime($nationalDay, new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime($nationalDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -207,7 +206,7 @@ private function calculateConstantinBrancusiDay(): void 'en' => 'Constantin Brâncuși day', 'ro' => 'Ziua Constantin Brâncuși', ], - new DateTime("$this->year-02-19", new DateTimeZone($this->timezone)), + new DateTime("$this->year-02-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -236,7 +235,7 @@ private function calculateChildrensDay(): void 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', ], - new DateTime("$this->year-06-01", new DateTimeZone($this->timezone)), + new DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -246,7 +245,7 @@ private function calculateChildrensDay(): void $this->addHoliday(new Holiday('childrensDay', [ 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', - ], new DateTime("$this->year-06-01", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Slovakia.php b/src/Yasumi/Provider/Slovakia.php index da365cf92..48c0b17bf 100644 --- a/src/Yasumi/Provider/Slovakia.php +++ b/src/Yasumi/Provider/Slovakia.php @@ -14,7 +14,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -125,7 +124,7 @@ private function calculateSlovakIndependenceDay(): void 'sk' => 'Deň vzniku Slovenskej republiky', 'en' => 'Day of the Establishment of the Slovak Republic', ], - new DateTime($this->year . '-01-01', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-01-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -151,7 +150,7 @@ private function calculateSaintsCyrilAndMethodiusDay(): void 'cs' => 'Den slovanských věrozvěstů Cyrila a Metoděje', 'en' => 'Saints Cyril and Methodius Day', ], - new DateTime($this->year . '-07-05', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-07-05', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -175,7 +174,7 @@ private function calculateSlovakNationalUprisingDay(): void 'sk' => 'Výročie Slovenského národného povstania', 'en' => 'Slovak National Uprising Day', ], - new DateTime($this->year . '-08-29', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-08-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -199,7 +198,7 @@ private function calculateSlovakConstitutionDay(): void 'sk' => 'Deň Ústavy Slovenskej republiky', 'en' => 'Day of the Constitution of the Slovak Republic', ], - new DateTime($this->year . '-09-01', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-09-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -224,7 +223,7 @@ private function calculateOurLadyOfSorrowsDay(): void $this->addHoliday(new Holiday('ourLadyOfSorrowsDay', [ 'sk' => 'Sviatok Sedembolestnej Panny Márie', 'en' => 'Our Lady of Sorrows Day', - ], new DateTime($this->year . '-09-15', new DateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); + ], new DateTime($this->year . '-09-15', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); } /** @@ -246,7 +245,7 @@ private function calculateStruggleForFreedomAndDemocracyDay(): void 'cs' => 'Den boje za svobodu a demokracii', 'en' => 'Struggle for Freedom and Democracy Day', ], - new DateTime($this->year . '-11-17', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-11-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/SouthAfrica.php b/src/Yasumi/Provider/SouthAfrica.php index c3a274f4d..6ffd17863 100644 --- a/src/Yasumi/Provider/SouthAfrica.php +++ b/src/Yasumi/Provider/SouthAfrica.php @@ -15,7 +15,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -100,7 +99,7 @@ private function calculateHumanRightsDay(): void $this->addHoliday(new Holiday( 'humanRightsDay', ['en' => 'Human Rights Day'], - new DateTime($this->year . '-3-21', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-3-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -145,7 +144,7 @@ private function calculateFreedomDay(): void $this->addHoliday(new Holiday( 'freedomDay', ['en' => 'Freedom Day'], - new DateTime($this->year . '-4-27', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-4-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -172,7 +171,7 @@ private function calculateYouthDay(): void $this->addHoliday(new Holiday( 'youthDay', ['en' => 'Youth Day'], - new DateTime($this->year . '-6-16', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-6-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -199,7 +198,7 @@ private function calculate2016MunicipalElectionsDay(): void $this->addHoliday(new Holiday( '2016MunicipalElectionsDay', ['en' => '2016 Municipal Elections Day'], - new DateTime('2016-8-3', new DateTimeZone($this->timezone)), + new DateTime('2016-8-3', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -224,7 +223,7 @@ private function calculateNationalWomensDay(): void $this->addHoliday(new Holiday( 'nationalWomensDay', ['en' => 'National Women’s Day'], - new DateTime($this->year . '-8-9', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-8-9', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -249,7 +248,7 @@ private function calculateHeritageDay(): void $this->addHoliday(new Holiday( 'heritageDay', ['en' => 'Heritage Day'], - new DateTime($this->year . '-9-24', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-9-24', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -276,7 +275,7 @@ private function calculateDayOfReconciliation(): void $this->addHoliday(new Holiday( 'reconciliationDay', ['en' => 'Day of Reconciliation'], - new DateTime($this->year . '-12-16', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-12-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -306,7 +305,7 @@ private function calculateSubstituteDayOfGoodwill(): void $this->addHoliday(new Holiday( 'substituteDayOfGoodwill', ['en' => 'Day of Goodwill observed'], - new DateTime('2016-12-27', new DateTimeZone($this->timezone)), + new DateTime('2016-12-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 769099604..161a6be26 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -15,7 +15,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -165,7 +164,7 @@ public function calculateNewYearsDay(): void $this->addHoliday(new Holiday( 'dayAfterNewYearsDay', [], - new DateTime("$this->year-1-2", new DateTimeZone($this->timezone)), + new DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -173,7 +172,7 @@ public function calculateNewYearsDay(): void $this->addHoliday(new Holiday( 'twoDaysLaterNewYearsDay', ['en' => 'Two Days Later New Year’s Day', 'ko' => '새해 연휴'], - new DateTime("$this->year-1-3", new DateTimeZone($this->timezone)), + new DateTime("$this->year-1-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -191,7 +190,7 @@ public function calculateNewYearsDay(): void public function calculateSeollal(): void { if ($this->year >= 1985 && isset(self::LUNAR_HOLIDAY['seollal'][$this->year])) { - $seollal = new DateTime(self::LUNAR_HOLIDAY['seollal'][$this->year], new DateTimeZone($this->timezone)); + $seollal = new DateTime(self::LUNAR_HOLIDAY['seollal'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'seollal', ['en' => 'Seollal', 'ko' => '설날'], @@ -232,7 +231,7 @@ public function calculateBuddhasBirthday(): void $this->addHoliday(new Holiday( 'buddhasBirthday', ['en' => 'Buddha’s Birthday', 'ko' => '부처님오신날'], - new DateTime(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year], new DateTimeZone($this->timezone)), + new DateTime(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -255,7 +254,7 @@ public function calculateChuseok(): void $chuseok = new Holiday( 'chuseok', ['en' => 'Chuseok', 'ko' => '추석'], - new DateTime(self::LUNAR_HOLIDAY['chuseok'][$this->year], new DateTimeZone($this->timezone)), + new DateTime(self::LUNAR_HOLIDAY['chuseok'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); $this->addHoliday($chuseok); @@ -295,7 +294,7 @@ public function calculateIndependenceMovementDay(): void $this->addHoliday(new Holiday( 'independenceMovementDay', ['en' => 'Independence Movement Day', 'ko' => '삼일절'], - new DateTime("$this->year-3-1", new DateTimeZone($this->timezone)), + new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -314,7 +313,7 @@ public function calculateArborDay(): void $this->addHoliday(new Holiday( 'arborDay', ['en' => 'Arbor Day', 'ko' => '식목일'], - new DateTime("$this->year-4-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-4-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -333,7 +332,7 @@ public function calculateChildrensDay(): void $this->addHoliday(new Holiday( 'childrensDay', ['en' => 'Children’s Day', 'ko' => '어린이날'], - new DateTime("$this->year-5-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -352,7 +351,7 @@ public function calculateMemorialDay(): void $this->addHoliday(new Holiday( 'memorialDay', ['en' => 'Memorial Day', 'ko' => '현충일'], - new DateTime("$this->year-6-6", new DateTimeZone($this->timezone)), + new DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -374,7 +373,7 @@ public function calculateConstitutionDay(): void $this->addHoliday(new Holiday( 'constitutionDay', ['en' => 'Constitution Day', 'ko' => '제헌절'], - new DateTime("$this->year-7-17", new DateTimeZone($this->timezone)), + new DateTime("$this->year-7-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -393,7 +392,7 @@ public function calculateLiberationDay(): void $this->addHoliday(new Holiday( 'liberationDay', ['en' => 'Liberation Day', 'ko' => '광복절'], - new DateTime("$this->year-8-15", new DateTimeZone($this->timezone)), + new DateTime("$this->year-8-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -412,7 +411,7 @@ public function calculateArmedForcesDay(): void $this->addHoliday(new Holiday( 'armedForcesDay', ['en' => 'Armed Forces Day', 'ko' => '국군의 날'], - new DateTime("$this->year-10-1", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -431,7 +430,7 @@ public function calculateNationalFoundationDay(): void $this->addHoliday(new Holiday( 'nationalFoundationDay', ['en' => 'National Foundation Day', 'ko' => '개천절'], - new DateTime("$this->year-10-3", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -450,7 +449,7 @@ public function calculateHangulDay(): void $this->addHoliday(new Holiday( 'hangulDay', ['en' => 'Hangul Day', 'ko' => '한글날'], - new DateTime("$this->year-10-9", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain.php b/src/Yasumi/Provider/Spain.php index 76a6313f1..52a5cd2a0 100755 --- a/src/Yasumi/Provider/Spain.php +++ b/src/Yasumi/Provider/Spain.php @@ -13,7 +13,6 @@ namespace Yasumi\Provider; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -87,7 +86,7 @@ private function calculateNationalDay(): void 'ca' => 'Festa Nacional d’Espanya', 'es' => 'Fiesta Nacional de España', ], - new DateTime("$this->year-10-12", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -116,7 +115,7 @@ private function calculateConstitutionDay(): void 'ca' => 'Dia de la Constitució', 'es' => 'Día de la Constitución', ], - new DateTime("$this->year-12-6", new DateTimeZone($this->timezone)), + new DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Andalusia.php b/src/Yasumi/Provider/Spain/Andalusia.php index fc10f7287..e26a01b6c 100755 --- a/src/Yasumi/Provider/Spain/Andalusia.php +++ b/src/Yasumi/Provider/Spain/Andalusia.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -79,7 +79,7 @@ private function calculateAndalusiaDay(): void $this->addHoliday(new Holiday( 'andalusiaDay', ['es' => 'Día de Andalucía'], - new DateTime("$this->year-2-28", new DateTimeZone($this->timezone)), + new DateTime("$this->year-2-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Asturias.php b/src/Yasumi/Provider/Spain/Asturias.php index a8b81295f..808120363 100755 --- a/src/Yasumi/Provider/Spain/Asturias.php +++ b/src/Yasumi/Provider/Spain/Asturias.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -81,7 +81,7 @@ private function calculateAsturiasDay(): void $this->addHoliday(new Holiday( 'asturiasDay', ['es' => 'Día de Asturias'], - new DateTime("$this->year-9-8", new DateTimeZone($this->timezone)), + new DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/BalearicIslands.php b/src/Yasumi/Provider/Spain/BalearicIslands.php index 93c62e542..86174102d 100755 --- a/src/Yasumi/Provider/Spain/BalearicIslands.php +++ b/src/Yasumi/Provider/Spain/BalearicIslands.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -84,7 +84,7 @@ private function calculateBalearicIslandsDay(): void 'ca' => 'Diada de les Illes Balears', 'es' => 'Día de les Illes Balears', ], - new DateTime("$this->year-3-1", new DateTimeZone($this->timezone)), + new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/BasqueCountry.php b/src/Yasumi/Provider/Spain/BasqueCountry.php index 63f1d025f..e1ca2de98 100755 --- a/src/Yasumi/Provider/Spain/BasqueCountry.php +++ b/src/Yasumi/Provider/Spain/BasqueCountry.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -81,7 +81,7 @@ private function calculateBasqueCountryDay(): void $this->addHoliday(new Holiday( 'basqueCountryDay', ['es' => 'Euskadi Eguna'], - new DateTime("$this->year-10-25", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CanaryIslands.php b/src/Yasumi/Provider/Spain/CanaryIslands.php index f49b76087..f58982e21 100755 --- a/src/Yasumi/Provider/Spain/CanaryIslands.php +++ b/src/Yasumi/Provider/Spain/CanaryIslands.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -80,7 +80,7 @@ private function calculateCanaryIslandsDay(): void $this->addHoliday(new Holiday( 'canaryIslandsDay', ['es' => 'Día de las Canarias'], - new DateTime("$this->year-5-30", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Cantabria.php b/src/Yasumi/Provider/Spain/Cantabria.php index 9a9035b71..3800303f5 100755 --- a/src/Yasumi/Provider/Spain/Cantabria.php +++ b/src/Yasumi/Provider/Spain/Cantabria.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -84,7 +84,7 @@ private function calculateCantabriaDay(): void $this->addHoliday(new Holiday( 'cantabriaDay', ['es' => 'Día de Cantabria'], - new DateTime("second sunday of august $this->year", new DateTimeZone($this->timezone)), + new DateTime("second sunday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CastileAndLeon.php b/src/Yasumi/Provider/Spain/CastileAndLeon.php index 80fd3408d..86bbb21b3 100755 --- a/src/Yasumi/Provider/Spain/CastileAndLeon.php +++ b/src/Yasumi/Provider/Spain/CastileAndLeon.php @@ -14,11 +14,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -81,7 +81,7 @@ private function calculateCastileAndLeonDay(): void $this->addHoliday(new Holiday( 'castileAndLeonDay', ['es' => 'Día de Castilla y León'], - new DateTime("$this->year-4-23", new DateTimeZone($this->timezone)), + new DateTime("$this->year-4-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CastillaLaMancha.php b/src/Yasumi/Provider/Spain/CastillaLaMancha.php index ef2a21277..9e2d41864 100755 --- a/src/Yasumi/Provider/Spain/CastillaLaMancha.php +++ b/src/Yasumi/Provider/Spain/CastillaLaMancha.php @@ -14,11 +14,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -84,7 +84,7 @@ private function calculateCastillaLaManchaDay(): void $this->addHoliday(new Holiday( 'castillaLaManchaDay', ['es' => 'Día de la Región Castilla-La Mancha'], - new DateTime("$this->year-5-31", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Catalonia.php b/src/Yasumi/Provider/Spain/Catalonia.php index 0a30868bc..406a6610f 100755 --- a/src/Yasumi/Provider/Spain/Catalonia.php +++ b/src/Yasumi/Provider/Spain/Catalonia.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -87,7 +87,7 @@ private function calculateNationalDayOfCatalonia(): void 'ca' => 'Diada Nacional de Catalunya', 'es' => 'Diada Nacional de Cataluña', ], - new DateTime("$this->year-9-11", new DateTimeZone($this->timezone)), + new DateTime("$this->year-9-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Ceuta.php b/src/Yasumi/Provider/Spain/Ceuta.php index 199bbfd8c..4c82f9cd0 100755 --- a/src/Yasumi/Provider/Spain/Ceuta.php +++ b/src/Yasumi/Provider/Spain/Ceuta.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -78,7 +78,7 @@ private function calculateDayOfCeuta(): void $this->addHoliday(new Holiday( 'ceutaDay', ['es' => 'Día de Ceuta'], - new DateTime("$this->year-9-2", new DateTimeZone($this->timezone)), + new DateTime("$this->year-9-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CommunityOfMadrid.php b/src/Yasumi/Provider/Spain/CommunityOfMadrid.php index a583943eb..cd2c10cd5 100755 --- a/src/Yasumi/Provider/Spain/CommunityOfMadrid.php +++ b/src/Yasumi/Provider/Spain/CommunityOfMadrid.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -84,7 +84,7 @@ private function calculateDosdeMayoUprisingDay(): void $this->addHoliday(new Holiday( 'dosdeMayoUprisingDay', ['es' => 'Fiesta de la Comunidad de Madrid'], - new DateTime("$this->year-5-2", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Extremadura.php b/src/Yasumi/Provider/Spain/Extremadura.php index cf3d0dab7..2f55b36a1 100755 --- a/src/Yasumi/Provider/Spain/Extremadura.php +++ b/src/Yasumi/Provider/Spain/Extremadura.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -81,7 +81,7 @@ private function calculateDayOfExtremadura(): void $this->addHoliday(new Holiday( 'extremaduraDay', ['es' => 'Día de Extremadura'], - new DateTime("$this->year-9-8", new DateTimeZone($this->timezone)), + new DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Galicia.php b/src/Yasumi/Provider/Spain/Galicia.php index ef5563516..6336ecbd5 100755 --- a/src/Yasumi/Provider/Spain/Galicia.php +++ b/src/Yasumi/Provider/Spain/Galicia.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -82,7 +82,7 @@ private function calculateGalicianLiteratureDay(): void $this->addHoliday(new Holiday('galicianLiteratureDay', [ 'es' => 'Día de las Letras Gallegas', 'gl' => 'Día das Letras Galegas', - ], new DateTime("$this->year-5-17", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -109,7 +109,7 @@ private function calculateStJamesDay(): void if ($this->year >= 2000) { $this->addHoliday(new Holiday('stJamesDay', [ 'es' => 'Santiago Apostol', - ], new DateTime("$this->year-7-25", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-7-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/LaRioja.php b/src/Yasumi/Provider/Spain/LaRioja.php index 1082f1e79..0073fa266 100755 --- a/src/Yasumi/Provider/Spain/LaRioja.php +++ b/src/Yasumi/Provider/Spain/LaRioja.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -77,7 +77,7 @@ private function calculateLaRiojaDay(): void if ($this->year >= 1983) { $this->addHoliday(new Holiday('laRiojaDay', [ 'es' => 'Día de La Rioja', - ], new DateTime("$this->year-6-9", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/RegionOfMurcia.php b/src/Yasumi/Provider/Spain/RegionOfMurcia.php index fa3938049..ff3de625d 100755 --- a/src/Yasumi/Provider/Spain/RegionOfMurcia.php +++ b/src/Yasumi/Provider/Spain/RegionOfMurcia.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -78,7 +78,7 @@ private function calculateDayOfMurcia(): void if ($this->year >= 1983) { $this->addHoliday(new Holiday('murciaDay', [ 'es' => 'Día de la Región de Murcia', - ], new DateTime("$this->year-6-9", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/ValencianCommunity.php b/src/Yasumi/Provider/Spain/ValencianCommunity.php index f886a019b..9583427f5 100755 --- a/src/Yasumi/Provider/Spain/ValencianCommunity.php +++ b/src/Yasumi/Provider/Spain/ValencianCommunity.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Spain; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Spain; /** @@ -89,7 +89,7 @@ private function calculateValencianCommunityDay(): void 'ca' => 'Diada Nacional del País Valencià', 'es' => 'Día de la Comunidad Valenciana', ], - new DateTime("$this->year-10-9", new DateTimeZone($this->timezone)), + new DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Sweden.php b/src/Yasumi/Provider/Sweden.php index 89f4abe01..67bac72a9 100644 --- a/src/Yasumi/Provider/Sweden.php +++ b/src/Yasumi/Provider/Sweden.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -90,7 +89,7 @@ public function calculateEpiphanyEve(): void $this->addHoliday(new Holiday( 'epiphanyEve', [], - new DateTime("$this->year-1-5", new DateTimeZone($this->timezone)), + new DateTime("$this->year-1-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -118,7 +117,7 @@ public function calculateWalpurgisEve(): void $this->addHoliday(new Holiday( 'walpurgisEve', [], - new DateTime("$this->year-4-30", new DateTimeZone($this->timezone)), + new DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -145,7 +144,7 @@ public function calculateWalpurgisEve(): void */ private function calculateStJohnsHolidays(): void { - $date = new DateTime("$this->year-6-20 this saturday", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-6-20 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'stJohnsDay', [], @@ -186,7 +185,7 @@ private function calculateStJohnsHolidays(): void */ private function calculateAllSaintsHolidays(): void { - $date = new DateTime("$this->year-10-31 this saturday", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'allSaintsDay', [], @@ -234,7 +233,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday( 'nationalDay', ['sv' => $holidayName], - new DateTime("$this->year-6-6", new DateTimeZone($this->timezone)), + new DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Switzerland.php b/src/Yasumi/Provider/Switzerland.php index 011d9bada..3ee6d4e3b 100644 --- a/src/Yasumi/Provider/Switzerland.php +++ b/src/Yasumi/Provider/Switzerland.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -75,7 +74,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday( 'swissNationalDay', $translations, - new DateTime($this->year . '-08-01', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -83,7 +82,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday( 'swissNationalDay', $translations, - new DateTime($this->year . '-08-01', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -113,7 +112,7 @@ public function calculateBerchtoldsTag(): void 'fr' => 'Jour de la Saint-Berthold', 'en' => 'Berchtoldstag', ], - new DateTime($this->year . '-01-02', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-01-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -138,7 +137,7 @@ public function calculateBettagsMontag(): void { if ($this->year >= 1832) { // Find third Sunday of September - $date = new DateTime('Third Sunday of ' . $this->year . '-09', new DateTimeZone($this->timezone)); + $date = new DateTime('Third Sunday of ' . $this->year . '-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); // Go to next Thursday $date->add(new DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Switzerland/Geneva.php b/src/Yasumi/Provider/Switzerland/Geneva.php index a82112c3b..2896476a0 100644 --- a/src/Yasumi/Provider/Switzerland/Geneva.php +++ b/src/Yasumi/Provider/Switzerland/Geneva.php @@ -14,11 +14,11 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -81,7 +81,7 @@ private function calculateJeuneGenevois(): void } // Find first Sunday of September - $date = new DateTime('First Sunday of ' . $this->year . '-09', new DateTimeZone($this->timezone)); + $date = new DateTime('First Sunday of ' . $this->year . '-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); // Go to next Thursday $date->add(new DateInterval('P4D')); @@ -118,7 +118,7 @@ private function calculateRestaurationGenevoise(): void [ 'fr' => 'Restauration de la République', ], - new DateTime($this->year . '-12-31', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-12-31', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Glarus.php b/src/Yasumi/Provider/Switzerland/Glarus.php index 310729a68..3d9c029aa 100644 --- a/src/Yasumi/Provider/Switzerland/Glarus.php +++ b/src/Yasumi/Provider/Switzerland/Glarus.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Switzerland; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -77,7 +77,7 @@ public function initialize(): void private function calculateNafelserFahrt(): void { if ($this->year >= 1389) { - $date = new DateTime('First Thursday of ' . $this->year . '-04', new DateTimeZone($this->timezone)); + $date = new DateTime('First Thursday of ' . $this->year . '-04', DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('nafelserFahrt', [ 'de' => 'Näfelser Fahrt', ], $date, $this->locale, Holiday::TYPE_OTHER)); diff --git a/src/Yasumi/Provider/Switzerland/Jura.php b/src/Yasumi/Provider/Switzerland/Jura.php index 6d86ea258..1d5501312 100644 --- a/src/Yasumi/Provider/Switzerland/Jura.php +++ b/src/Yasumi/Provider/Switzerland/Jura.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Switzerland; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -85,7 +85,7 @@ private function calculatePlebisciteJurassien(): void [ 'fr' => 'Commémoration du plébiscite jurassien', ], - new DateTime($this->year . '-06-23', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-06-23', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Neuchatel.php b/src/Yasumi/Provider/Switzerland/Neuchatel.php index 2ae9e936d..39eda16bf 100644 --- a/src/Yasumi/Provider/Switzerland/Neuchatel.php +++ b/src/Yasumi/Provider/Switzerland/Neuchatel.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Switzerland; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -83,7 +83,7 @@ private function calculateInstaurationRepublique(): void [ 'fr' => 'Instauration de la République', ], - new DateTime($this->year . '-03-01', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-03-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Obwalden.php b/src/Yasumi/Provider/Switzerland/Obwalden.php index 4c74f8f8c..36ea0c270 100644 --- a/src/Yasumi/Provider/Switzerland/Obwalden.php +++ b/src/Yasumi/Provider/Switzerland/Obwalden.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Switzerland; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -87,7 +87,7 @@ private function calculateBruderKlausenFest(): void [ 'de' => 'Bruder-Klausen-Fest', ], - new DateTime($this->year . '-09-25', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-09-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -97,7 +97,7 @@ private function calculateBruderKlausenFest(): void [ 'de' => 'Bruder-Klausen-Fest', ], - new DateTime($this->year . '-09-21', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-09-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Ticino.php b/src/Yasumi/Provider/Switzerland/Ticino.php index 426780034..9b885dac4 100644 --- a/src/Yasumi/Provider/Switzerland/Ticino.php +++ b/src/Yasumi/Provider/Switzerland/Ticino.php @@ -13,11 +13,11 @@ namespace Yasumi\Provider\Switzerland; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\Switzerland; /** @@ -94,7 +94,7 @@ private function calculateStPeterPaul(): void 'fr' => 'Solennité des saints Pierre et Paul', 'de' => 'St. Peter und Paul', ], - new DateTime($this->year . '-06-29', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-06-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/USA.php b/src/Yasumi/Provider/USA.php index 4f9f971f6..3cf5d4a88 100755 --- a/src/Yasumi/Provider/USA.php +++ b/src/Yasumi/Provider/USA.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -79,7 +78,7 @@ private function calculateMartinLutherKingday(): void if ($this->year >= 1986) { $this->addHoliday(new Holiday('martinLutherKingDay', [ 'en' => 'Dr. Martin Luther King Jr’s Birthday', - ], new DateTime("third monday of january $this->year", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("third monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -101,9 +100,9 @@ private function calculateMartinLutherKingday(): void private function calculateWashingtonsBirthday(): void { if ($this->year >= 1879) { - $date = new DateTime("$this->year-2-22", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-2-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1968) { - $date = new DateTime("third monday of february $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('washingtonsBirthday', [ 'en' => 'Washington’s Birthday', @@ -126,9 +125,9 @@ private function calculateWashingtonsBirthday(): void private function calculateMemorialDay(): void { if ($this->year >= 1865) { - $date = new DateTime("$this->year-5-30", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1968) { - $date = new DateTime("last monday of may $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('memorialDay', [ 'en' => 'Memorial Day', @@ -153,7 +152,7 @@ private function calculateIndependenceDay(): void if ($this->year >= 1776) { $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', - ], new DateTime("$this->year-7-4", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-7-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -175,7 +174,7 @@ private function calculateLabourDay(): void [ 'en' => 'Labour Day', ], - new DateTime("first monday of september $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -197,9 +196,9 @@ private function calculateLabourDay(): void private function calculateColumbusDay(): void { if ($this->year >= 1937) { - $date = new DateTime("$this->year-10-12", new DateTimeZone($this->timezone)); + $date = new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1970) { - $date = new DateTime("second monday of october $this->year", new DateTimeZone($this->timezone)); + $date = new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('columbusDay', [ 'en' => 'Columbus Day', @@ -225,7 +224,7 @@ private function calculateVeteransDay(): void $this->addHoliday(new Holiday('veteransDay', [ 'en' => $name, - ], new DateTime("$this->year-11-11", new DateTimeZone($this->timezone)), $this->locale)); + ], new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -249,7 +248,7 @@ private function calculateThanksgivingDay(): void [ 'en' => 'Thanksgiving Day', ], - new DateTime("fourth thursday of november $this->year", new DateTimeZone($this->timezone)), + new DateTime("fourth thursday of november $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/UnitedKingdom.php b/src/Yasumi/Provider/UnitedKingdom.php index e3a481784..0c89fd675 100644 --- a/src/Yasumi/Provider/UnitedKingdom.php +++ b/src/Yasumi/Provider/UnitedKingdom.php @@ -14,7 +14,6 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -87,7 +86,7 @@ protected function calculateNewYearsDay(): void $type = Holiday::TYPE_OBSERVANCE; } - $newYearsDay = new DateTime("$this->year-01-01", new DateTimeZone($this->timezone)); + $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); // If New Years Day falls on a Saturday or Sunday, it is observed the next Monday (January 2nd or 3rd) if (\in_array((int)$newYearsDay->format('w'), [0, 6], true)) { @@ -126,7 +125,7 @@ protected function calculateMayDayBankHoliday(): void $this->addHoliday(new Holiday( 'mayDayBankHoliday', ['en' => 'May Day Bank Holiday'], - new DateTime("$this->year-5-8", new DateTimeZone($this->timezone)), + new DateTime("$this->year-5-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -137,7 +136,7 @@ protected function calculateMayDayBankHoliday(): void $this->addHoliday(new Holiday( 'mayDayBankHoliday', ['en' => 'May Day Bank Holiday'], - new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -172,7 +171,7 @@ protected function calculateSpringBankHoliday(): void $this->addHoliday(new Holiday( 'springBankHoliday', ['en' => 'Spring Bank Holiday'], - new DateTime("$this->year-6-4", new DateTimeZone($this->timezone)), + new DateTime("$this->year-6-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -183,7 +182,7 @@ protected function calculateSpringBankHoliday(): void $this->addHoliday(new Holiday( 'springBankHoliday', ['en' => 'Spring Bank Holiday'], - new DateTime("last monday of may $this->year", new DateTimeZone($this->timezone)), + new DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -215,7 +214,7 @@ protected function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'August Bank Holiday'], - new DateTime("first monday of august $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -230,7 +229,7 @@ protected function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'Summer Bank Holiday'], - new DateTime("first monday of september $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -241,7 +240,7 @@ protected function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'Summer Bank Holiday'], - new DateTime("last monday of august $this->year", new DateTimeZone($this->timezone)), + new DateTime("last monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); diff --git a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php index 6575b016f..43f35b7e4 100644 --- a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php +++ b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php @@ -13,10 +13,10 @@ namespace Yasumi\Provider\UnitedKingdom; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\UnitedKingdom; use Yasumi\SubstituteHoliday; @@ -79,7 +79,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => 'St. Patrick’s Day'], - new DateTime($this->year . '-3-17', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); @@ -125,7 +125,7 @@ private function calculateBattleOfTheBoyne(): void $holiday = new Holiday( 'battleOfTheBoyne', ['en' => 'Battle of the Boyne'], - new DateTime($this->year . '-7-12', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-7-12', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); diff --git a/src/Yasumi/Provider/UnitedKingdom/Scotland.php b/src/Yasumi/Provider/UnitedKingdom/Scotland.php index ee25a7ac4..ebcb5435e 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Scotland.php +++ b/src/Yasumi/Provider/UnitedKingdom/Scotland.php @@ -14,10 +14,10 @@ use DateInterval; use DateTime; -use DateTimeZone; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; +use Yasumi\Provider\DateTimeZoneFactory; use Yasumi\Provider\UnitedKingdom; use Yasumi\SubstituteHoliday; @@ -99,7 +99,7 @@ protected function calculateNewYearsHolidays(): void $secondNewYearsDay = new Holiday( 'secondNewYearsDay', [], - new DateTime("$this->year-1-2", new DateTimeZone($this->timezone)), + new DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, $type ); @@ -153,7 +153,7 @@ protected function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'August Bank Holiday'], - new DateTime("first monday of august $this->year", new DateTimeZone($this->timezone)), + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -180,7 +180,7 @@ private function calculateStAndrewsDay(): void $holiday = new Holiday( 'stAndrewsDay', [], - new DateTime($this->year . '-11-30', new DateTimeZone($this->timezone)), + new DateTime($this->year . '-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); From 2c2d87d4f935237cb5e0063eacfcdcb736a948c0 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 29 Apr 2020 20:04:42 +0900 Subject: [PATCH 059/115] Removed unnecessary namespace. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Luxembourg.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php index 8c08b34f9..c1342f547 100755 --- a/src/Yasumi/Provider/Luxembourg.php +++ b/src/Yasumi/Provider/Luxembourg.php @@ -25,9 +25,9 @@ class Luxembourg extends AbstractProvider /** * Initialize holidays for Luxembourg. * - * @throws \Yasumi\Exception\InvalidDateException + * @throws InvalidDateException * @throws \InvalidArgumentException - * @throws \Yasumi\Exception\UnknownLocaleException + * @throws UnknownLocaleException * @throws \Exception */ public function initialize(): void From 20d2d48e5413dacd1b1dfd817928f168e6afe3b2 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 29 Apr 2020 20:05:10 +0900 Subject: [PATCH 060/115] Stricter type check. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Croatia.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index 21b68f5f7..36e695329 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -111,7 +111,7 @@ private function calculateHomelandThanksgivingDay(): void $names['hr'] = 'Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja'; } - if ($names != null) { + if ($names !== null) { $this->addHoliday(new Holiday( 'homelandThanksgiving', $names, From 6c6307e60475ac687cf2464203882741ad36de8a Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 29 Apr 2020 20:06:58 +0900 Subject: [PATCH 061/115] Removed unnecessary pass by reference. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Filters/AbstractFilter.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Filters/AbstractFilter.php b/src/Yasumi/Filters/AbstractFilter.php index b3e55c582..747913458 100644 --- a/src/Yasumi/Filters/AbstractFilter.php +++ b/src/Yasumi/Filters/AbstractFilter.php @@ -33,7 +33,7 @@ abstract class AbstractFilter extends FilterIterator implements Countable */ public function count(): int { - $names = \array_map(static function (&$holiday) { + $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { return $holiday->substitutedHoliday->shortName; } diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 3455bca25..618c0009c 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -313,7 +313,7 @@ public function whatWeekDayIs(string $shortName): int */ public function count(): int { - $names = \array_map(static function (&$holiday) { + $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { return $holiday->substitutedHoliday->shortName; } From 889f1e110250b3dfe82892d2d2e332886657d3ff Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 29 Apr 2020 20:49:26 +0900 Subject: [PATCH 062/115] Reorganized latest changes. Fixed various grammar errors, typos, etc. Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 66 ++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6dd65c2..827241ea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,42 +4,46 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] -- Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) -- Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) -- Independence Day is no longer an official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) -- Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) ### Added - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) +- Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) -- Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) +- Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) +- Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). + - Added missing return (correct) and parameter types in various methods. -- Day of Liberation (Tag der Befreiung) is an one-time official holiday in 2020 in Berlin (Germany). -- Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Changed +- Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Independence Day is no longer an official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) +- Second International Workers Day was an official holiday only until 2018. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) -- Changed fallback from DEFAULT_LANGUAGE to 'en'. [\#183](https://github.com/azuyalabs/yasumi/pull/183) ([c960657](https://github.com/c960657)) +- Changed the fallback from DEFAULT_LANGUAGE to 'en'. [\#183](https://github.com/azuyalabs/yasumi/pull/183) ([c960657](https://github.com/c960657)) + +- Introduced a DateTimeZoneFactory class to improve performance. This will keep a static reference to the instantiated DateTimezone, thus saving resources. [\#213](https://github.com/azuyalabs/yasumi/pull/213) ([pvgnd](https://github.com/pvgn)) - Changed DateTime to DateTimeImmutable as dates should be that: immutable (by default) - Explicitly set nullable parameters as such. - Refactored various conditional structures. - Changed signature of some methods as parameters with defaults should come after required parameters. - Updated third party dependencies. -- Second International Workers Day was an official holiday only until 2018. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Fixed +- Fixed Ukraine holidays on weekends. These days need to be substituted. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Fixed issue if the next working day happens to be in the next year (i.e. not in the year of the Yasumi instance) [\#192](https://github.com/azuyalabs/yasumi/issues/192) ([tniemann](https://github.com/tniemann)) -- Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) - Fix locale fallback for substitute holidays [\#180](https://github.com/azuyalabs/yasumi/pull/180) ([c960657](https://github.com/c960657)) +- Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance) + - Fixed compound conditions that are always true by simplifying the condition steps. -- Fixed Ukraine holidays on weekends. These days need to be substituted. [\#202](https://github.com/azuyalabs/yasumi/pull/202) ### Removed - PHP 7.1 Support, as it has reached its end of life. - Removed the assertion of the instance type in some functions as it is already defined by the return type. -- Removed unused variables, brackets, empty tests, etc. +- Removed unused variables, namespaces, brackets, empty tests, etc. ## [2.2.0] - 2019-10-06 @@ -51,7 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Translation for the Pentecost holiday for the 'fr_FR' locale [\#145](https://github.com/azuyalabs/yasumi/pull/145) ([pioc92](https://github.com/pioc92)) - Late Summer Bank Holiday in United Kingdom prior to 1965 [\#161](https://github.com/azuyalabs/yasumi/pull/161) ([c960657](https://github.com/c960657)) - Observance holidays for Sweden [\#172](https://github.com/azuyalabs/yasumi/pull/172) ([c960657](https://github.com/c960657)) -- Special subclass of Holiday for substitute holidays [\#162](https://github.com/azuyalabs/yasumi/pull/162) ([c960657](https://github.com/c960657)) +- Created a special subclass of Holiday for substitute holidays [\#162](https://github.com/azuyalabs/yasumi/pull/162) ([c960657](https://github.com/c960657)) - Added additional code style fixers and aligning StyleCI settings with PHP-CS. - Included extra requirement for some PHP Extensions in the composer file. @@ -68,7 +72,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - PHP 7.1 is allowed to fail for Travis-CI due to the fact PHPUnit 8 requires PHP >= 7.2. PHP 7.1 support will be dropped in Yasumi once 7.1 has reached its end of life (December 2019). - Code using class imports rather than Fully Qualified Class names. - Upgraded to PHPUnit 8. -- Replaced the standard 'InvalidArgumentException' when an invalid year or holiday provider are given by a new exception for each of these two situations separately ('InvalidYearException' and 'ProviderNotFoundException'). This allows you to better distinguish which exception may occur when instantiating the Yasumi class. [\#95](https://github.com/azuyalabs/yasumi/pull/95) ([qneyrat](https://github.com/qneyrat)) +- Replaced the standard 'InvalidArgumentException' when an invalid year or holiday provider is given by a new exception for each of these two situations separately ('InvalidYearException' and 'ProviderNotFoundException'). This allows you to better distinguish which exception may occur when instantiating the Yasumi class. [\#95](https://github.com/azuyalabs/yasumi/pull/95) ([qneyrat](https://github.com/qneyrat)) - Refactored the AbstractProvider::count method to use the newly added SubstituteHoliday class. - Fallback support added to getName() to allow e.g. fallback from 'de_AT' to 'de'. [\#176](https://github.com/azuyalabs/yasumi/pull/176) ([c960657](https://github.com/c960657)) @@ -90,7 +94,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [2.1.0] - 2019-03-29 ### Added -- As the Japanese Emperor will abdicate the throne on May 1st 2019, the holiday of the Emporers Birthday will change to February 23rd from 2020 (No holiday in 2019). In addition, Coronation Day and the Enthronement Proclamation Ceremony will be extra holidays in 2019. [\#130](https://github.com/azuyalabs/yasumi/pull/130) ([cookie-maker](https://github.com/cookie-maker)) +- As the Japanese Emperor will abdicate the throne on May 1st 2019, the holiday of the Emperors Birthday will change to February 23rd from 2020 (No holiday in 2019). In addition, Coronation Day and the Enthronement Proclamation Ceremony will be extra holidays in 2019. [\#130](https://github.com/azuyalabs/yasumi/pull/130) ([cookie-maker](https://github.com/cookie-maker)) - International Women's Day is an official holiday since 2019 in Berlin (Germany). [#133](https://github.com/azuyalabs/yasumi/pull/133) ([huehnerhose](https://github.com/huehnerhose)) ### Changed @@ -100,13 +104,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Visibility of internal class functions to 'private'. These are to be used within the class only and should not be public. ### Fixed -- "Bridge Day" for Japan takes two days in 2019. Currently the code only allows for 1 bridge day at a maximum. [\#141](https://github.com/azuyalabs/yasumi/pull/141) ([cookie-maker](https://github.com/cookie-maker)) +- "Bridge Day" for Japan takes two days in 2019. Currently, the code only allows for 1 bridge day at a maximum. [\#141](https://github.com/azuyalabs/yasumi/pull/141) ([cookie-maker](https://github.com/cookie-maker)) - Tests for Bremen, Lower Saxony and Schleswig Holstein (Germany) also celebrated Reformation Day in 2017. The unit tests were failing as it didn't account for that. - Changed the USA Provider to check all holidays for potential substitute holidays, not just New Year's Day, Independence Day, and Christmas Day. [\#140](https://github.com/azuyalabs/yasumi/pull/140) ([jagers](https://github.com/jagers)) - Adjusted tests for the 'next' and 'previous' methods to avoid actually exceeding the year boundaries. - Deprecation warning for the package mikey179/vfStream. Composer 2.0 requires package names to not contain any upper case characters. [\#135](https://github.com/azuyalabs/yasumi/pull/135) ([IceShack](https://github.com/IceShack)) - Incorrect comment about weekends in India [\#126](https://github.com/azuyalabs/yasumi/pull/126) ([c960657](https://github.com/c960657)) -- Correction to the test of New Year's day in the United Kingdom. It has been identified as a Bank Holiday only since 1975 (not from 1974). +- Correction to the test of New Year's Day in the United Kingdom. It has been identified as a Bank Holiday only since 1975 (not from 1974). ### Removed - Duplicate definition of newYearsDay [\#125](https://github.com/azuyalabs/yasumi/pull/125) ([c960657](https://github.com/c960657)) @@ -130,7 +134,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Changed Japanese holiday for the 2020 Olympic Games. Marine Day, Mountain Day and Health And Sports Day. [\#113](https://github.com/azuyalabs/yasumi/pull/113) ([cookie-maker](https://github.com/cookie-maker)) - Summer/winter time is now fetched from PHP's tz database. [\#103](https://github.com/azuyalabs/yasumi/pull/103) ([c960657](https://github.com/c960657)) - Changed translation for Norway's national day. [\#98](https://github.com/azuyalabs/yasumi/pull/98) ([c960657](https://github.com/c960657)) -- Applied proper null checks in the summertime and wintertime calculations for Denmark and The Netherlands. +- Applied proper null checks in the summer time and wintertime calculations for Denmark and The Netherlands. - Corrected some namespaces for Australia and Germany. - Updated copyright year. - Upgraded various dependency packages. @@ -140,7 +144,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Fixed - Translation for Russia showed in English (except New Year's Day) as the proper locale was not in place. -- Fixed issue for summertime in Denmark in 1980. By default summertime in Denmark is set for the last day of March since 1980, however in 1980 itself, it started on April, 6th. +- Fixed issue for summer time in Denmark in 1980. By default summertime in Denmark is set for the last day of March since 1980, however in 1980 itself, it started on April, 6th. - Fixed spelling issue in the Swedish translation. [\#97](https://github.com/azuyalabs/yasumi/pull/97) ([c960657](https://github.com/c960657)) - Fixed spelling issues in the Danish translation. [\#96](https://github.com/azuyalabs/yasumi/pull/96) ([c960657](https://github.com/c960657)) - Fixed German Easter Sunday and Pentecost Sunday holidays (not nationwide, only in Brandenburg). [\#100](https://github.com/azuyalabs/yasumi/pull/100) ([TalonTR](https://github.com/TalonTR)) @@ -169,7 +173,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Removed unnecessary NULL checks. ### Fixed -- Fixed Brazilian Carnaval Day and added Ash Wednesday to Brazilian Holidays. [\#92](https://github.com/azuyalabs/yasumi/pull/92) ([glauberm](https://github.com/glauberm)) +- Fixed Brazilian Carnival Day and added Ash Wednesday to Brazilian Holidays. [\#92](https://github.com/azuyalabs/yasumi/pull/92) ([glauberm](https://github.com/glauberm)) - Yasumi listed 01.04.2018 (Easter Sunday) for Spain as an official holiday, however it is not recognized as such. Fix made that recognizes Easter Sunday as being observed (in all regions). [\#86](https://github.com/azuyalabs/yasumi/pull/86) ([Bastian Konetzny](https://github.com/bkonetzny)) - Corrected reference to the Holiday Provider's ID to be static. - Changed weekend data property into constant as it is not dynamic (runtime). @@ -193,7 +197,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Changed - Made `calculate` method public and use of proper camel casing. [\#73](https://github.com/azuyalabs/yasumi/pull/73) ([patrickreck](https://github.com/patrickreck)) - Upgraded Faker Library to version 1.7 -- Renamed the holiday type NATIONAL to OFFICIAL. Subregions may have official holidays and the name NATIONAL doesn't suit these situations. [\#65](https://github.com/azuyalabs/yasumi/pull/65) +- Renamed the holiday type NATIONAL to OFFICIAL. Sub regions may have official holidays, and the name NATIONAL doesn't suit these situations. [\#65](https://github.com/azuyalabs/yasumi/pull/65) - Upgraded PHP-CS-Fixer to version 2.6 ### Fixed @@ -259,7 +263,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - To determine a set of holidays between two dates you can now use the aptly named 'between()' method. ### Changed -- All Holiday Provider must now implement a code that will identify it. Typically this is the ISO3166 code +- All Holiday Provider must now implement a code that will identify it. Typically, this is the ISO3166 code corresponding to the respective country or sub-region. This can help for purposes such as translations or interfacing with other API's for example. @@ -295,16 +299,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this holidays have been removed from the France Holiday providers and new providers for the departments Moselle, Bas-Rhin and Haut-Rhin are added. [\#17](https://github.com/azuyalabs/yasumi/issues/17) ([R2c](https://github.com/R2c)) - Updated locales list based on CLDR version 29. Removed locales of which the region identifier is not specified. -- Fixed issue for Sweden as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However the +- Fixed issue for Sweden as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However, the holiday has always been celebrated on a Saturday (between June 20 and June 26). - Fixed base test for some Spain/LaRioja as some holidays have been established only in a particular year, causing false failures in the unit tests. - Running php-cs-fixer fix . --level=psr2 generated a massive list of changes, and broke unit tests. Added a custom - .php_cs config file to adhere to the PSR-2 Coding Standards and resolve this issue. In addition the php-cs-fixer - command to has been added to composer to run the fixers and on the CI server (Travis), meaning PR’s will need to be + .php_cs config file to adhere to the PSR-2 Coding Standards and resolve this issue. In addition, the php-cs-fixer + command has been added to composer to run the fixers and on the CI server (Travis), meaning PR’s will need to be PSR2 compliant before they can be merged. If any files do not pass, the build fails. [\#15](https://github.com/azuyalabs/yasumi/issues/15) [\#16](https://github.com/azuyalabs/yasumi/pull/16) ([badams](https://github.com/badams)) - Accidentally the timezone for Norway was set to "Europe/Copenhagen". This has been corrected to "Europe/Oslo". [\#11](https://github.com/azuyalabs/yasumi/issues/11) [\#12](https://github.com/azuyalabs/yasumi/pull/12) ([badams](https://github.com/badams)) -- Fixed issue for Finland as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However since +- Fixed issue for Finland as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However, since 1955, the holiday has always been celebrated on a Saturday (between June 20 and June 26). @@ -315,7 +319,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added Holiday Provider for Sweden - Added Holiday Provider for Finland - New function 'isWorkingDay' added that determines whether a date represents a working day or not. A working day is - considered a date that is neither a holiday nor falls into the weekend. + a date that is neither a holiday nor falls into the weekend. ### Changed - Refactoring and cleanup of unit tests @@ -335,8 +339,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added Corpus Christi, St. Joseph's Day, Maundy Thursday, St. George's Day, St. John's Day to the common Christian Holidays. - Created separate tests for holidays that are substituted on different days. -- Allow for name spaced holiday providers. -- Added test for translation of Ash Wednesday and Valentinesday in the Netherlands. +- Allow for namespaced holiday providers. +- Added test for translation of Ash Wednesday and Valentines day in the Netherlands. - Added test to check whether all holidays for a Holiday Provider are defined by the respective provider class. ### Changed @@ -347,8 +351,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - For Japan substituted holidays had same date as the original holidays. ### Removed -- Removed support for PHP 5.4. Minimum version is now 5.5. PHP 7.0 is known to work however in Travis CI still allowed - to fail +- Removed support for PHP 5.4. The minimum version is now 5.5. PHP 7.0 is known to work however in Travis CI still allowed + to fail. ## [1.0.0] - 2015-04-21 From 8d6e103ae5f4504a472c4c5662cdd119809ad4a4 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 29 Apr 2020 15:32:48 +0200 Subject: [PATCH 063/115] Add substituted holidays for Australia (#201) --- CHANGELOG.md | 2 +- src/Yasumi/Provider/Australia.php | 152 ++++++++++++------ src/Yasumi/Provider/Australia/ACT.php | 10 +- src/Yasumi/Provider/Australia/NSW.php | 19 ++- src/Yasumi/Provider/Australia/NT.php | 20 +-- src/Yasumi/Provider/Australia/Queensland.php | 10 +- src/Yasumi/Provider/Australia/SA.php | 76 +++++++-- src/Yasumi/Provider/Australia/Tasmania.php | 20 +-- .../Australia/Tasmania/KingIsland.php | 11 +- .../Australia/Tasmania/South/Southeast.php | 11 +- src/Yasumi/Provider/Australia/Victoria.php | 10 +- src/Yasumi/Provider/Australia/WA.php | 20 +-- tests/Australia/AustraliaDayTest.php | 66 ++++++-- tests/YasumiBase.php | 70 ++++++-- 14 files changed, 334 insertions(+), 163 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 827241ea3..ee3516d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) - Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). - - Added missing return (correct) and parameter types in various methods. +- Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) ### Changed - Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index 8760dc629..2c7b0119d 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -14,9 +14,9 @@ use DateInterval; use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; +use Yasumi\SubstituteHoliday; /** * Provider for all holidays in Australia. @@ -69,51 +69,38 @@ public function initialize(): void */ private function calculateNewYearHolidays(): void { - $newyearsday = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $this->calculateHoliday('newYearsDay', $newyearsday, [], false, false); - switch ($newyearsday->format('w')) { + $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $this->addHoliday(new Holiday( + 'newYearsDay', + [], + $newYearsDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); + switch ($newYearsDay->format('w')) { case 0: // sunday - $newyearsday->add(new DateInterval('P1D')); - $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year’s Holiday'], false, false); + $newYearsDay->add(new DateInterval('P1D')); + $this->addHoliday(new Holiday( + 'newYearsHoliday', + ['en' => 'New Year’s Holiday'], + $newYearsDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; case 6: // saturday - $newyearsday->add(new DateInterval('P2D')); - $this->calculateHoliday('newYearsHoliday', $newyearsday, ['en' => 'New Year’s Holiday'], false, false); + $newYearsDay->add(new DateInterval('P2D')); + $this->addHoliday(new Holiday( + 'newYearsHoliday', + ['en' => 'New Year’s Holiday'], + $newYearsDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; } } - /** - * Function to simplify moving holidays to mondays if required - * - * @param string $shortName - * @param DateTime $date - * @param array $names - * @param bool $moveFromSaturday - * @param bool $moveFromSunday - * @param string $type - * - * @throws InvalidDateException - * @throws \InvalidArgumentException - * @throws UnknownLocaleException - * @throws \Exception - */ - public function calculateHoliday( - string $shortName, - DateTime $date, - array $names = [], - ?bool $moveFromSaturday = null, - ?bool $moveFromSunday = null, - ?string $type = null - ): void { - $day = (int)$date->format('w'); - if ((0 === $day && ($moveFromSunday ?? true)) || (6 === $day && ($moveFromSaturday ?? true))) { - $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P2D')); - } - - $this->addHoliday(new Holiday($shortName, $names, $date, $this->locale, $type ?? Holiday::TYPE_OFFICIAL)); - } - /** * Australia Day. * @@ -136,7 +123,27 @@ private function calculateAustraliaDay(): void { $date = new DateTime("$this->year-01-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $this->calculateHoliday('australiaDay', $date, ['en' => 'Australia Day']); + $holiday = new Holiday( + 'australiaDay', + ['en' => 'Australia Day'], + $date, + $this->locale, + Holiday::TYPE_OFFICIAL + ); + $this->addHoliday($holiday); + + $day = (int)$date->format('w'); + if (0 === $day || 6 === $day) { + $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P2D')); + + $this->addHoliday(new SubstituteHoliday( + $holiday, + [], + $date, + $this->locale, + Holiday::TYPE_OFFICIAL + )); + } } /** @@ -162,7 +169,13 @@ private function calculateAnzacDay(): void } $date = new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $this->calculateHoliday('anzacDay', $date, [], false, false); + $this->addHoliday(new Holiday( + 'anzacDay', + [], + $date, + $this->locale, + Holiday::TYPE_OFFICIAL + )); $easter = $this->calculateEaster($this->year, $this->timezone); $easterMonday = $this->calculateEaster($this->year, $this->timezone); @@ -171,9 +184,14 @@ private function calculateAnzacDay(): void $fDate = $date->format('Y-m-d'); if ($fDate === $easter->format('Y-m-d') || $fDate === $easterMonday->format('Y-m-d')) { $easterMonday->add(new DateInterval('P1D')); - $this->calculateHoliday('easterTuesday', $easterMonday, ['en' => 'Easter Tuesday'], false, false); + $this->addHoliday(new Holiday( + 'easterTuesday', + ['en' => 'Easter Tuesday'], + $easterMonday, + $this->locale, + Holiday::TYPE_OFFICIAL + )); } - unset($fDate); } /** @@ -192,23 +210,59 @@ private function calculateChristmasDay(): void { $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $boxingDay = new DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); - $this->calculateHoliday('secondChristmasDay', $boxingDay, [], false, false); + $this->addHoliday(new Holiday( + 'christmasDay', + [], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); + $this->addHoliday(new Holiday( + 'secondChristmasDay', + [], + $boxingDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); switch ($christmasDay->format('w')) { case 0: // sunday $christmasDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); + $this->addHoliday(new Holiday( + 'christmasHoliday', + ['en' => 'Christmas Holiday'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; case 5: // friday $boxingDay->add(new DateInterval('P2D')); - $this->calculateHoliday('secondChristmasHoliday', $boxingDay, ['en' => 'Boxing Day Holiday'], false, false); + $this->addHoliday(new Holiday( + 'secondChristmasHoliday', + ['en' => 'Boxing Day Holiday'], + $boxingDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; case 6: // saturday $christmasDay->add(new DateInterval('P2D')); $boxingDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); - $this->calculateHoliday('secondChristmasHoliday', $boxingDay, ['en' => 'Boxing Day Holiday'], false, false); + $this->addHoliday(new Holiday( + 'christmasHoliday', + ['en' => 'Christmas Holiday'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); + $this->addHoliday(new Holiday( + 'secondChristmasHoliday', + ['en' => 'Boxing Day Holiday'], + $boxingDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; } } diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/ACT.php index 8566794a4..8fe38d906 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/ACT.php @@ -141,13 +141,13 @@ private function easterSaturday( */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NSW.php index 8ee2b06f8..9e7b37984 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NSW.php @@ -104,13 +104,13 @@ private function easterSaturday( */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** @@ -133,13 +133,12 @@ private function calculateLabourDay(): void */ private function calculateBankHoliday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'bankHoliday', - new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Bank Holiday'], - false, - false, + new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, Holiday::TYPE_BANK - ); + )); } } diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NT.php index 2953fdfce..9ced7b4f9 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NT.php @@ -103,13 +103,13 @@ private function easterSaturday( */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** @@ -134,12 +134,12 @@ private function calculateMayDay(): void */ private function calculatePicnicDay(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'picnicDay', - new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Picnic Day'], - false, - false - ); + new DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } diff --git a/src/Yasumi/Provider/Australia/Queensland.php b/src/Yasumi/Provider/Australia/Queensland.php index bf94ea364..61390df86 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -70,13 +70,13 @@ private function calculateQueensBirthday(): void $birthDay = 'second monday of june ' . $this->year; } - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SA.php index 0df4ba8ac..9af05b5b4 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SA.php @@ -111,13 +111,13 @@ private function easterSaturday( */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** @@ -149,13 +149,13 @@ private function calculateAdelaideCupDay(): void $cupDay = 'third monday of may ' . $this->year; } - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'adelaideCup', - new DateTime($cupDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Adelaide Cup'], - false, - false - ); + new DateTime($cupDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } @@ -167,27 +167,69 @@ private function calculateAdelaideCupDay(): void private function calculateProclamationDay(): void { $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $this->calculateHoliday('christmasDay', $christmasDay, [], false, false); + $this->addHoliday(new Holiday( + 'christmasDay', + [], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); switch ($christmasDay->format('w')) { case 0: // sunday $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); + $this->addHoliday(new Holiday( + 'christmasHoliday', + ['en' => 'Christmas Holiday'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); + $this->addHoliday(new Holiday( + 'proclamationDay', + ['en' => 'Proclamation Day'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; case 5: // friday $proclamationDay = $christmasDay->add(new DateInterval('P3D')); - $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); + $this->addHoliday(new Holiday( + 'proclamationDay', + ['en' => 'Proclamation Day'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; case 6: // saturday $christmasDay->add(new DateInterval('P2D')); - $this->calculateHoliday('christmasHoliday', $christmasDay, ['en' => 'Christmas Holiday'], false, false); + $this->addHoliday(new Holiday( + 'christmasHoliday', + ['en' => 'Christmas Holiday'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); + $this->addHoliday(new Holiday( + 'proclamationDay', + ['en' => 'Proclamation Day'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; default: // monday-thursday $proclamationDay = $christmasDay->add(new DateInterval('P1D')); - $this->calculateHoliday('proclamationDay', $proclamationDay, ['en' => 'Proclamation Day'], false, false); + $this->addHoliday(new Holiday( + 'proclamationDay', + ['en' => 'Proclamation Day'], + $christmasDay, + $this->locale, + Holiday::TYPE_OFFICIAL + )); break; } } diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index 9da36a0f2..8e959d089 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -77,13 +77,13 @@ private function calculateEightHoursDay(): void */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** @@ -96,12 +96,12 @@ private function calculateQueensBirthday(): void */ private function calculateRecreationDay(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'recreationDay', - new DateTime('first monday of november ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Recreation Day'], - false, - false - ); + new DateTime('first monday of november ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } diff --git a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php index 59772daf6..135935f9b 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php @@ -14,6 +14,7 @@ use DateTime; use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; use Yasumi\Provider\DateTimeZoneFactory; @@ -51,12 +52,12 @@ public function initialize(): void */ private function calculateKingIslandShow(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'kingIslandShow', - new DateTime('first tuesday of march ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'King Island Show'], - false, - false - ); + new DateTime('first tuesday of march ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } diff --git a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php index 2887ad2ae..1fd234cd1 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php @@ -14,6 +14,7 @@ use DateTime; use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania\South; use Yasumi\Provider\DateTimeZoneFactory; @@ -54,12 +55,12 @@ public function initialize(): void */ private function calculateHobartRegatta(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'hobartRegatta', - new DateTime('second monday of february ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Royal Hobart Regatta'], - false, - false - ); + new DateTime('second monday of february ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index 50eb34216..9b77d3a38 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -153,13 +153,13 @@ private function calculateLabourDay(): void */ private function calculateQueensBirthday(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WA.php index f0e6dceb6..18f6c3533 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WA.php @@ -74,13 +74,13 @@ private function calculateQueensBirthday(): void $birthDay = '2012-10-01'; } - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'queensBirthday', - new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), [], - false, - false - ); + new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } /** @@ -105,12 +105,12 @@ private function calculateLabourDay(): void */ private function calculateWesternAustraliaDay(): void { - $this->calculateHoliday( + $this->addHoliday(new Holiday( 'westernAustraliaDay', - new DateTime('first monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), ['en' => 'Western Australia Day'], - false, - false - ); + new DateTime('first monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); } } diff --git a/tests/Australia/AustraliaDayTest.php b/tests/Australia/AustraliaDayTest.php index 7c9da1fd3..158df0e3d 100644 --- a/tests/Australia/AustraliaDayTest.php +++ b/tests/Australia/AustraliaDayTest.php @@ -30,7 +30,7 @@ class AustraliaDayTest extends AustraliaBaseTestCase implements YasumiTestCaseIn public const HOLIDAY = 'australiaDay'; /** - * Tests Australia Day + * Tests the holiday defined in this test. * * @dataProvider HolidayDataProvider * @@ -38,16 +38,39 @@ class AustraliaDayTest extends AustraliaBaseTestCase implements YasumiTestCaseIn * @param DateTime $expected the expected date * * @throws ReflectionException - * @throws Exception */ public function testHoliday($year, $expected) { - $this->assertHoliday( - $this->region, - self::HOLIDAY, - $year, - new DateTime($expected, new DateTimeZone($this->timezone)) - ); + $this->assertHoliday($this->region, self::HOLIDAY, $year, $expected); + } + + /** + * Tests Australia Day + * + * @dataProvider SubstituteHolidayDataProvider + * + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + * @throws Exception + */ + public function testSubstituteHoliday($year, $expected) + { + if ($expected) { + $this->assertSubstituteHoliday( + $this->region, + self::HOLIDAY, + $year, + new DateTime($expected, new DateTimeZone($this->timezone)) + ); + } else { + $this->assertNotSubstituteHoliday( + $this->region, + self::HOLIDAY, + $year + ); + } } @@ -75,22 +98,33 @@ public function testHolidayType(): void } /** - * Returns a list of test dates + * Returns a list of random test dates used for assertion of the holiday defined in this test * * @return array list of test dates for the holiday defined in this test + * @throws Exception */ public function HolidayDataProvider(): array + { + return $this->generateRandomDates(1, 26, $this->timezone); + } + + /** + * Returns a list of test dates + * + * @return array list of test dates for the holiday defined in this test + */ + public function SubstituteHolidayDataProvider(): array { return [ - [2010, '2010-01-26'], - [2011, '2011-01-26'], - [2012, '2012-01-26'], + [2010, null], + [2011, null], + [2012, null], [2013, '2013-01-28'], [2014, '2014-01-27'], - [2015, '2015-01-26'], - [2016, '2016-01-26'], - [2017, '2017-01-26'], - [2018, '2018-01-26'], + [2015, null], + [2016, null], + [2017, null], + [2018, null], [2019, '2019-01-28'], [2020, '2020-01-27'], ]; diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index 3d4ea703c..c6847b837 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -30,6 +30,7 @@ use Yasumi\Filters\OtherHolidaysFilter; use Yasumi\Filters\SeasonalHolidaysFilter; use Yasumi\Holiday; +use Yasumi\SubstituteHoliday; use Yasumi\Yasumi; /** @@ -84,8 +85,6 @@ public function assertDefinedHolidays( foreach ($expectedHolidays as $holiday) { $this->assertArrayHasKey($holiday, \iterator_to_array($holidays)); } - - unset($holidays); } /** @@ -113,11 +112,8 @@ public function assertHoliday( $holiday = $holidays->getHoliday($shortName); $this->assertInstanceOf(Holiday::class, $holiday); - $this->assertNotNull($holiday); $this->assertEquals($expected, $holiday); $this->assertTrue($holidays->isHoliday($holiday)); - - unset($holiday, $holidays); } /** @@ -143,8 +139,61 @@ public function assertNotHoliday( $holiday = $holidays->getHoliday($shortName); $this->assertNull($holiday); + } + + /** + * Asserts that the expected date is indeed a substitute holiday for that given year and name + * + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $shortName string the short name of the substituted holiday to be checked against + * @param int $year holiday calendar year + * @param DateTime $expected the date to be checked against + * + * @throws UnknownLocaleException + * @throws InvalidDateException + * @throws InvalidArgumentException + * @throws RuntimeException + * @throws AssertionFailedError + * @throws ReflectionException + */ + public function assertSubstituteHoliday( + string $provider, + string $shortName, + int $year, + DateTime $expected + ): void { + $holidays = Yasumi::create($provider, $year); + $holiday = $holidays->getHoliday('substituteHoliday:' . $shortName); - unset($holiday, $holidays); + $this->assertInstanceOf(SubstituteHoliday::class, $holiday); + $this->assertEquals($expected, $holiday); + $this->assertTrue($holidays->isHoliday($holiday)); + } + + /** + * Asserts that the given substitute holiday for that given year does not exist. + * + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $shortName the short name of the substituted holiday to be checked against + * @param int $year holiday calendar year + * + * @throws InvalidArgumentException + * @throws RuntimeException + * @throws UnknownLocaleException + * @throws InvalidDateException + * @throws AssertionFailedError + * @throws ReflectionException + */ + public function assertNotSubstituteHoliday( + string $provider, + string $shortName, + int $year + ): void { + $this->assertNotHoliday( + $provider, + 'substituteHoliday:' . $shortName, + $year + ); } /** @@ -171,7 +220,6 @@ public function assertTranslatedHolidayName( $holiday = $holidays->getHoliday($shortName); $this->assertInstanceOf(Holiday::class, $holiday); - $this->assertNotNull($holiday); $this->assertTrue($holidays->isHoliday($holiday)); if (\is_array($translations) && !empty($translations)) { @@ -194,8 +242,6 @@ public function assertTranslatedHolidayName( $this->assertEquals($name, $translation); } } - - unset($holiday, $holidays); } /** @@ -222,10 +268,7 @@ public function assertHolidayType( $holiday = $holidays->getHoliday($shortName); $this->assertInstanceOf(Holiday::class, $holiday); - $this->assertNotNull($holiday); $this->assertEquals($type, $holiday->getType()); - - unset($holiday, $holidays); } /** @@ -253,11 +296,8 @@ public function assertDayOfWeek( $holiday = $holidays->getHoliday($shortName); $this->assertInstanceOf(Holiday::class, $holiday); - $this->assertNotNull($holiday); $this->assertTrue($holidays->isHoliday($holiday)); $this->assertEquals($expectedDayOfWeek, $holiday->format('l')); - - unset($holiday, $holidays); } /** From 40c78fe13c7121dbaa091b8c787265e9d76df58b Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 1 May 2020 09:48:13 +0900 Subject: [PATCH 064/115] Change names of Australian States (#214) --- ...ACT.php => AustralianCapitalTerritory.php} | 2 +- .../Australia/{NSW.php => NewSouthWales.php} | 2 +- .../{NT.php => NorthernTerritory.php} | 2 +- .../Australia/{SA.php => SouthAustralia.php} | 2 +- .../{WA.php => WesternAustralia.php} | 2 +- .../AnzacDayTest.php | 20 +++++++++++++++++++ .../AustraliaDayTest.php | 20 +++++++++++++++++++ ...ustralianCapitalTerritoryBaseTestCase.php} | 8 ++++---- .../AustralianCapitalTerritoryTest.php} | 8 ++++---- .../BoxingDayTest.php | 4 ++-- .../CanberraDayTest.php | 6 +++--- .../ChristmasDayTest.php | 4 ++-- .../EasterMondayTest.php | 20 +++++++++++++++++++ .../EasterSaturdayTest.php | 6 +++--- .../EasterSundayTest.php | 6 +++--- .../GoodFridayTest.php | 20 +++++++++++++++++++ .../LabourDayTest.php | 6 +++--- .../NewYearsDayTest.php | 20 +++++++++++++++++++ .../QueensBirthdayTest.php | 6 +++--- .../ReconciliationDayTest.php | 6 +++--- .../{NSW => NewSouthWales}/AnzacDayTest.php | 4 ++-- .../AustraliaDayTest.php | 4 ++-- .../BankHolidayTest.php | 6 +++--- .../{NSW => NewSouthWales}/BoxingDayTest.php | 4 ++-- .../ChristmasDayTest.php | 4 ++-- .../EasterMondayTest.php | 4 ++-- .../EasterSaturdayTest.php | 6 +++--- .../EasterSundayTest.php | 6 +++--- .../{ACT => NewSouthWales}/GoodFridayTest.php | 4 ++-- .../{ACT => NewSouthWales}/LabourDayTest.php | 6 +++--- .../NewSouthWalesBaseTestCase.php} | 8 ++++---- .../NewSouthWalesTest.php} | 10 +++++----- .../NewYearsDayTest.php | 4 ++-- .../QueensBirthdayTest.php | 6 +++--- .../AnzacDayTest.php | 4 ++-- .../AustraliaDayTest.php | 4 ++-- .../BoxingDayTest.php | 4 ++-- .../ChristmasDayTest.php | 4 ++-- .../EasterMondayTest.php | 4 ++-- .../EasterSaturdayTest.php | 6 +++--- .../GoodFridayTest.php | 4 ++-- .../{NT => NorthernTerritory}/MayDayTest.php | 6 +++--- .../NewYearsDayTest.php | 4 ++-- .../NorthernTerritoryBaseTestCase.php} | 8 ++++---- .../NorthernTerritoryTest.php} | 8 ++++---- .../PicnicDayTest.php | 6 +++--- .../QueensBirthdayTest.php | 6 +++--- .../AdelaideCupDayTest.php | 6 +++--- .../{ACT => SouthAustralia}/AnzacDayTest.php | 4 ++-- .../AustraliaDayTest.php | 4 ++-- .../ChristmasDayTest.php | 4 ++-- .../EasterMondayTest.php | 4 ++-- .../EasterSaturdayTest.php | 6 +++--- .../GoodFridayTest.php | 4 ++-- .../{NSW => SouthAustralia}/LabourDayTest.php | 6 +++--- .../NewYearsDayTest.php | 4 ++-- .../ProclamationDayTest.php | 6 +++--- .../QueensBirthdayTest.php | 6 +++--- .../SouthAustraliaBaseTestCase.php} | 6 +++--- .../SouthAustraliaTest.php} | 8 ++++---- tests/Australia/WA/AnzacDayTest.php | 20 ------------------- tests/Australia/WA/AustraliaDayTest.php | 20 ------------------- tests/Australia/WA/EasterMondayTest.php | 20 ------------------- tests/Australia/WA/GoodFridayTest.php | 20 ------------------- tests/Australia/WA/NewYearsDayTest.php | 20 ------------------- .../{NT => WesternAustralia}/AnzacDayTest.php | 4 ++-- .../AustraliaDayTest.php | 4 ++-- .../BoxingDayTest.php | 4 ++-- .../ChristmasDayTest.php | 4 ++-- .../EasterMondayTest.php | 4 ++-- .../GoodFridayTest.php | 4 ++-- .../LabourDayTest.php | 6 +++--- .../NewYearsDayTest.php | 4 ++-- .../QueensBirthdayTest.php | 6 +++--- .../WesternAustraliaBaseTestCase.php} | 6 +++--- .../WesternAustraliaDayTest.php | 6 +++--- .../WesternAustraliaTest.php} | 8 ++++---- 77 files changed, 271 insertions(+), 271 deletions(-) rename src/Yasumi/Provider/Australia/{ACT.php => AustralianCapitalTerritory.php} (99%) rename src/Yasumi/Provider/Australia/{NSW.php => NewSouthWales.php} (99%) rename src/Yasumi/Provider/Australia/{NT.php => NorthernTerritory.php} (99%) rename src/Yasumi/Provider/Australia/{SA.php => SouthAustralia.php} (99%) rename src/Yasumi/Provider/Australia/{WA.php => WesternAustralia.php} (98%) create mode 100644 tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php create mode 100644 tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php rename tests/Australia/{ACT/ACTBaseTestCase.php => AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php} (68%) rename tests/Australia/{ACT/ACTTest.php => AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php} (78%) rename tests/Australia/{ACT => AustralianCapitalTerritory}/BoxingDayTest.php (73%) rename tests/Australia/{ACT => AustralianCapitalTerritory}/CanberraDayTest.php (91%) rename tests/Australia/{NSW => AustralianCapitalTerritory}/ChristmasDayTest.php (73%) create mode 100644 tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php rename tests/Australia/{NSW => AustralianCapitalTerritory}/EasterSaturdayTest.php (90%) rename tests/Australia/{ACT => AustralianCapitalTerritory}/EasterSundayTest.php (90%) create mode 100644 tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php rename tests/Australia/{SA => AustralianCapitalTerritory}/LabourDayTest.php (90%) create mode 100644 tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php rename tests/Australia/{ACT => AustralianCapitalTerritory}/QueensBirthdayTest.php (91%) rename tests/Australia/{ACT => AustralianCapitalTerritory}/ReconciliationDayTest.php (91%) rename tests/Australia/{NSW => NewSouthWales}/AnzacDayTest.php (77%) rename tests/Australia/{NT => NewSouthWales}/AustraliaDayTest.php (77%) rename tests/Australia/{NSW => NewSouthWales}/BankHolidayTest.php (91%) rename tests/Australia/{NSW => NewSouthWales}/BoxingDayTest.php (77%) rename tests/Australia/{ACT => NewSouthWales}/ChristmasDayTest.php (77%) rename tests/Australia/{ACT => NewSouthWales}/EasterMondayTest.php (77%) rename tests/Australia/{NT => NewSouthWales}/EasterSaturdayTest.php (91%) rename tests/Australia/{NSW => NewSouthWales}/EasterSundayTest.php (91%) rename tests/Australia/{ACT => NewSouthWales}/GoodFridayTest.php (77%) rename tests/Australia/{ACT => NewSouthWales}/LabourDayTest.php (92%) rename tests/Australia/{NSW/NSWBaseTestCase.php => NewSouthWales/NewSouthWalesBaseTestCase.php} (72%) rename tests/Australia/{NSW/NSWTest.php => NewSouthWales/NewSouthWalesTest.php} (79%) rename tests/Australia/{ACT => NewSouthWales}/NewYearsDayTest.php (77%) rename tests/Australia/{NT => NewSouthWales}/QueensBirthdayTest.php (92%) rename tests/Australia/{SA => NorthernTerritory}/AnzacDayTest.php (76%) rename tests/Australia/{SA => NorthernTerritory}/AustraliaDayTest.php (76%) rename tests/Australia/{WA => NorthernTerritory}/BoxingDayTest.php (76%) rename tests/Australia/{WA => NorthernTerritory}/ChristmasDayTest.php (76%) rename tests/Australia/{SA => NorthernTerritory}/EasterMondayTest.php (76%) rename tests/Australia/{SA => NorthernTerritory}/EasterSaturdayTest.php (91%) rename tests/Australia/{SA => NorthernTerritory}/GoodFridayTest.php (76%) rename tests/Australia/{NT => NorthernTerritory}/MayDayTest.php (91%) rename tests/Australia/{SA => NorthernTerritory}/NewYearsDayTest.php (76%) rename tests/Australia/{NT/NTBaseTestCase.php => NorthernTerritory/NorthernTerritoryBaseTestCase.php} (71%) rename tests/Australia/{NT/NTTest.php => NorthernTerritory/NorthernTerritoryTest.php} (80%) rename tests/Australia/{NT => NorthernTerritory}/PicnicDayTest.php (91%) rename tests/Australia/{NSW => NorthernTerritory}/QueensBirthdayTest.php (92%) rename tests/Australia/{SA => SouthAustralia}/AdelaideCupDayTest.php (93%) rename tests/Australia/{ACT => SouthAustralia}/AnzacDayTest.php (77%) rename tests/Australia/{NSW => SouthAustralia}/AustraliaDayTest.php (77%) rename tests/Australia/{SA => SouthAustralia}/ChristmasDayTest.php (95%) rename tests/Australia/{NSW => SouthAustralia}/EasterMondayTest.php (77%) rename tests/Australia/{ACT => SouthAustralia}/EasterSaturdayTest.php (91%) rename tests/Australia/{NSW => SouthAustralia}/GoodFridayTest.php (77%) rename tests/Australia/{NSW => SouthAustralia}/LabourDayTest.php (92%) rename tests/Australia/{NSW => SouthAustralia}/NewYearsDayTest.php (77%) rename tests/Australia/{SA => SouthAustralia}/ProclamationDayTest.php (91%) rename tests/Australia/{SA => SouthAustralia}/QueensBirthdayTest.php (92%) rename tests/Australia/{SA/SABaseTestCase.php => SouthAustralia/SouthAustraliaBaseTestCase.php} (80%) rename tests/Australia/{SA/SATest.php => SouthAustralia/SouthAustraliaTest.php} (80%) delete mode 100644 tests/Australia/WA/AnzacDayTest.php delete mode 100644 tests/Australia/WA/AustraliaDayTest.php delete mode 100644 tests/Australia/WA/EasterMondayTest.php delete mode 100644 tests/Australia/WA/GoodFridayTest.php delete mode 100644 tests/Australia/WA/NewYearsDayTest.php rename tests/Australia/{NT => WesternAustralia}/AnzacDayTest.php (76%) rename tests/Australia/{ACT => WesternAustralia}/AustraliaDayTest.php (76%) rename tests/Australia/{NT => WesternAustralia}/BoxingDayTest.php (76%) rename tests/Australia/{NT => WesternAustralia}/ChristmasDayTest.php (76%) rename tests/Australia/{NT => WesternAustralia}/EasterMondayTest.php (76%) rename tests/Australia/{NT => WesternAustralia}/GoodFridayTest.php (76%) rename tests/Australia/{WA => WesternAustralia}/LabourDayTest.php (91%) rename tests/Australia/{NT => WesternAustralia}/NewYearsDayTest.php (76%) rename tests/Australia/{WA => WesternAustralia}/QueensBirthdayTest.php (92%) rename tests/Australia/{WA/WABaseTestCase.php => WesternAustralia/WesternAustraliaBaseTestCase.php} (79%) rename tests/Australia/{WA => WesternAustralia}/WesternAustraliaDayTest.php (91%) rename tests/Australia/{WA/WATest.php => WesternAustralia/WesternAustraliaTest.php} (80%) diff --git a/src/Yasumi/Provider/Australia/ACT.php b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php similarity index 99% rename from src/Yasumi/Provider/Australia/ACT.php rename to src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php index 8fe38d906..677f15d33 100644 --- a/src/Yasumi/Provider/Australia/ACT.php +++ b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php @@ -23,7 +23,7 @@ * Provider for all holidays in Australian Capital Territory (Australia). * */ -class ACT extends Australia +class AustralianCapitalTerritory extends Australia { /** * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective diff --git a/src/Yasumi/Provider/Australia/NSW.php b/src/Yasumi/Provider/Australia/NewSouthWales.php similarity index 99% rename from src/Yasumi/Provider/Australia/NSW.php rename to src/Yasumi/Provider/Australia/NewSouthWales.php index 9e7b37984..9b498ba12 100644 --- a/src/Yasumi/Provider/Australia/NSW.php +++ b/src/Yasumi/Provider/Australia/NewSouthWales.php @@ -23,7 +23,7 @@ * Provider for all holidays in New South Wales (Australia). * */ -class NSW extends Australia +class NewSouthWales extends Australia { /** * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective diff --git a/src/Yasumi/Provider/Australia/NT.php b/src/Yasumi/Provider/Australia/NorthernTerritory.php similarity index 99% rename from src/Yasumi/Provider/Australia/NT.php rename to src/Yasumi/Provider/Australia/NorthernTerritory.php index 9ced7b4f9..a053ecf32 100644 --- a/src/Yasumi/Provider/Australia/NT.php +++ b/src/Yasumi/Provider/Australia/NorthernTerritory.php @@ -23,7 +23,7 @@ * Provider for all holidays in Northern Territory (Australia). * */ -class NT extends Australia +class NorthernTerritory extends Australia { /** * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective diff --git a/src/Yasumi/Provider/Australia/SA.php b/src/Yasumi/Provider/Australia/SouthAustralia.php similarity index 99% rename from src/Yasumi/Provider/Australia/SA.php rename to src/Yasumi/Provider/Australia/SouthAustralia.php index 9af05b5b4..51e2025ca 100644 --- a/src/Yasumi/Provider/Australia/SA.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -23,7 +23,7 @@ * Provider for all holidays in South Australia (Australia). * */ -class SA extends Australia +class SouthAustralia extends Australia { /** * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective diff --git a/src/Yasumi/Provider/Australia/WA.php b/src/Yasumi/Provider/Australia/WesternAustralia.php similarity index 98% rename from src/Yasumi/Provider/Australia/WA.php rename to src/Yasumi/Provider/Australia/WesternAustralia.php index 18f6c3533..7ffe8e68f 100644 --- a/src/Yasumi/Provider/Australia/WA.php +++ b/src/Yasumi/Provider/Australia/WesternAustralia.php @@ -22,7 +22,7 @@ * Provider for all holidays in Western Australia (Australia). * */ -class WA extends Australia +class WesternAustralia extends Australia { /** * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective diff --git a/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php b/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php new file mode 100644 index 000000000..fb5dc902f --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php @@ -0,0 +1,20 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing ANZAC day in Australian Capital Territory (Australia).. + */ +class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest +{ +} diff --git a/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php b/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php new file mode 100644 index 000000000..f903a29f9 --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php @@ -0,0 +1,20 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing Australia day in Australian Capital Territory (Australia).. + */ +class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest +{ +} diff --git a/tests/Australia/ACT/ACTBaseTestCase.php b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php similarity index 68% rename from tests/Australia/ACT/ACTBaseTestCase.php rename to tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php index 5bc4a73b6..850f4e99e 100644 --- a/tests/Australia/ACT/ACTBaseTestCase.php +++ b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php @@ -10,22 +10,22 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use Yasumi\tests\Australia\AustraliaBaseTestCase; use Yasumi\tests\YasumiBase; /** - * Base class for test cases of the ACT holiday provider. + * Base class for test cases of the Australian Capital Territory holiday provider. */ -abstract class ACTBaseTestCase extends AustraliaBaseTestCase +abstract class AustralianCapitalTerritoryBaseTestCase extends AustraliaBaseTestCase { use YasumiBase; /** * Name of the region (e.g. country / state) to be tested */ - public $region = 'Australia\ACT'; + public $region = 'Australia\AustralianCapitalTerritory'; /** * Timezone in which this provider has holidays defined diff --git a/tests/Australia/ACT/ACTTest.php b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php similarity index 78% rename from tests/Australia/ACT/ACTTest.php rename to tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php index ee37b5c17..482da8b1d 100644 --- a/tests/Australia/ACT/ACTTest.php +++ b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php @@ -10,15 +10,15 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use ReflectionException; use Yasumi\Holiday; /** - * Class for testing holidays in ACT (Australia). + * Class for testing holidays in Australian Capital Territory (Australia). */ -class ACTTest extends ACTBaseTestCase +class AustralianCapitalTerritoryTest extends AustralianCapitalTerritoryBaseTestCase { /** * @var int year random year number used for all tests in this Test Case @@ -26,7 +26,7 @@ class ACTTest extends ACTBaseTestCase protected $year; /** - * Tests if all official holidays in ACT (Australia) are defined by the provider class + * Tests if all official holidays in Australian Capital Territory (Australia) are defined by the provider class * @throws ReflectionException */ public function testOfficialHolidays(): void diff --git a/tests/Australia/ACT/BoxingDayTest.php b/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php similarity index 73% rename from tests/Australia/ACT/BoxingDayTest.php rename to tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php index 64eb91170..d14dff3ac 100644 --- a/tests/Australia/ACT/BoxingDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; /** - * Class for testing Boxing Day in ACT (Australia).. + * Class for testing Boxing Day in Australian Capital Territory (Australia).. */ class BoxingDayTest extends \Yasumi\tests\Australia\BoxingDayTest { diff --git a/tests/Australia/ACT/CanberraDayTest.php b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php similarity index 91% rename from tests/Australia/ACT/CanberraDayTest.php rename to tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php index 433f10681..377f67504 100644 --- a/tests/Australia/ACT/CanberraDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Canberra Day in ACT (Australia).. + * Class for testing Canberra Day in Australian Capital Territory (Australia).. */ -class CanberraDayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class CanberraDayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/ChristmasDayTest.php b/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php similarity index 73% rename from tests/Australia/NSW/ChristmasDayTest.php rename to tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php index 2753c34f8..3704fdf38 100644 --- a/tests/Australia/NSW/ChristmasDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; /** - * Class for testing Christmas Day in NSW (Australia).. + * Class for testing Christmas Day in Australian Capital Territory (Australia).. */ class ChristmasDayTest extends \Yasumi\tests\Australia\ChristmasDayTest { diff --git a/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php new file mode 100644 index 000000000..454634847 --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php @@ -0,0 +1,20 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing Easter Monday in Australian Capital Territory (Australia).. + */ +class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest +{ +} diff --git a/tests/Australia/NSW/EasterSaturdayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php similarity index 90% rename from tests/Australia/NSW/EasterSaturdayTest.php rename to tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php index 7294b0986..d57ebbbe4 100644 --- a/tests/Australia/NSW/EasterSaturdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateInterval; use DateTime; @@ -21,9 +21,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Saturday in NSW (Australia).. + * Class for testing Easter Saturday in Australian Capital Territory (Australia).. */ -class EasterSaturdayTest extends NSWBaseTestCase implements YasumiTestCaseInterface +class EasterSaturdayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/ACT/EasterSundayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php similarity index 90% rename from tests/Australia/ACT/EasterSundayTest.php rename to tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php index a5bc6713c..6c3654565 100644 --- a/tests/Australia/ACT/EasterSundayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Sunday in ACT (Australia).. + * Class for testing Easter Sunday in Australian Capital Territory (Australia).. */ -class EasterSundayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class EasterSundayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php b/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php new file mode 100644 index 000000000..0ecd00e31 --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php @@ -0,0 +1,20 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing Good Friday in Australian Capital Territory (Australia).. + */ +class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest +{ +} diff --git a/tests/Australia/SA/LabourDayTest.php b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php similarity index 90% rename from tests/Australia/SA/LabourDayTest.php rename to tests/Australia/AustralianCapitalTerritory/LabourDayTest.php index 30d5de9a8..b68c1a054 100644 --- a/tests/Australia/SA/LabourDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Labour Day in SA (Australia).. + * Class for testing Labour Day in Australian Capital Territory (Australia).. */ -class LabourDayTest extends SABaseTestCase implements YasumiTestCaseInterface +class LabourDayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php b/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php new file mode 100644 index 000000000..5a5104377 --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php @@ -0,0 +1,20 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing New Years Day in Australian Capital Territory (Australia).. + */ +class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest +{ +} diff --git a/tests/Australia/ACT/QueensBirthdayTest.php b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php similarity index 91% rename from tests/Australia/ACT/QueensBirthdayTest.php rename to tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php index 132e87d33..4620b957d 100644 --- a/tests/Australia/ACT/QueensBirthdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Queen's Birthday in ACT (Australia).. + * Class for testing Queen's Birthday in Australian Capital Territory (Australia).. */ -class QueensBirthdayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class QueensBirthdayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/ACT/ReconciliationDayTest.php b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php similarity index 91% rename from tests/Australia/ACT/ReconciliationDayTest.php rename to tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php index 346e18056..47d93e5de 100644 --- a/tests/Australia/ACT/ReconciliationDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Reconciliation Day in ACT (Australia).. + * Class for testing Reconciliation Day in Australian Capital Territory (Australia).. */ -class ReconciliationDayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class ReconciliationDayTest extends AustralianCapitalTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/AnzacDayTest.php b/tests/Australia/NewSouthWales/AnzacDayTest.php similarity index 77% rename from tests/Australia/NSW/AnzacDayTest.php rename to tests/Australia/NewSouthWales/AnzacDayTest.php index cad528e52..c0e8aa0fc 100644 --- a/tests/Australia/NSW/AnzacDayTest.php +++ b/tests/Australia/NewSouthWales/AnzacDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing ANZAC day in NSW (Australia).. + * Class for testing ANZAC day in New South Wales (Australia).. */ class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest { diff --git a/tests/Australia/NT/AustraliaDayTest.php b/tests/Australia/NewSouthWales/AustraliaDayTest.php similarity index 77% rename from tests/Australia/NT/AustraliaDayTest.php rename to tests/Australia/NewSouthWales/AustraliaDayTest.php index 8bef5589b..cf224ed82 100644 --- a/tests/Australia/NT/AustraliaDayTest.php +++ b/tests/Australia/NewSouthWales/AustraliaDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing Australia day in NT (Australia).. + * Class for testing Australia day in New South Wales (Australia).. */ class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest { diff --git a/tests/Australia/NSW/BankHolidayTest.php b/tests/Australia/NewSouthWales/BankHolidayTest.php similarity index 91% rename from tests/Australia/NSW/BankHolidayTest.php rename to tests/Australia/NewSouthWales/BankHolidayTest.php index 5911c6ab4..64e8fa137 100644 --- a/tests/Australia/NSW/BankHolidayTest.php +++ b/tests/Australia/NewSouthWales/BankHolidayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Bank Holiday in NSW (Australia).. + * Class for testing Bank Holiday in New South Wales (Australia).. */ -class BankHolidayTest extends NSWBaseTestCase implements YasumiTestCaseInterface +class BankHolidayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/BoxingDayTest.php b/tests/Australia/NewSouthWales/BoxingDayTest.php similarity index 77% rename from tests/Australia/NSW/BoxingDayTest.php rename to tests/Australia/NewSouthWales/BoxingDayTest.php index 9c6ea37d3..4fecd554f 100644 --- a/tests/Australia/NSW/BoxingDayTest.php +++ b/tests/Australia/NewSouthWales/BoxingDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing Boxing Day in NSW (Australia).. + * Class for testing Boxing Day in New South Wales (Australia).. */ class BoxingDayTest extends \Yasumi\tests\Australia\BoxingDayTest { diff --git a/tests/Australia/ACT/ChristmasDayTest.php b/tests/Australia/NewSouthWales/ChristmasDayTest.php similarity index 77% rename from tests/Australia/ACT/ChristmasDayTest.php rename to tests/Australia/NewSouthWales/ChristmasDayTest.php index 41871a0a4..511ffb9ba 100644 --- a/tests/Australia/ACT/ChristmasDayTest.php +++ b/tests/Australia/NewSouthWales/ChristmasDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing Christmas Day in ACT (Australia).. + * Class for testing Christmas Day in New South Wales (Australia).. */ class ChristmasDayTest extends \Yasumi\tests\Australia\ChristmasDayTest { diff --git a/tests/Australia/ACT/EasterMondayTest.php b/tests/Australia/NewSouthWales/EasterMondayTest.php similarity index 77% rename from tests/Australia/ACT/EasterMondayTest.php rename to tests/Australia/NewSouthWales/EasterMondayTest.php index 173c90a76..a961bdf7d 100644 --- a/tests/Australia/ACT/EasterMondayTest.php +++ b/tests/Australia/NewSouthWales/EasterMondayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing Easter Monday in ACT (Australia).. + * Class for testing Easter Monday in New South Wales (Australia).. */ class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest { diff --git a/tests/Australia/NT/EasterSaturdayTest.php b/tests/Australia/NewSouthWales/EasterSaturdayTest.php similarity index 91% rename from tests/Australia/NT/EasterSaturdayTest.php rename to tests/Australia/NewSouthWales/EasterSaturdayTest.php index 4195b1dd5..c6b63a312 100644 --- a/tests/Australia/NT/EasterSaturdayTest.php +++ b/tests/Australia/NewSouthWales/EasterSaturdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NewSouthWales; use DateInterval; use DateTime; @@ -21,9 +21,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Saturday in NT (Australia).. + * Class for testing Easter Saturday in New South Wales (Australia).. */ -class EasterSaturdayTest extends NTBaseTestCase implements YasumiTestCaseInterface +class EasterSaturdayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/EasterSundayTest.php b/tests/Australia/NewSouthWales/EasterSundayTest.php similarity index 91% rename from tests/Australia/NSW/EasterSundayTest.php rename to tests/Australia/NewSouthWales/EasterSundayTest.php index 001bf205a..84dcb3e61 100644 --- a/tests/Australia/NSW/EasterSundayTest.php +++ b/tests/Australia/NewSouthWales/EasterSundayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Sunday in NSW (Australia).. + * Class for testing Easter Sunday in New South Wales (Australia).. */ -class EasterSundayTest extends NSWBaseTestCase implements YasumiTestCaseInterface +class EasterSundayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/ACT/GoodFridayTest.php b/tests/Australia/NewSouthWales/GoodFridayTest.php similarity index 77% rename from tests/Australia/ACT/GoodFridayTest.php rename to tests/Australia/NewSouthWales/GoodFridayTest.php index ac0b5380d..bca849af2 100644 --- a/tests/Australia/ACT/GoodFridayTest.php +++ b/tests/Australia/NewSouthWales/GoodFridayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing Good Friday in ACT (Australia).. + * Class for testing Good Friday in New South Wales (Australia).. */ class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest { diff --git a/tests/Australia/ACT/LabourDayTest.php b/tests/Australia/NewSouthWales/LabourDayTest.php similarity index 92% rename from tests/Australia/ACT/LabourDayTest.php rename to tests/Australia/NewSouthWales/LabourDayTest.php index 01fa22668..b29e86d83 100644 --- a/tests/Australia/ACT/LabourDayTest.php +++ b/tests/Australia/NewSouthWales/LabourDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\NewSouthWales; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Labour Day in ACT (Australia).. + * Class for testing Labour Day in New South Wales (Australia).. */ -class LabourDayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class LabourDayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/NSWBaseTestCase.php b/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php similarity index 72% rename from tests/Australia/NSW/NSWBaseTestCase.php rename to tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php index 3e263702e..06d78db6f 100644 --- a/tests/Australia/NSW/NSWBaseTestCase.php +++ b/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php @@ -10,22 +10,22 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; use Yasumi\tests\Australia\AustraliaBaseTestCase; use Yasumi\tests\YasumiBase; /** - * Base class for test cases of the NSW holiday provider. + * Base class for test cases of the New South Wales holiday provider. */ -abstract class NSWBaseTestCase extends AustraliaBaseTestCase +abstract class NewSouthWalesBaseTestCase extends AustraliaBaseTestCase { use YasumiBase; /** * Name of the region (e.g. country / state) to be tested */ - public $region = 'Australia\NSW'; + public $region = 'Australia\NewSouthWales'; /** * Timezone in which this provider has holidays defined diff --git a/tests/Australia/NSW/NSWTest.php b/tests/Australia/NewSouthWales/NewSouthWalesTest.php similarity index 79% rename from tests/Australia/NSW/NSWTest.php rename to tests/Australia/NewSouthWales/NewSouthWalesTest.php index 953ba28f8..6f39824c8 100644 --- a/tests/Australia/NSW/NSWTest.php +++ b/tests/Australia/NewSouthWales/NewSouthWalesTest.php @@ -10,15 +10,15 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NewSouthWales; use ReflectionException; use Yasumi\Holiday; /** - * Class for testing holidays in NSW (Australia). + * Class for testing holidays in New South Wales (Australia). */ -class NSWTest extends NSWBaseTestCase +class NewSouthWalesTest extends NewSouthWalesBaseTestCase { /** * @var int year random year number used for all tests in this Test Case @@ -26,7 +26,7 @@ class NSWTest extends NSWBaseTestCase protected $year; /** - * Tests if all official holidays in NSW (Australia) are defined by the provider class + * Tests if all official holidays in New South Wales (Australia) are defined by the provider class * @throws ReflectionException */ public function testOfficialHolidays(): void @@ -47,7 +47,7 @@ public function testOfficialHolidays(): void } /** - * Tests if all bank holidays in NSW (Australia) are defined by the provider class + * Tests if all bank holidays in New South Wales (Australia) are defined by the provider class * @throws ReflectionException */ public function testBankHolidays(): void diff --git a/tests/Australia/ACT/NewYearsDayTest.php b/tests/Australia/NewSouthWales/NewYearsDayTest.php similarity index 77% rename from tests/Australia/ACT/NewYearsDayTest.php rename to tests/Australia/NewSouthWales/NewYearsDayTest.php index 1b3ba3d2c..6a9bb5fcf 100644 --- a/tests/Australia/ACT/NewYearsDayTest.php +++ b/tests/Australia/NewSouthWales/NewYearsDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\NewSouthWales; /** - * Class for testing New Years Day in ACT (Australia).. + * Class for testing New Years Day in New South Wales (Australia).. */ class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest { diff --git a/tests/Australia/NT/QueensBirthdayTest.php b/tests/Australia/NewSouthWales/QueensBirthdayTest.php similarity index 92% rename from tests/Australia/NT/QueensBirthdayTest.php rename to tests/Australia/NewSouthWales/QueensBirthdayTest.php index 758e71612..905f26eb5 100644 --- a/tests/Australia/NT/QueensBirthdayTest.php +++ b/tests/Australia/NewSouthWales/QueensBirthdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NewSouthWales; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Queen's Birthday in NT (Australia).. + * Class for testing Queen's Birthday in New South Wales (Australia).. */ -class QueensBirthdayTest extends NTBaseTestCase implements YasumiTestCaseInterface +class QueensBirthdayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/AnzacDayTest.php b/tests/Australia/NorthernTerritory/AnzacDayTest.php similarity index 76% rename from tests/Australia/SA/AnzacDayTest.php rename to tests/Australia/NorthernTerritory/AnzacDayTest.php index 08ea7b435..b4c813dd3 100644 --- a/tests/Australia/SA/AnzacDayTest.php +++ b/tests/Australia/NorthernTerritory/AnzacDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing ANZAC day in SA (Australia).. + * Class for testing ANZAC day in Northern Territory (Australia). */ class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest { diff --git a/tests/Australia/SA/AustraliaDayTest.php b/tests/Australia/NorthernTerritory/AustraliaDayTest.php similarity index 76% rename from tests/Australia/SA/AustraliaDayTest.php rename to tests/Australia/NorthernTerritory/AustraliaDayTest.php index 6718bd353..ce79b5f92 100644 --- a/tests/Australia/SA/AustraliaDayTest.php +++ b/tests/Australia/NorthernTerritory/AustraliaDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing Australia day in SA (Australia).. + * Class for testing Australia day in Northern Territory (Australia). */ class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest { diff --git a/tests/Australia/WA/BoxingDayTest.php b/tests/Australia/NorthernTerritory/BoxingDayTest.php similarity index 76% rename from tests/Australia/WA/BoxingDayTest.php rename to tests/Australia/NorthernTerritory/BoxingDayTest.php index b7b447bea..ffa71c268 100644 --- a/tests/Australia/WA/BoxingDayTest.php +++ b/tests/Australia/NorthernTerritory/BoxingDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing Boxing Day in WA (Australia).. + * Class for testing Boxing Day in Northern Territory (Australia). */ class BoxingDayTest extends \Yasumi\tests\Australia\BoxingDayTest { diff --git a/tests/Australia/WA/ChristmasDayTest.php b/tests/Australia/NorthernTerritory/ChristmasDayTest.php similarity index 76% rename from tests/Australia/WA/ChristmasDayTest.php rename to tests/Australia/NorthernTerritory/ChristmasDayTest.php index 2401e375b..a1f8b8dfd 100644 --- a/tests/Australia/WA/ChristmasDayTest.php +++ b/tests/Australia/NorthernTerritory/ChristmasDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing Christmas Day in WA (Australia).. + * Class for testing Christmas Day in Northern Territory (Australia). */ class ChristmasDayTest extends \Yasumi\tests\Australia\ChristmasDayTest { diff --git a/tests/Australia/SA/EasterMondayTest.php b/tests/Australia/NorthernTerritory/EasterMondayTest.php similarity index 76% rename from tests/Australia/SA/EasterMondayTest.php rename to tests/Australia/NorthernTerritory/EasterMondayTest.php index 0392a6575..bba62828b 100644 --- a/tests/Australia/SA/EasterMondayTest.php +++ b/tests/Australia/NorthernTerritory/EasterMondayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing Easter Monday in SA (Australia).. + * Class for testing Easter Monday in Northern Territory (Australia). */ class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest { diff --git a/tests/Australia/SA/EasterSaturdayTest.php b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php similarity index 91% rename from tests/Australia/SA/EasterSaturdayTest.php rename to tests/Australia/NorthernTerritory/EasterSaturdayTest.php index 90ed66508..35796632f 100644 --- a/tests/Australia/SA/EasterSaturdayTest.php +++ b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; use DateInterval; use DateTime; @@ -21,9 +21,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Saturday in SA (Australia).. + * Class for testing Easter Saturday in Northern Territory (Australia). */ -class EasterSaturdayTest extends SABaseTestCase implements YasumiTestCaseInterface +class EasterSaturdayTest extends NorthernTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/GoodFridayTest.php b/tests/Australia/NorthernTerritory/GoodFridayTest.php similarity index 76% rename from tests/Australia/SA/GoodFridayTest.php rename to tests/Australia/NorthernTerritory/GoodFridayTest.php index 49e22b4ec..b4f77e7e1 100644 --- a/tests/Australia/SA/GoodFridayTest.php +++ b/tests/Australia/NorthernTerritory/GoodFridayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing Good Friday in SA (Australia).. + * Class for testing Good Friday in Northern Territory (Australia). */ class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest { diff --git a/tests/Australia/NT/MayDayTest.php b/tests/Australia/NorthernTerritory/MayDayTest.php similarity index 91% rename from tests/Australia/NT/MayDayTest.php rename to tests/Australia/NorthernTerritory/MayDayTest.php index 642aae82f..6c68c361f 100644 --- a/tests/Australia/NT/MayDayTest.php +++ b/tests/Australia/NorthernTerritory/MayDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NorthernTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing May Day in NT (Australia).. + * Class for testing May Day in Northern Territory (Australia). */ -class MayDayTest extends NTBaseTestCase implements YasumiTestCaseInterface +class MayDayTest extends NorthernTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/NewYearsDayTest.php b/tests/Australia/NorthernTerritory/NewYearsDayTest.php similarity index 76% rename from tests/Australia/SA/NewYearsDayTest.php rename to tests/Australia/NorthernTerritory/NewYearsDayTest.php index 437db0118..958f7d9b8 100644 --- a/tests/Australia/SA/NewYearsDayTest.php +++ b/tests/Australia/NorthernTerritory/NewYearsDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\NorthernTerritory; /** - * Class for testing New Years Day in SA (Australia).. + * Class for testing New Years Day in Northern Territory (Australia). */ class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest { diff --git a/tests/Australia/NT/NTBaseTestCase.php b/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php similarity index 71% rename from tests/Australia/NT/NTBaseTestCase.php rename to tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php index 84f9929b9..9b6d75d28 100644 --- a/tests/Australia/NT/NTBaseTestCase.php +++ b/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php @@ -10,22 +10,22 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NorthernTerritory; use Yasumi\tests\Australia\AustraliaBaseTestCase; use Yasumi\tests\YasumiBase; /** - * Base class for test cases of the NT holiday provider. + * Base class for test cases of the Northern Territory holiday provider. */ -abstract class NTBaseTestCase extends AustraliaBaseTestCase +abstract class NorthernTerritoryBaseTestCase extends AustraliaBaseTestCase { use YasumiBase; /** * Name of the region (e.g. country / state) to be tested */ - public $region = 'Australia\NT'; + public $region = 'Australia\NorthernTerritory'; /** * Timezone in which this provider has holidays defined diff --git a/tests/Australia/NT/NTTest.php b/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php similarity index 80% rename from tests/Australia/NT/NTTest.php rename to tests/Australia/NorthernTerritory/NorthernTerritoryTest.php index cc4719204..90ebcfd16 100644 --- a/tests/Australia/NT/NTTest.php +++ b/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php @@ -10,15 +10,15 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NorthernTerritory; use ReflectionException; use Yasumi\Holiday; /** - * Class for testing holidays in NT (Australia). + * Class for testing holidays in Northern Territory (Australia). */ -class NTTest extends NTBaseTestCase +class NorthernTerritoryTest extends NorthernTerritoryBaseTestCase { /** * @var int year random year number used for all tests in this Test Case @@ -26,7 +26,7 @@ class NTTest extends NTBaseTestCase protected $year; /** - * Tests if all official holidays in NT (Australia) are defined by the provider class + * Tests if all official holidays in Northern Territory (Australia) are defined by the provider class * @throws ReflectionException */ public function testOfficialHolidays(): void diff --git a/tests/Australia/NT/PicnicDayTest.php b/tests/Australia/NorthernTerritory/PicnicDayTest.php similarity index 91% rename from tests/Australia/NT/PicnicDayTest.php rename to tests/Australia/NorthernTerritory/PicnicDayTest.php index 556f3fb03..88ba1a5f0 100644 --- a/tests/Australia/NT/PicnicDayTest.php +++ b/tests/Australia/NorthernTerritory/PicnicDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\NorthernTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Picnic Day in NT (Australia).. + * Class for testing Picnic Day in Northern Territory (Australia). */ -class PicnicDayTest extends NTBaseTestCase implements YasumiTestCaseInterface +class PicnicDayTest extends NorthernTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/QueensBirthdayTest.php b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php similarity index 92% rename from tests/Australia/NSW/QueensBirthdayTest.php rename to tests/Australia/NorthernTerritory/QueensBirthdayTest.php index 7806c3f3e..4eccecce9 100644 --- a/tests/Australia/NSW/QueensBirthdayTest.php +++ b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\NorthernTerritory; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Queen's Birthday in NSW (Australia).. + * Class for testing Queen's Birthday in Northern Territory (Australia). */ -class QueensBirthdayTest extends NSWBaseTestCase implements YasumiTestCaseInterface +class QueensBirthdayTest extends NorthernTerritoryBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/AdelaideCupDayTest.php b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php similarity index 93% rename from tests/Australia/SA/AdelaideCupDayTest.php rename to tests/Australia/SouthAustralia/AdelaideCupDayTest.php index ad47fa8e4..baa61cdaf 100644 --- a/tests/Australia/SA/AdelaideCupDayTest.php +++ b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Adelaide Cup Day in SA (Australia).. + * Class for testing Adelaide Cup Day in South Australia (Australia).. */ -class AdelaideCupDayTest extends SABaseTestCase implements YasumiTestCaseInterface +class AdelaideCupDayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/ACT/AnzacDayTest.php b/tests/Australia/SouthAustralia/AnzacDayTest.php similarity index 77% rename from tests/Australia/ACT/AnzacDayTest.php rename to tests/Australia/SouthAustralia/AnzacDayTest.php index 1da59c7df..ff427385e 100644 --- a/tests/Australia/ACT/AnzacDayTest.php +++ b/tests/Australia/SouthAustralia/AnzacDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\SouthAustralia; /** - * Class for testing ANZAC day in ACT (Australia).. + * Class for testing ANZAC day in South Australia (Australia).. */ class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest { diff --git a/tests/Australia/NSW/AustraliaDayTest.php b/tests/Australia/SouthAustralia/AustraliaDayTest.php similarity index 77% rename from tests/Australia/NSW/AustraliaDayTest.php rename to tests/Australia/SouthAustralia/AustraliaDayTest.php index cc1cd24ab..ecc94f95a 100644 --- a/tests/Australia/NSW/AustraliaDayTest.php +++ b/tests/Australia/SouthAustralia/AustraliaDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\SouthAustralia; /** - * Class for testing Australia day in NSW (Australia).. + * Class for testing Australia day in South Australia (Australia).. */ class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest { diff --git a/tests/Australia/SA/ChristmasDayTest.php b/tests/Australia/SouthAustralia/ChristmasDayTest.php similarity index 95% rename from tests/Australia/SA/ChristmasDayTest.php rename to tests/Australia/SouthAustralia/ChristmasDayTest.php index c9bc92671..09702618e 100644 --- a/tests/Australia/SA/ChristmasDayTest.php +++ b/tests/Australia/SouthAustralia/ChristmasDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use DateTime; use DateTimeZone; @@ -22,7 +22,7 @@ /** * Class for testing Christmas Day in South Australia. */ -class ChristmasDayTest extends SABaseTestCase implements YasumiTestCaseInterface +class ChristmasDayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/EasterMondayTest.php b/tests/Australia/SouthAustralia/EasterMondayTest.php similarity index 77% rename from tests/Australia/NSW/EasterMondayTest.php rename to tests/Australia/SouthAustralia/EasterMondayTest.php index 200caae01..81ac35ad7 100644 --- a/tests/Australia/NSW/EasterMondayTest.php +++ b/tests/Australia/SouthAustralia/EasterMondayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\SouthAustralia; /** - * Class for testing Easter Monday in NSW (Australia).. + * Class for testing Easter Monday in South Australia (Australia).. */ class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest { diff --git a/tests/Australia/ACT/EasterSaturdayTest.php b/tests/Australia/SouthAustralia/EasterSaturdayTest.php similarity index 91% rename from tests/Australia/ACT/EasterSaturdayTest.php rename to tests/Australia/SouthAustralia/EasterSaturdayTest.php index 4ddea1cad..ee047a322 100644 --- a/tests/Australia/ACT/EasterSaturdayTest.php +++ b/tests/Australia/SouthAustralia/EasterSaturdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\SouthAustralia; use DateInterval; use DateTime; @@ -21,9 +21,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Easter Saturday in ACT (Australia).. + * Class for testing Easter Saturday in South Australia (Australia).. */ -class EasterSaturdayTest extends ACTBaseTestCase implements YasumiTestCaseInterface +class EasterSaturdayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/GoodFridayTest.php b/tests/Australia/SouthAustralia/GoodFridayTest.php similarity index 77% rename from tests/Australia/NSW/GoodFridayTest.php rename to tests/Australia/SouthAustralia/GoodFridayTest.php index 23e0f81de..1e58b5005 100644 --- a/tests/Australia/NSW/GoodFridayTest.php +++ b/tests/Australia/SouthAustralia/GoodFridayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\SouthAustralia; /** - * Class for testing Good Friday in NSW (Australia).. + * Class for testing Good Friday in South Australia (Australia).. */ class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest { diff --git a/tests/Australia/NSW/LabourDayTest.php b/tests/Australia/SouthAustralia/LabourDayTest.php similarity index 92% rename from tests/Australia/NSW/LabourDayTest.php rename to tests/Australia/SouthAustralia/LabourDayTest.php index eff77a06f..d569e16a6 100644 --- a/tests/Australia/NSW/LabourDayTest.php +++ b/tests/Australia/SouthAustralia/LabourDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\SouthAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Labour Day in NSW (Australia).. + * Class for testing Labour Day in South Australia (Australia).. */ -class LabourDayTest extends NSWBaseTestCase implements YasumiTestCaseInterface +class LabourDayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NSW/NewYearsDayTest.php b/tests/Australia/SouthAustralia/NewYearsDayTest.php similarity index 77% rename from tests/Australia/NSW/NewYearsDayTest.php rename to tests/Australia/SouthAustralia/NewYearsDayTest.php index a5da65406..713d01848 100644 --- a/tests/Australia/NSW/NewYearsDayTest.php +++ b/tests/Australia/SouthAustralia/NewYearsDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NSW; +namespace Yasumi\tests\Australia\SouthAustralia; /** - * Class for testing New Years Day in NSW (Australia).. + * Class for testing New Years Day in South Australia (Australia).. */ class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest { diff --git a/tests/Australia/SA/ProclamationDayTest.php b/tests/Australia/SouthAustralia/ProclamationDayTest.php similarity index 91% rename from tests/Australia/SA/ProclamationDayTest.php rename to tests/Australia/SouthAustralia/ProclamationDayTest.php index 6a1287855..7cd08be1c 100644 --- a/tests/Australia/SA/ProclamationDayTest.php +++ b/tests/Australia/SouthAustralia/ProclamationDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Proclamation Day in SA (Australia).. + * Class for testing Proclamation Day in South Australia (Australia).. */ -class ProclamationDayTest extends SABaseTestCase implements YasumiTestCaseInterface +class ProclamationDayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/QueensBirthdayTest.php b/tests/Australia/SouthAustralia/QueensBirthdayTest.php similarity index 92% rename from tests/Australia/SA/QueensBirthdayTest.php rename to tests/Australia/SouthAustralia/QueensBirthdayTest.php index c202d8ce8..05499bbf2 100644 --- a/tests/Australia/SA/QueensBirthdayTest.php +++ b/tests/Australia/SouthAustralia/QueensBirthdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Queen's Birthday in SA (Australia).. + * Class for testing Queen's Birthday in South Australia (Australia).. */ -class QueensBirthdayTest extends SABaseTestCase implements YasumiTestCaseInterface +class QueensBirthdayTest extends SouthAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/SA/SABaseTestCase.php b/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php similarity index 80% rename from tests/Australia/SA/SABaseTestCase.php rename to tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php index bd54dfed8..486ebd45f 100644 --- a/tests/Australia/SA/SABaseTestCase.php +++ b/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use Yasumi\tests\Australia\AustraliaBaseTestCase; use Yasumi\tests\YasumiBase; @@ -18,14 +18,14 @@ /** * Base class for test cases of the Victoria holiday provider. */ -abstract class SABaseTestCase extends AustraliaBaseTestCase +abstract class SouthAustraliaBaseTestCase extends AustraliaBaseTestCase { use YasumiBase; /** * Name of the region (e.g. country / state) to be tested */ - public $region = 'Australia\SA'; + public $region = 'Australia\SouthAustralia'; /** * Timezone in which this provider has holidays defined diff --git a/tests/Australia/SA/SATest.php b/tests/Australia/SouthAustralia/SouthAustraliaTest.php similarity index 80% rename from tests/Australia/SA/SATest.php rename to tests/Australia/SouthAustralia/SouthAustraliaTest.php index 9f4334de2..26880e85b 100644 --- a/tests/Australia/SA/SATest.php +++ b/tests/Australia/SouthAustralia/SouthAustraliaTest.php @@ -10,15 +10,15 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\SA; +namespace Yasumi\tests\Australia\SouthAustralia; use ReflectionException; use Yasumi\Holiday; /** - * Class for testing holidays in SA (Australia). + * Class for testing holidays in South Australia (Australia). */ -class SATest extends SABaseTestCase +class SouthAustraliaTest extends SouthAustraliaBaseTestCase { /** * @var int year random year number used for all tests in this Test Case @@ -26,7 +26,7 @@ class SATest extends SABaseTestCase protected $year; /** - * Tests if all official holidays in SA (Australia) are defined by the provider class + * Tests if all official holidays in South Australia (Australia) are defined by the provider class * @throws ReflectionException */ public function testOfficialHolidays(): void diff --git a/tests/Australia/WA/AnzacDayTest.php b/tests/Australia/WA/AnzacDayTest.php deleted file mode 100644 index a1882b3ac..000000000 --- a/tests/Australia/WA/AnzacDayTest.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - -namespace Yasumi\tests\Australia\WA; - -/** - * Class for testing ANZAC day in WA (Australia).. - */ -class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest -{ -} diff --git a/tests/Australia/WA/AustraliaDayTest.php b/tests/Australia/WA/AustraliaDayTest.php deleted file mode 100644 index d12119c9d..000000000 --- a/tests/Australia/WA/AustraliaDayTest.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - -namespace Yasumi\tests\Australia\WA; - -/** - * Class for testing Australia day in WA (Australia).. - */ -class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest -{ -} diff --git a/tests/Australia/WA/EasterMondayTest.php b/tests/Australia/WA/EasterMondayTest.php deleted file mode 100644 index 9be4cdf61..000000000 --- a/tests/Australia/WA/EasterMondayTest.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - -namespace Yasumi\tests\Australia\WA; - -/** - * Class for testing Easter Monday in WA (Australia).. - */ -class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest -{ -} diff --git a/tests/Australia/WA/GoodFridayTest.php b/tests/Australia/WA/GoodFridayTest.php deleted file mode 100644 index 09a1fc36b..000000000 --- a/tests/Australia/WA/GoodFridayTest.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - -namespace Yasumi\tests\Australia\WA; - -/** - * Class for testing Good Friday in WA (Australia).. - */ -class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest -{ -} diff --git a/tests/Australia/WA/NewYearsDayTest.php b/tests/Australia/WA/NewYearsDayTest.php deleted file mode 100644 index 41c2e85a9..000000000 --- a/tests/Australia/WA/NewYearsDayTest.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - -namespace Yasumi\tests\Australia\WA; - -/** - * Class for testing New Years Day in WA (Australia).. - */ -class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest -{ -} diff --git a/tests/Australia/NT/AnzacDayTest.php b/tests/Australia/WesternAustralia/AnzacDayTest.php similarity index 76% rename from tests/Australia/NT/AnzacDayTest.php rename to tests/Australia/WesternAustralia/AnzacDayTest.php index a2f7950e9..575fce171 100644 --- a/tests/Australia/NT/AnzacDayTest.php +++ b/tests/Australia/WesternAustralia/AnzacDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing ANZAC day in NT (Australia).. + * Class for testing ANZAC day in Western Australia (Australia).. */ class AnzacDayTest extends \Yasumi\tests\Australia\AnzacDayTest { diff --git a/tests/Australia/ACT/AustraliaDayTest.php b/tests/Australia/WesternAustralia/AustraliaDayTest.php similarity index 76% rename from tests/Australia/ACT/AustraliaDayTest.php rename to tests/Australia/WesternAustralia/AustraliaDayTest.php index cae6f5ba9..73c179278 100644 --- a/tests/Australia/ACT/AustraliaDayTest.php +++ b/tests/Australia/WesternAustralia/AustraliaDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\ACT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing Australia day in ACT (Australia).. + * Class for testing Australia day in Western Australia (Australia).. */ class AustraliaDayTest extends \Yasumi\tests\Australia\AustraliaDayTest { diff --git a/tests/Australia/NT/BoxingDayTest.php b/tests/Australia/WesternAustralia/BoxingDayTest.php similarity index 76% rename from tests/Australia/NT/BoxingDayTest.php rename to tests/Australia/WesternAustralia/BoxingDayTest.php index de2e2dd2b..d1d663ce1 100644 --- a/tests/Australia/NT/BoxingDayTest.php +++ b/tests/Australia/WesternAustralia/BoxingDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing Boxing Day in NT (Australia).. + * Class for testing Boxing Day in Western Australia (Australia).. */ class BoxingDayTest extends \Yasumi\tests\Australia\BoxingDayTest { diff --git a/tests/Australia/NT/ChristmasDayTest.php b/tests/Australia/WesternAustralia/ChristmasDayTest.php similarity index 76% rename from tests/Australia/NT/ChristmasDayTest.php rename to tests/Australia/WesternAustralia/ChristmasDayTest.php index d18a577bb..a30cbb307 100644 --- a/tests/Australia/NT/ChristmasDayTest.php +++ b/tests/Australia/WesternAustralia/ChristmasDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing Christmas Day in NT (Australia).. + * Class for testing Christmas Day in Western Australia (Australia).. */ class ChristmasDayTest extends \Yasumi\tests\Australia\ChristmasDayTest { diff --git a/tests/Australia/NT/EasterMondayTest.php b/tests/Australia/WesternAustralia/EasterMondayTest.php similarity index 76% rename from tests/Australia/NT/EasterMondayTest.php rename to tests/Australia/WesternAustralia/EasterMondayTest.php index 4ce1b6868..0cd3ac2a4 100644 --- a/tests/Australia/NT/EasterMondayTest.php +++ b/tests/Australia/WesternAustralia/EasterMondayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing Easter Monday in NT (Australia).. + * Class for testing Easter Monday in Western Australia (Australia).. */ class EasterMondayTest extends \Yasumi\tests\Australia\EasterMondayTest { diff --git a/tests/Australia/NT/GoodFridayTest.php b/tests/Australia/WesternAustralia/GoodFridayTest.php similarity index 76% rename from tests/Australia/NT/GoodFridayTest.php rename to tests/Australia/WesternAustralia/GoodFridayTest.php index a5bbd3066..58be8e558 100644 --- a/tests/Australia/NT/GoodFridayTest.php +++ b/tests/Australia/WesternAustralia/GoodFridayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing Good Friday in NT (Australia).. + * Class for testing Good Friday in Western Australia (Australia).. */ class GoodFridayTest extends \Yasumi\tests\Australia\GoodFridayTest { diff --git a/tests/Australia/WA/LabourDayTest.php b/tests/Australia/WesternAustralia/LabourDayTest.php similarity index 91% rename from tests/Australia/WA/LabourDayTest.php rename to tests/Australia/WesternAustralia/LabourDayTest.php index 332ead2f1..fc9c2b0ff 100644 --- a/tests/Australia/WA/LabourDayTest.php +++ b/tests/Australia/WesternAustralia/LabourDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\WesternAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Labour Day in WA (Australia).. + * Class for testing Labour Day in Western Australia (Australia).. */ -class LabourDayTest extends WABaseTestCase implements YasumiTestCaseInterface +class LabourDayTest extends WesternAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/NT/NewYearsDayTest.php b/tests/Australia/WesternAustralia/NewYearsDayTest.php similarity index 76% rename from tests/Australia/NT/NewYearsDayTest.php rename to tests/Australia/WesternAustralia/NewYearsDayTest.php index 4ce8fbf7e..9cb90792a 100644 --- a/tests/Australia/NT/NewYearsDayTest.php +++ b/tests/Australia/WesternAustralia/NewYearsDayTest.php @@ -10,10 +10,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\NT; +namespace Yasumi\tests\Australia\WesternAustralia; /** - * Class for testing New Years Day in NT (Australia).. + * Class for testing New Years Day in Western Australia (Australia).. */ class NewYearsDayTest extends \Yasumi\tests\Australia\NewYearsDayTest { diff --git a/tests/Australia/WA/QueensBirthdayTest.php b/tests/Australia/WesternAustralia/QueensBirthdayTest.php similarity index 92% rename from tests/Australia/WA/QueensBirthdayTest.php rename to tests/Australia/WesternAustralia/QueensBirthdayTest.php index 06f362d2c..23e396bb5 100644 --- a/tests/Australia/WA/QueensBirthdayTest.php +++ b/tests/Australia/WesternAustralia/QueensBirthdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\WesternAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Queen's Birthday in WA (Australia).. + * Class for testing Queen's Birthday in Western Australia (Australia).. */ -class QueensBirthdayTest extends WABaseTestCase implements YasumiTestCaseInterface +class QueensBirthdayTest extends WesternAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/WA/WABaseTestCase.php b/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php similarity index 79% rename from tests/Australia/WA/WABaseTestCase.php rename to tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php index 0579c94c0..f5e79212b 100644 --- a/tests/Australia/WA/WABaseTestCase.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\WesternAustralia; use Yasumi\tests\Australia\AustraliaBaseTestCase; use Yasumi\tests\YasumiBase; @@ -18,14 +18,14 @@ /** * Base class for test cases of the Queensland holiday provider. */ -abstract class WABaseTestCase extends AustraliaBaseTestCase +abstract class WesternAustraliaBaseTestCase extends AustraliaBaseTestCase { use YasumiBase; /** * Name of the region (e.g. country / state) to be tested */ - public $region = 'Australia\WA'; + public $region = 'Australia\WesternAustralia'; /** * Timezone in which this provider has holidays defined diff --git a/tests/Australia/WA/WesternAustraliaDayTest.php b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php similarity index 91% rename from tests/Australia/WA/WesternAustraliaDayTest.php rename to tests/Australia/WesternAustralia/WesternAustraliaDayTest.php index 9618ea515..27f05e9cf 100644 --- a/tests/Australia/WA/WesternAustraliaDayTest.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\WesternAustralia; use DateTime; use DateTimeZone; @@ -20,9 +20,9 @@ use Yasumi\tests\YasumiTestCaseInterface; /** - * Class for testing Western Australia Day in WA (Australia).. + * Class for testing Western Australia Day in Western Australia (Australia).. */ -class WesternAustraliaDayTest extends WABaseTestCase implements YasumiTestCaseInterface +class WesternAustraliaDayTest extends WesternAustraliaBaseTestCase implements YasumiTestCaseInterface { /** * The name of the holiday diff --git a/tests/Australia/WA/WATest.php b/tests/Australia/WesternAustralia/WesternAustraliaTest.php similarity index 80% rename from tests/Australia/WA/WATest.php rename to tests/Australia/WesternAustralia/WesternAustraliaTest.php index 1ac79f522..bd9d43fa1 100644 --- a/tests/Australia/WA/WATest.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaTest.php @@ -10,15 +10,15 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests\Australia\WA; +namespace Yasumi\tests\Australia\WesternAustralia; use ReflectionException; use Yasumi\Holiday; /** - * Class for testing holidays in WA (Australia). + * Class for testing holidays in Western Australia (Australia). */ -class WATest extends WABaseTestCase +class WesternAustraliaTest extends WesternAustraliaBaseTestCase { /** @@ -27,7 +27,7 @@ class WATest extends WABaseTestCase protected $year; /** - * Tests if all official holidays in WA (Australia) are defined by the provider class + * Tests if all official holidays in Western Australia (Australia) are defined by the provider class * @throws ReflectionException */ public function testOfficialHolidays(): void From c4fe55d455b42949a39aceb576160129814e0886 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 1 May 2020 10:03:31 +0900 Subject: [PATCH 065/115] Removed dead code. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Australia/SouthAustralia.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Yasumi/Provider/Australia/SouthAustralia.php b/src/Yasumi/Provider/Australia/SouthAustralia.php index 51e2025ca..04df783ab 100644 --- a/src/Yasumi/Provider/Australia/SouthAustralia.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -184,7 +184,6 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); - $proclamationDay = $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -194,7 +193,6 @@ private function calculateProclamationDay(): void )); break; case 5: // friday - $proclamationDay = $christmasDay->add(new DateInterval('P3D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -204,7 +202,6 @@ private function calculateProclamationDay(): void )); break; case 6: // saturday - $christmasDay->add(new DateInterval('P2D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], @@ -212,7 +209,6 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); - $proclamationDay = $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -222,7 +218,6 @@ private function calculateProclamationDay(): void )); break; default: // monday-thursday - $proclamationDay = $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], From 517f45dcf08ef580c90fd4d4425a2beef7bfcde1 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 1 May 2020 10:09:01 +0900 Subject: [PATCH 066/115] Add missing strict type declaration. Changed to Yoda style condition Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Croatia.php | 4 ++-- src/Yasumi/Provider/Luxembourg.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index 36e695329..033ff9e4d 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -88,7 +88,7 @@ private function calculateStatehoodDay(): void $statehoodDayDate = new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } - if ($statehoodDayDate != null) { + if (null != $statehoodDayDate) { $this->addHoliday(new Holiday('statehoodDay', [ 'en' => 'Statehood Day', 'hr' => 'Dan državnosti', @@ -111,7 +111,7 @@ private function calculateHomelandThanksgivingDay(): void $names['hr'] = 'Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja'; } - if ($names !== null) { + if (null !== $names) { $this->addHoliday(new Holiday( 'homelandThanksgiving', $names, diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php index c1342f547..5cf42747a 100755 --- a/src/Yasumi/Provider/Luxembourg.php +++ b/src/Yasumi/Provider/Luxembourg.php @@ -1,4 +1,5 @@ Date: Fri, 1 May 2020 10:12:00 +0900 Subject: [PATCH 067/115] Updated CHANGELOG. Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee3516d2b..d67397d7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) ### Changed +- Renamed the Australian states to be full names in stead of abbreviations to be in line with other Holiday Providers [\#214](https://github.com/azuyalabs/yasumi/pull/214) - Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) - Independence Day is no longer an official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) - Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) From 46ff738a1d994fe9fad396266f6cb39a554e6b38 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 1 May 2020 10:27:23 +0900 Subject: [PATCH 068/115] Reverted accidentally removed dead code. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Australia/SouthAustralia.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Yasumi/Provider/Australia/SouthAustralia.php b/src/Yasumi/Provider/Australia/SouthAustralia.php index 04df783ab..a4bb1e046 100644 --- a/src/Yasumi/Provider/Australia/SouthAustralia.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -184,6 +184,7 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); + $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -193,6 +194,7 @@ private function calculateProclamationDay(): void )); break; case 5: // friday + $christmasDay->add(new DateInterval('P3D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -202,6 +204,7 @@ private function calculateProclamationDay(): void )); break; case 6: // saturday + $christmasDay->add(new DateInterval('P2D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], @@ -209,6 +212,7 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); + $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], @@ -218,6 +222,7 @@ private function calculateProclamationDay(): void )); break; default: // monday-thursday + $christmasDay->add(new DateInterval('P1D')); $this->addHoliday(new Holiday( 'proclamationDay', ['en' => 'Proclamation Day'], From 91eec58000b2a226d11f63b94ba43cef4c872dbb Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 1 May 2020 14:38:59 +0200 Subject: [PATCH 069/115] Locale override for getName() (with multiple fallbacks) (#195) --- .../Exception/MissingTranslationException.php | 32 +++++ src/Yasumi/Holiday.php | 74 ++++++++--- src/Yasumi/SubstituteHoliday.php | 23 +++- tests/Base/HolidayTest.php | 123 +++++++++++------- 4 files changed, 181 insertions(+), 71 deletions(-) create mode 100644 src/Yasumi/Exception/MissingTranslationException.php diff --git a/src/Yasumi/Exception/MissingTranslationException.php b/src/Yasumi/Exception/MissingTranslationException.php new file mode 100644 index 000000000..eac6f75ab --- /dev/null +++ b/src/Yasumi/Exception/MissingTranslationException.php @@ -0,0 +1,32 @@ + + */ + +namespace Yasumi\Exception; + +use Exception as BaseException; + +/** + * Class MissingTranslationException. + */ +class MissingTranslationException extends BaseException implements Exception +{ + /** + * Initializes the Exception instance + * + * @param string $shortName The short name (internal name) of the holiday + * @param array $locales The locales that was searched + */ + public function __construct(string $shortName, array $locales) + { + parent::__construct(\sprintf("Translation for '%s' not found for any locale: '%s'", $shortName, \implode("', '", $locales))); + } +} diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 55841b65a..1696e1284 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -17,6 +17,7 @@ use InvalidArgumentException; use JsonSerializable; use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; /** @@ -54,6 +55,11 @@ class Holiday extends DateTime implements JsonSerializable */ public const DEFAULT_LOCALE = 'en_US'; + /** + * Pseudo-locale representing the short name (internal name) of the holiday. + */ + public const LOCALE_SHORT_NAME = 'shortName'; + /** * @var array list of all defined locales */ @@ -153,41 +159,75 @@ public function jsonSerialize(): self } /** - * Returns the name of this holiday. + * Returns the localized name of this holiday + * + * The provided locales are searched for a translation. The first locale containing a translation will be used. * - * The name of this holiday is returned translated in the given locale. If for the given locale no translation is - * defined, the name in the default locale ('en_US') is returned. In case there is no translation at all, the short - * internal name is returned. + * If no locale is provided, proceed as if an array containing the display locale, Holiday::DEFAULT_LOCALE ('en_US'), and + * Holiday::LOCALE_SHORT_NAME (the short name (internal name) of this holiday) was provided. + * + * @param array $locales The locales to search for translations + * + * @throws MissingTranslationException + * + * @see Holiday::DEFAULT_LOCALE + * @see Holiday::LOCALE_SHORT_NAME */ - public function getName(): string + public function getName(array $locales = null): string { - foreach ($this->getLocales() as $locale) { + $locales = $this->getLocales($locales); + foreach ($locales as $locale) { + if ($locale === self::LOCALE_SHORT_NAME) { + return $this->shortName; + } if (isset($this->translations[$locale])) { return $this->translations[$locale]; } } - return $this->shortName; + throw new MissingTranslationException($this->shortName, $locales); } /** - * Returns the display locale and its fallback locales. + * Expands the provided locale into an array of locales to check for translations. + * + * For each provided locale, return all locales including their parent locales. E.g. + * ['ca_ES_VALENCIA', 'es_ES'] is expanded into ['ca_ES_VALENCIA', 'ca_ES', 'ca', 'es_ES', 'es']. + * + * If a string is provided, return as if this string, Holiday::DEFAULT_LOCALE, and Holiday::LOCALE_SHORT_NAM + * was provided. E.g. 'de_DE' is expanded into ['de_DE', 'de', 'en_US', 'en', Holiday::LOCALE_SHORT_NAME]. + * + * If null is provided, return as if the display locale was provided as a string. + * + * @param array $locales Array of locales, or null if the display locale should be used * * @return array + * + * @see Holiday::DEFAULT_LOCALE + * @see Holiday::LOCALE_SHORT_NAME */ - protected function getLocales(): array + protected function getLocales(?array $locales): array { - $locales = [$this->displayLocale]; - $parts = \explode('_', $this->displayLocale); - while (\array_pop($parts) && $parts) { - $locales[] = \implode('_', $parts); + if ($locales) { + $expanded = []; + $locales = $locales; + } else { + $locales = [$this->displayLocale]; + // DEFAULT_LOCALE is 'en_US', and its parent is 'en'. + $expanded = [self::LOCALE_SHORT_NAME, 'en', 'en_US']; } - // DEFAULT_LOCALE is en_US - $locales[] = 'en_US'; - $locales[] = 'en'; + // Expand e.g. ['de_DE', 'en_GB'] into ['de_DE', 'de', 'en_GB', 'en']. + foreach (\array_reverse($locales) as $locale) { + $parent = \strtok($locale, '_'); + while ($child = \strtok('_')) { + $expanded[] = $parent; + $parent .= '_' . $child; + } + $expanded[] = $locale; + } - return $locales; + return \array_reverse($expanded); } /** diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index 5e1a4c942..9321c8493 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -13,6 +13,7 @@ namespace Yasumi; use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; /** @@ -76,19 +77,27 @@ public function __construct( } /** - * Returns the name of this holiday. + * Returns the localized name of this holiday * - * The name of this holiday is returned translated in the given locale. If for the given locale no translation is - * defined, the name in the default locale ('en_US') is returned. In case there is no translation at all, the short - * internal name is returned. + * The provided locales are searched for a translation. The first locale containing a translation will be used. + * + * If no locale is provided, proceed as if an array containing the display locale, Holiday::DEFAULT_LOCALE ('en_US'), and + * Holiday::LOCALE_SHORT_NAME (the short name (internal name) of this holiday) was provided. + * + * @param array $locales The locales to search for translations + * + * @throws MissingTranslationException + * + * @see Holiday::DEFAULT_LOCALE + * @see Holiday::LOCALE_SHORT_NAME */ - public function getName(): string + public function getName($locales = null): string { $name = parent::getName(); if ($name === $this->shortName) { - foreach ($this->getLocales() as $locale) { - $pattern = $this->substituteHolidayTranslations[$locale] ?? null; + foreach ($this->getLocales($locales) as $locales) { + $pattern = $this->substituteHolidayTranslations[$locales] ?? null; if ($pattern) { return \str_replace('{0}', $this->substitutedHoliday->getName(), $pattern); } diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index 50ef9e192..c4839c9a6 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -17,6 +17,7 @@ use Exception; use InvalidArgumentException; use PHPUnit\Framework\TestCase; +use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\tests\YasumiBase; @@ -89,73 +90,101 @@ public function testHolidayWithDateTimeInterface(): void } /** - * Tests the getName function of the Holiday object with no translations for the name given. - * @throws Exception + * Tests the getLocales function of the Holiday object. */ - public function testHolidayGetNameWithNoTranslations(): void + public function testHolidayGetLocales(): void { - $name = 'testHoliday'; - $holiday = new Holiday($name, [], new DateTime(), 'en_US'); + $holiday = new Holiday('testHoliday', [], new DateTime(), 'ca_ES_VALENCIA'); + $method = new \ReflectionMethod(Holiday::class, 'getLocales'); + $method->setAccessible(true); - $this->assertIsString($holiday->getName()); - $this->assertEquals($name, $holiday->getName()); + $this->assertEquals(['ca_ES_VALENCIA', 'ca_ES', 'ca', 'en_US', 'en', Holiday::LOCALE_SHORT_NAME], $method->invoke($holiday, null)); + $this->assertEquals(['de_DE', 'de', 'es_ES', 'es'], $method->invoke($holiday, ['de_DE', 'es_ES'])); + $this->assertEquals(['de_DE', 'de', Holiday::LOCALE_SHORT_NAME], $method->invoke($holiday, ['de_DE', Holiday::LOCALE_SHORT_NAME])); } /** - * Tests the getName function of the Holiday object with only a parent translation for the name given. - * @throws Exception + * Tests the getName function of the Holiday object without any arguments provided. */ - public function testHolidayGetNameWithParentLocaleTranslation(): void + public function testHolidayGetNameWithoutArgument(): void { - $name = 'testHoliday'; - $translation = 'My Holiday'; - $holiday = new Holiday($name, ['de' => $translation], new DateTime(), 'de_DE'); + // 'en_US' fallback + $translations = [ + 'de' => 'Holiday DE', + 'de_AT' => 'Holiday DE-AT', + 'en' => 'Holiday EN', + 'en_US' => 'Holiday EN-US', + ]; - $this->assertIsString($holiday->getName()); - $this->assertEquals($translation, $holiday->getName()); - } + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_AT'); + $this->assertEquals('Holiday DE-AT', $holiday->getName()); - /** - * Tests the getName function of the Holiday object with only a default translation for the name given. - * @throws Exception - */ - public function testHolidayGetNameWithOnlyDefaultTranslation(): void - { - $name = 'testHoliday'; - $holiday = new Holiday($name, ['en' => 'Holiday EN', 'en_US' => 'Holiday EN-US'], new DateTime(), 'nl_NL'); + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de'); + $this->assertEquals('Holiday DE', $holiday->getName()); - $this->assertIsString($holiday->getName()); + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $this->assertEquals('Holiday DE', $holiday->getName()); + + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); $this->assertEquals('Holiday EN-US', $holiday->getName()); - } - /** - * Tests the getName function of the Holiday object with only a default translation for the name given. - * @throws Exception - */ - public function testHolidayGetNameWithOnlyDefaultTranslationAndFallback(): void - { - $name = 'testHoliday'; - $translation = 'My Holiday'; - $holiday = new Holiday($name, ['en' => $translation], new DateTime(), 'nl_NL'); + // 'en' fallback + $translations = [ + 'de' => 'Holiday DE', + 'en' => 'Holiday EN', + ]; - $this->assertIsString($holiday->getName()); - $this->assertEquals($translation, $holiday->getName()); + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $this->assertEquals('Holiday DE', $holiday->getName()); + + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $this->assertEquals('Holiday EN', $holiday->getName()); + + + // No 'en' or 'en_US' fallback + $translations = [ + 'de' => 'Holiday DE', + ]; + + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $this->assertEquals('Holiday DE', $holiday->getName()); + + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $this->assertEquals('testHoliday', $holiday->getName()); } /** - * Tests the getName function of the Holiday object with only a default translation for the name given. - * - * @throws Exception + * Tests the getName function of the Holiday object with an explicit list of locales. */ - public function testHolidayGetNameWithOneNonDefaultTranslation(): void + public function testHolidayGetNameWithArgument(): void { - $name = 'testHoliday'; - $translation = 'My Holiday'; - $holiday = new Holiday($name, ['en_US' => $translation], new DateTime(), 'nl_NL'); + $translations = [ + 'de' => 'Holiday DE', + 'de_AT' => 'Holiday DE-AT', + 'nl' => 'Holiday NL', + 'it_IT' => 'Holiday IT-IT', + 'en_US' => 'Holiday EN-US', + ]; + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + + $this->assertEquals('Holiday DE', $holiday->getName(['de'])); + $this->assertEquals('Holiday DE', $holiday->getName(['ja', 'de', 'nl', 'it_IT'])); + $this->assertEquals('Holiday DE', $holiday->getName(['de_DE'])); + $this->assertEquals('Holiday DE', $holiday->getName(['de_DE_berlin'])); + $this->assertEquals('Holiday DE', $holiday->getName(['de_DE_berlin', 'nl', 'it_IT'])); + $this->assertEquals('Holiday DE-AT', $holiday->getName(['de_AT'])); + $this->assertEquals('Holiday DE-AT', $holiday->getName(['de_AT_vienna'])); + $this->assertEquals('Holiday NL', $holiday->getName(['nl'])); + $this->assertEquals('Holiday NL', $holiday->getName(['nl_NL'])); + $this->assertEquals('Holiday IT-IT', $holiday->getName(['it_IT'])); + $this->assertEquals('Holiday IT-IT', $holiday->getName(['it_IT', Holiday::LOCALE_SHORT_NAME])); + $this->assertEquals('testHoliday', $holiday->getName([Holiday::LOCALE_SHORT_NAME])); + + $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $this->assertEquals('Holiday EN-US', $holiday->getName()); - $this->assertNotNull($holiday->getName()); - $this->assertIsString($holiday->getName()); - $this->assertEquals($translation, $holiday->getName()); + $this->expectException(MissingTranslationException::class); + $holiday->getName(['it']); } /** From 91a2859c103ebe469104c4099081734f4c00fb6c Mon Sep 17 00:00:00 2001 From: John Luxford Date: Mon, 4 May 2020 22:57:24 -0500 Subject: [PATCH 070/115] Added Canada provider (#215) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Canada.php | 253 ++++++++++++++++++ src/Yasumi/Provider/Canada/Alberta.php | 79 ++++++ .../Provider/Canada/BritishColumbia.php | 53 ++++ src/Yasumi/Provider/Canada/Manitoba.php | 103 +++++++ src/Yasumi/Provider/Canada/NewBrunswick.php | 53 ++++ .../Canada/NewfoundlandAndLabrador.php | 150 +++++++++++ .../Provider/Canada/NorthwestTerritories.php | 53 ++++ src/Yasumi/Provider/Canada/NovaScotia.php | 103 +++++++ src/Yasumi/Provider/Canada/Nunavut.php | 78 ++++++ src/Yasumi/Provider/Canada/Ontario.php | 53 ++++ .../Provider/Canada/PrinceEdwardIsland.php | 103 +++++++ src/Yasumi/Provider/Canada/Quebec.php | 117 ++++++++ src/Yasumi/Provider/Canada/Saskatchewan.php | 79 ++++++ src/Yasumi/Provider/Canada/Yukon.php | 104 +++++++ src/Yasumi/data/translations/canadaDay.php | 18 ++ src/Yasumi/data/translations/civicHoliday.php | 18 ++ src/Yasumi/data/translations/discoveryDay.php | 18 ++ src/Yasumi/data/translations/familyDay.php | 18 ++ .../data/translations/goldCupParadeDay.php | 18 ++ src/Yasumi/data/translations/heritageDay.php | 18 ++ src/Yasumi/data/translations/islanderDay.php | 18 ++ src/Yasumi/data/translations/labourDay.php | 1 + src/Yasumi/data/translations/louisRielDay.php | 18 ++ src/Yasumi/data/translations/natalHoliday.php | 18 ++ .../nationalIndigenousPeoplesDay.php | 18 ++ .../data/translations/nationalPatriotsDay.php | 18 ++ .../translations/novaScotiaHeritageDay.php | 18 ++ .../data/translations/orangemensDay.php | 18 ++ .../data/translations/remembranceDay.php | 18 ++ .../translations/saintJeanBaptisteDay.php | 18 ++ .../data/translations/saskatchewanDay.php | 18 ++ src/Yasumi/data/translations/terryFoxDay.php | 18 ++ .../data/translations/thanksgivingDay.php | 18 ++ src/Yasumi/data/translations/victoriaDay.php | 18 ++ .../data/translations/yukonHeritageDay.php | 18 ++ tests/Canada/Alberta/AlbertaBaseTestCase.php | 44 +++ tests/Canada/Alberta/AlbertaTest.php | 86 ++++++ .../BritishColumbiaBaseTestCase.php | 44 +++ .../BritishColumbia/BritishColumbiaTest.php | 86 ++++++ tests/Canada/CanadaBaseTestCase.php | 39 +++ tests/Canada/CanadaDayTest.php | 93 +++++++ tests/Canada/CanadaTest.php | 90 +++++++ tests/Canada/ChristmasDayTest.php | 70 +++++ tests/Canada/LabourDayTest.php | 93 +++++++ .../Canada/Manitoba/ManitobaBaseTestCase.php | 44 +++ tests/Canada/Manitoba/ManitobaTest.php | 86 ++++++ .../NewBrunswick/NewBrunswickBaseTestCase.php | 44 +++ .../Canada/NewBrunswick/NewBrunswickTest.php | 86 ++++++ tests/Canada/NewYearsDayTest.php | 70 +++++ .../NewfoundlandAndLabradorBaseTestCase.php | 44 +++ .../NewfoundlandAndLabradorTest.php | 87 ++++++ .../NorthwestTerritoriesBaseTestCase.php | 44 +++ .../NorthwestTerritoriesTest.php | 86 ++++++ .../NovaScotia/NovaScotiaBaseTestCase.php | 44 +++ tests/Canada/NovaScotia/NovaScotiaTest.php | 86 ++++++ tests/Canada/Nunavut/NunavutBaseTestCase.php | 44 +++ tests/Canada/Nunavut/NunavutTest.php | 85 ++++++ tests/Canada/Ontario/OntarioBaseTestCase.php | 44 +++ tests/Canada/Ontario/OntarioTest.php | 86 ++++++ .../PrinceEdwardIslandBaseTestCase.php | 44 +++ .../PrinceEdwardIslandTest.php | 86 ++++++ tests/Canada/Quebec/QuebecBaseTestCase.php | 44 +++ tests/Canada/Quebec/QuebecTest.php | 85 ++++++ tests/Canada/RemembranceDayTest.php | 93 +++++++ .../Saskatchewan/SaskatchewanBaseTestCase.php | 44 +++ .../Canada/Saskatchewan/SaskatchewanTest.php | 86 ++++++ tests/Canada/ThanksgivingDayTest.php | 95 +++++++ tests/Canada/Yukon/YukonBaseTestCase.php | 44 +++ tests/Canada/Yukon/YukonTest.php | 87 ++++++ 70 files changed, 4076 insertions(+) create mode 100644 src/Yasumi/Provider/Canada.php create mode 100644 src/Yasumi/Provider/Canada/Alberta.php create mode 100644 src/Yasumi/Provider/Canada/BritishColumbia.php create mode 100644 src/Yasumi/Provider/Canada/Manitoba.php create mode 100644 src/Yasumi/Provider/Canada/NewBrunswick.php create mode 100644 src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php create mode 100644 src/Yasumi/Provider/Canada/NorthwestTerritories.php create mode 100644 src/Yasumi/Provider/Canada/NovaScotia.php create mode 100644 src/Yasumi/Provider/Canada/Nunavut.php create mode 100644 src/Yasumi/Provider/Canada/Ontario.php create mode 100644 src/Yasumi/Provider/Canada/PrinceEdwardIsland.php create mode 100644 src/Yasumi/Provider/Canada/Quebec.php create mode 100644 src/Yasumi/Provider/Canada/Saskatchewan.php create mode 100644 src/Yasumi/Provider/Canada/Yukon.php create mode 100644 src/Yasumi/data/translations/canadaDay.php create mode 100644 src/Yasumi/data/translations/civicHoliday.php create mode 100644 src/Yasumi/data/translations/discoveryDay.php create mode 100644 src/Yasumi/data/translations/familyDay.php create mode 100644 src/Yasumi/data/translations/goldCupParadeDay.php create mode 100644 src/Yasumi/data/translations/heritageDay.php create mode 100644 src/Yasumi/data/translations/islanderDay.php create mode 100644 src/Yasumi/data/translations/louisRielDay.php create mode 100644 src/Yasumi/data/translations/natalHoliday.php create mode 100644 src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php create mode 100644 src/Yasumi/data/translations/nationalPatriotsDay.php create mode 100644 src/Yasumi/data/translations/novaScotiaHeritageDay.php create mode 100644 src/Yasumi/data/translations/orangemensDay.php create mode 100644 src/Yasumi/data/translations/remembranceDay.php create mode 100644 src/Yasumi/data/translations/saintJeanBaptisteDay.php create mode 100644 src/Yasumi/data/translations/saskatchewanDay.php create mode 100644 src/Yasumi/data/translations/terryFoxDay.php create mode 100644 src/Yasumi/data/translations/thanksgivingDay.php create mode 100644 src/Yasumi/data/translations/victoriaDay.php create mode 100644 src/Yasumi/data/translations/yukonHeritageDay.php create mode 100644 tests/Canada/Alberta/AlbertaBaseTestCase.php create mode 100644 tests/Canada/Alberta/AlbertaTest.php create mode 100644 tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php create mode 100644 tests/Canada/BritishColumbia/BritishColumbiaTest.php create mode 100644 tests/Canada/CanadaBaseTestCase.php create mode 100644 tests/Canada/CanadaDayTest.php create mode 100644 tests/Canada/CanadaTest.php create mode 100644 tests/Canada/ChristmasDayTest.php create mode 100644 tests/Canada/LabourDayTest.php create mode 100644 tests/Canada/Manitoba/ManitobaBaseTestCase.php create mode 100644 tests/Canada/Manitoba/ManitobaTest.php create mode 100644 tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php create mode 100644 tests/Canada/NewBrunswick/NewBrunswickTest.php create mode 100644 tests/Canada/NewYearsDayTest.php create mode 100644 tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php create mode 100644 tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php create mode 100644 tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php create mode 100644 tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php create mode 100644 tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php create mode 100644 tests/Canada/NovaScotia/NovaScotiaTest.php create mode 100644 tests/Canada/Nunavut/NunavutBaseTestCase.php create mode 100644 tests/Canada/Nunavut/NunavutTest.php create mode 100644 tests/Canada/Ontario/OntarioBaseTestCase.php create mode 100644 tests/Canada/Ontario/OntarioTest.php create mode 100644 tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php create mode 100644 tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php create mode 100644 tests/Canada/Quebec/QuebecBaseTestCase.php create mode 100644 tests/Canada/Quebec/QuebecTest.php create mode 100644 tests/Canada/RemembranceDayTest.php create mode 100644 tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php create mode 100644 tests/Canada/Saskatchewan/SaskatchewanTest.php create mode 100644 tests/Canada/ThanksgivingDayTest.php create mode 100644 tests/Canada/Yukon/YukonBaseTestCase.php create mode 100644 tests/Canada/Yukon/YukonTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d67397d7e..315c2909d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added +- Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) diff --git a/src/Yasumi/Provider/Canada.php b/src/Yasumi/Provider/Canada.php new file mode 100644 index 000000000..6ed1f7ea2 --- /dev/null +++ b/src/Yasumi/Provider/Canada.php @@ -0,0 +1,253 @@ + + */ + +namespace Yasumi\Provider; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; + +/** + * Provider for all holidays in Canada. + */ +class Canada extends AbstractProvider +{ + use CommonHolidays, ChristianHolidays; + + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA'; + + /** + * Initialize holidays for Canada. + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + $this->timezone = 'America/Toronto'; + + // Add common holidays + $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale)); + + // Add Christian holidays + $this->addHoliday($this->christmasDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->secondChristmasDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->goodFriday($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->easterMonday($this->year, $this->timezone, $this->locale)); + + // Calculate other holidays + $this->calculateCanadaDay(); + $this->calculateLabourDay(); + $this->calculateThanksgivingDay(); + $this->calculateRemembranceDay(); + } + + /** + * Family Day. + * + * @link https://en.wikipedia.org/wiki/Family_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateFamilyDay(): void + { + if ($this->year < 2009) { + return; + } + + $this->addHoliday(new Holiday( + 'familyDay', + [], + new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Victoria Day. + * + * @link https://en.wikipedia.org/wiki/Victoria_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateVictoriaDay(): void + { + if ($this->year < 1845) { + return; + } + + $this->addHoliday(new Holiday( + 'victoriaDay', + [], + new DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * National Indigenous Peoples Day. + * + * @link https://www.rcaanc-cirnac.gc.ca/eng/1100100013248/1534872397533 + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateNationalIndigenousPeoplesDay(): void + { + if ($this->year < 1996) { + return; + } + + $this->addHoliday(new Holiday( + 'nationalIndigenousPeoplesDay', + [], + new DateTime("$this->year-06-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Canada Day. + * + * @link https://en.wikipedia.org/wiki/Canada_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateCanadaDay(): void + { + if ($this->year < 1983) { + return; + } + + $this->addHoliday(new Holiday( + 'canadaDay', + [], + new DateTime($this->year . '-07-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Civic Holiday. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateCivicHoliday(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'civicHoliday', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Labour Day. + * + * @link https://en.wikipedia.org/wiki/Labour_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateLabourDay(): void + { + if ($this->year < 1894) { + return; + } + + $this->addHoliday(new Holiday( + 'labourDay', + [], + new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Thanksgiving. + * + * @link https://en.wikipedia.org/wiki/Thanksgiving_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateThanksgivingDay(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'thanksgivingDay', + [], + new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Remembrance Day. + * + * @link https://en.wikipedia.org/wiki/Remembrance_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateRemembranceDay(): void + { + if ($this->year < 1919) { + return; + } + + $this->addHoliday(new Holiday( + 'remembranceDay', + [], + new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Alberta.php b/src/Yasumi/Provider/Canada/Alberta.php new file mode 100644 index 000000000..3c4057f46 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Alberta.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Alberta (Canada). + * + * Manitoba is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Alberta + */ +class Alberta extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-AB'; + + /** + * Initialize holidays for Alberta (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Edmonton'; + + $this->calculateHeritageDay(); + $this->calculateFamilyDay(); + $this->calculateVictoriaDay(); + } + + /** + * Heritage Day. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateHeritageDay(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'heritageDay', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/BritishColumbia.php b/src/Yasumi/Provider/Canada/BritishColumbia.php new file mode 100644 index 000000000..2227be6bf --- /dev/null +++ b/src/Yasumi/Provider/Canada/BritishColumbia.php @@ -0,0 +1,53 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; + +/** + * Provider for all holidays in British Columbia (Canada). + * + * British Columbia is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/British_Columbia + */ +class BritishColumbia extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-BC'; + + /** + * Initialize holidays for British Columbia (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Vancouver'; + + $this->calculateCivicHoliday(); + $this->calculateFamilyDay(); + $this->calculateVictoriaDay(); + } +} diff --git a/src/Yasumi/Provider/Canada/Manitoba.php b/src/Yasumi/Provider/Canada/Manitoba.php new file mode 100644 index 000000000..8587202ff --- /dev/null +++ b/src/Yasumi/Provider/Canada/Manitoba.php @@ -0,0 +1,103 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Manitoba (Canada). + * + * Manitoba is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Manitoba + */ +class Manitoba extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-MB'; + + /** + * Initialize holidays for Manitoba (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Winnipeg'; + + $this->calculateCivicHoliday(); + $this->calculateLouisRielDay(); + $this->calculateVictoriaDay(); + } + + /** + * Civic Holiday. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateCivicHoliday(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'terryFoxDay', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Louis Riel Day. + * + * @link https://en.wikipedia.org/wiki/Family_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateLouisRielDay(): void + { + if ($this->year < 2008) { + return; + } + + $this->addHoliday(new Holiday( + 'louisRielDay', + [], + new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/NewBrunswick.php b/src/Yasumi/Provider/Canada/NewBrunswick.php new file mode 100644 index 000000000..1ecbe7191 --- /dev/null +++ b/src/Yasumi/Provider/Canada/NewBrunswick.php @@ -0,0 +1,53 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; + +/** + * Provider for all holidays in New Brunswick (Canada). + * + * New Brunswick is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/New_Brunswick + */ +class NewBrunswick extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-NB'; + + /** + * Initialize holidays for New Brunswick (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Halifax'; + + $this->calculateCivicHoliday(); + $this->calculateFamilyDay(); + $this->calculateVictoriaDay(); + } +} diff --git a/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php new file mode 100644 index 000000000..a484827c2 --- /dev/null +++ b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php @@ -0,0 +1,150 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; +use Yasumi\SubstituteHoliday; + +/** + * Provider for all holidays in Newfoundland and Labrador (Canada). + * + * Manitoba is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Newfoundland_and_Labrador + */ +class NewfoundlandAndLabrador extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-NL'; + + /** + * Initialize holidays for Newfoundland and Labrador (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/St_Johns'; + + $this->calculateStPatricksDay(); + $this->calculateOrangemensDay(); + $this->addHoliday($this->stGeorgesDay($this->year, $this->timezone, $this->locale)); + } + + /** + * St. Patrick's Day. + * + * Saint Patrick's Day, or the Feast of Saint Patrick (Irish: Lá Fhéile Pádraig, "the Day of the Festival of + * Patrick"), is a cultural and religious celebration held on 17 March, the traditional death date of Saint Patrick + * (c. AD 385–461), the foremost patron saint of Ireland. Saint Patrick's Day is a public holiday in the Republic + * of Ireland, Northern Ireland, the Canadian province of Newfoundland and Labrador, and the British Overseas + * Territory of Montserrat. + * + * @link https://en.wikipedia.org/wiki/Saint_Patrick%27s_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + * @throws \Exception + */ + private function calculateStPatricksDay(): void + { + if ($this->year < 1971) { + return; + } + + $holiday = new Holiday( + 'stPatricksDay', + ['en' => 'St. Patrick’s Day'], + new DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_BANK + ); + + $this->addHoliday($holiday); + + // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday + if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + $date = clone $holiday; + $date->modify('next monday'); + + $this->addHoliday(new SubstituteHoliday( + $holiday, + [], + $date, + $this->locale, + Holiday::TYPE_BANK + )); + } + } + + /** + * Orangemen's Day. + * + * Orangemen's Day, also called The Twelfth or Glorious Twelfth) celebrates the Glorious Revolution (1688) + * and victory of Protestant King William of Orange over Catholic king James II at the Battle of the + * Boyne (1690), which began the Protestant Ascendancy in Ireland. + * + * @link https://en.wikipedia.org/wiki/The_Twelfth + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + * @throws \Exception + */ + private function calculateOrangemensDay(): void + { + if ($this->year < 1926) { + return; + } + + $holiday = new Holiday( + 'orangemensDay', + [], + new DateTime($this->year . '-7-12', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_BANK + ); + + $this->addHoliday($holiday); + + // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday + if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + $date = clone $holiday; + $date->modify('next monday'); + + $this->addHoliday(new SubstituteHoliday( + $holiday, + [], + $date, + $this->locale, + Holiday::TYPE_BANK + )); + } + } +} diff --git a/src/Yasumi/Provider/Canada/NorthwestTerritories.php b/src/Yasumi/Provider/Canada/NorthwestTerritories.php new file mode 100644 index 000000000..301e8b1db --- /dev/null +++ b/src/Yasumi/Provider/Canada/NorthwestTerritories.php @@ -0,0 +1,53 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; + +/** + * Provider for all holidays in Northwest Territories (Canada). + * + * Northwest Territories is a territory of Canada. + * + * @link https://en.wikipedia.org/wiki/Northwest_Territories + */ +class NorthwestTerritories extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-NT'; + + /** + * Initialize holidays for Northwest Territories (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Yellowknife'; + + $this->calculateCivicHoliday(); + $this->calculateNationalIndigenousPeoplesDay(); + $this->calculateVictoriaDay(); + } +} diff --git a/src/Yasumi/Provider/Canada/NovaScotia.php b/src/Yasumi/Provider/Canada/NovaScotia.php new file mode 100644 index 000000000..d6177a5f6 --- /dev/null +++ b/src/Yasumi/Provider/Canada/NovaScotia.php @@ -0,0 +1,103 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Nova Scotia (Canada). + * + * Nova Scotia is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Nova_Scotia + */ +class NovaScotia extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-NS'; + + /** + * Initialize holidays for Nova Scotia (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Halifax'; + + $this->calculateCivicHoliday(); + $this->calculateHeritageDay(); + $this->calculateVictoriaDay(); + } + + /** + * Civic Holiday. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateCivicHoliday(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'natalHoliday', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Nova Scotia Heritage Day. + * + * @link https://en.wikipedia.org/wiki/Family_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateHeritageDay(): void + { + if ($this->year < 2015) { + return; + } + + $this->addHoliday(new Holiday( + 'novaScotiaHeritageDay', + [], + new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Nunavut.php b/src/Yasumi/Provider/Canada/Nunavut.php new file mode 100644 index 000000000..9c5177774 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Nunavut.php @@ -0,0 +1,78 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Nunavut (Canada). + * + * Nunavut is a territory of Canada. + * + * @link https://en.wikipedia.org/wiki/Nunavut + */ +class Nunavut extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-NU'; + + /** + * Initialize holidays for Nunavut (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Iqaluit'; + + $this->calculateCivicHoliday(); + $this->calculateVictoriaDay(); + } + + /** + * Civic Holiday. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateCivicHoliday(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'civicHoliday', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Ontario.php b/src/Yasumi/Provider/Canada/Ontario.php new file mode 100644 index 000000000..d7bff7b50 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Ontario.php @@ -0,0 +1,53 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; + +/** + * Provider for all holidays in Ontario (Canada). + * + * Ontario is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Ontario + */ +class Ontario extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-ON'; + + /** + * Initialize holidays for Ontario (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Toronto'; + + $this->calculateCivicHoliday(); + $this->calculateFamilyDay(); + $this->calculateVictoriaDay(); + } +} diff --git a/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php b/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php new file mode 100644 index 000000000..7cbc53a69 --- /dev/null +++ b/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php @@ -0,0 +1,103 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Prince Edward Island (Canada). + * + * Prince Edward Island is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Prince_Edward_Island + */ +class PrinceEdwardIsland extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-PE'; + + /** + * Initialize holidays for Prince Edward Island (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Halifax'; + + $this->calculateIslanderDay(); + $this->calculateGoldCupParadeDay(); + $this->calculateVictoriaDay(); + } + + /** + * Islander Day. + * + * @link https://en.wikipedia.org/wiki/Family_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateIslanderDay(): void + { + if ($this->year < 2009) { + return; + } + + $this->addHoliday(new Holiday( + 'islanderDay', + [], + new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Gold Cup Parade Day. + * + * @link https://en.wikipedia.org/wiki/Public_holidays_in_Canada#Statutory_holidays + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateGoldCupParadeDay(): void + { + if ($this->year < 1962) { + return; + } + + $this->addHoliday(new Holiday( + 'goldCupParadeDay', + [], + new DateTime("third friday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Quebec.php b/src/Yasumi/Provider/Canada/Quebec.php new file mode 100644 index 000000000..d23e01960 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Quebec.php @@ -0,0 +1,117 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Quebec (Canada). + * + * Quebec is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Quebec + */ +class Quebec extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-QC'; + + /** + * Initialize holidays for Quebec (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Toronto'; + + $this->addHoliday($this->saintJeanBaptisteDay($this->year, $this->timezone, $this->locale)); + $this->calculateNationalPatriotsDay(); + } + + /** + * Saint-Jean-Baptiste Day. + * + * The Nativity of John the Baptist (or Birth of John the Baptist, or Nativity of the Forerunner) is a Christian + * feast day celebrating the birth of John the Baptist, a prophet who foretold the coming of the Messiah in the + * person of Jesus, whom he later baptised. The Nativity of John the Baptist on June 24 comes three months after the + * celebration on March 25 of the Annunciation, when the angel Gabriel told Mary that her cousin Elizabeth was in + * her sixth month of pregnancy. + * + * @link https://en.wikipedia.org/wiki/Saint-Jean-Baptiste_Day + * + * @param int $year the year for which St. John's Day need to be created + * @param string $timezone the timezone in which St. John's Day is celebrated + * @param string $locale the locale for which St. John's Day need to be displayed in. + * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, + * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. + * + * @return Holiday + * + * @throws InvalidDateException + * @throws UnknownLocaleException + * @throws \InvalidArgumentException + * @throws \Exception + */ + public function saintJeanBaptisteDay( + int $year, + string $timezone, + string $locale, + string $type = Holiday::TYPE_OFFICIAL + ): Holiday { + return new Holiday( + 'saintJeanBaptisteDay', + [], + new DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), + $locale, + $type + ); + } + + /** + * National Patriot's Day. + * + * @link https://en.wikipedia.org/wiki/National_Patriots%27_Day + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateNationalPatriotsDay(): void + { + if ($this->year < 2003) { + return; + } + + $this->addHoliday(new Holiday( + 'nationalPatriotsDay', + [], + new DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Saskatchewan.php b/src/Yasumi/Provider/Canada/Saskatchewan.php new file mode 100644 index 000000000..f70736f12 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Saskatchewan.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Saskatchewan (Canada). + * + * Saskatchewan is a province of Canada. + * + * @link https://en.wikipedia.org/wiki/Saskatchewan + */ +class Saskatchewan extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-SK'; + + /** + * Initialize holidays for Saskatchewan (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Regina'; + + $this->calculateSaskatchewanDay(); + $this->calculateFamilyDay(); + $this->calculateVictoriaDay(); + } + + /** + * Civic Holiday. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateSaskatchewanDay(): void + { + if ($this->year < 1879) { + return; + } + + $this->addHoliday(new Holiday( + 'saskatchewanDay', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/Provider/Canada/Yukon.php b/src/Yasumi/Provider/Canada/Yukon.php new file mode 100644 index 000000000..17c129191 --- /dev/null +++ b/src/Yasumi/Provider/Canada/Yukon.php @@ -0,0 +1,104 @@ + + */ + +namespace Yasumi\Provider\Canada; + +use DateTime; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Holiday; +use Yasumi\Provider\Canada; +use Yasumi\Provider\DateTimeZoneFactory; + +/** + * Provider for all holidays in Yukon (Canada). + * + * Manitoba is a territory of Canada. + * + * @link https://en.wikipedia.org/wiki/Yukon + */ +class Yukon extends Canada +{ + /** + * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective + * country or sub-region. + */ + public const ID = 'CA-YT'; + + /** + * Initialize holidays for Yukon (Canada). + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + public function initialize(): void + { + parent::initialize(); + + $this->timezone = 'America/Whitehorse'; + + $this->calculateDiscoveryDay(); + $this->calculateHeritageDay(); + $this->calculateNationalIndigenousPeoplesDay(); + $this->calculateVictoriaDay(); + } + + /** + * Discovery Day. + * + * @link https://en.wikipedia.org/wiki/Civic_Holiday + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateDiscoveryDay(): void + { + if ($this->year < 1897) { + return; + } + + $this->addHoliday(new Holiday( + 'discoveryDay', + [], + new DateTime("third monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + + /** + * Yukon Heritage Day. + * + * @link https://en.wikipedia.org/wiki/Family_Day_(Canada) + * + * @throws InvalidDateException + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateHeritageDay(): void + { + if ($this->year < 2009) { + return; + } + + $this->addHoliday(new Holiday( + 'yukonHeritageDay', + [], + new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } +} diff --git a/src/Yasumi/data/translations/canadaDay.php b/src/Yasumi/data/translations/canadaDay.php new file mode 100644 index 000000000..d1afb0b1e --- /dev/null +++ b/src/Yasumi/data/translations/canadaDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Canada Day +return [ + 'en' => 'Canada Day', + 'fr' => 'Fête du Canada', +]; diff --git a/src/Yasumi/data/translations/civicHoliday.php b/src/Yasumi/data/translations/civicHoliday.php new file mode 100644 index 000000000..75f697a3e --- /dev/null +++ b/src/Yasumi/data/translations/civicHoliday.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Civic Holiday +return [ + 'en' => 'Civic Holiday', + 'fr' => 'Premier lundi d’août', +]; diff --git a/src/Yasumi/data/translations/discoveryDay.php b/src/Yasumi/data/translations/discoveryDay.php new file mode 100644 index 000000000..1ba56039d --- /dev/null +++ b/src/Yasumi/data/translations/discoveryDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Discovery Day +return [ + 'en' => 'Discovery Day', + 'fr' => 'Journée découverte', +]; diff --git a/src/Yasumi/data/translations/familyDay.php b/src/Yasumi/data/translations/familyDay.php new file mode 100644 index 000000000..9160573f8 --- /dev/null +++ b/src/Yasumi/data/translations/familyDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Family Day +return [ + 'en' => 'Family Day', + 'fr' => 'Fête de la famille', +]; diff --git a/src/Yasumi/data/translations/goldCupParadeDay.php b/src/Yasumi/data/translations/goldCupParadeDay.php new file mode 100644 index 000000000..0fb7a66fe --- /dev/null +++ b/src/Yasumi/data/translations/goldCupParadeDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Gold Cup Parade Day +return [ + 'en' => 'Gold Cup Parade Day', + 'fr' => 'Défilé de la Coupe d’or', +]; diff --git a/src/Yasumi/data/translations/heritageDay.php b/src/Yasumi/data/translations/heritageDay.php new file mode 100644 index 000000000..a7b0c788b --- /dev/null +++ b/src/Yasumi/data/translations/heritageDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Heritage Day +return [ + 'en' => 'Heritage Day', + 'fr' => 'Fête du patrimoine', +]; diff --git a/src/Yasumi/data/translations/islanderDay.php b/src/Yasumi/data/translations/islanderDay.php new file mode 100644 index 000000000..6cf9aff95 --- /dev/null +++ b/src/Yasumi/data/translations/islanderDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Islander Day +return [ + 'en' => 'Islander Day', + 'fr' => 'Fête des Insulaires', +]; diff --git a/src/Yasumi/data/translations/labourDay.php b/src/Yasumi/data/translations/labourDay.php index d8abc0c2e..53dea8d78 100644 --- a/src/Yasumi/data/translations/labourDay.php +++ b/src/Yasumi/data/translations/labourDay.php @@ -18,4 +18,5 @@ 'ko' => '노동절', 'nl' => 'Dag van de arbeid', 'sk' => 'Sviatok práce', + 'fr' => 'Fête du travail', ]; diff --git a/src/Yasumi/data/translations/louisRielDay.php b/src/Yasumi/data/translations/louisRielDay.php new file mode 100644 index 000000000..bd79411de --- /dev/null +++ b/src/Yasumi/data/translations/louisRielDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Louis Riel Day +return [ + 'en' => 'Louis Riel Day', + 'fr' => 'Journée Louis Riel', +]; diff --git a/src/Yasumi/data/translations/natalHoliday.php b/src/Yasumi/data/translations/natalHoliday.php new file mode 100644 index 000000000..03b88bb59 --- /dev/null +++ b/src/Yasumi/data/translations/natalHoliday.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Natal Holiday +return [ + 'en' => 'Natal Holiday', + 'fr' => 'Jour de la Fondation', +]; diff --git a/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php b/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php new file mode 100644 index 000000000..e8f14441c --- /dev/null +++ b/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for National Indigenous Peoples Day +return [ + 'en' => 'National Indigenous Peoples Day', + 'fr' => 'Journée nationale des peuples autochtones', +]; diff --git a/src/Yasumi/data/translations/nationalPatriotsDay.php b/src/Yasumi/data/translations/nationalPatriotsDay.php new file mode 100644 index 000000000..8f85292a7 --- /dev/null +++ b/src/Yasumi/data/translations/nationalPatriotsDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for National Patriot's Day +return [ + 'en' => 'National Patriot’s Day', + 'fr' => 'Journée nationale des patriotes', +]; diff --git a/src/Yasumi/data/translations/novaScotiaHeritageDay.php b/src/Yasumi/data/translations/novaScotiaHeritageDay.php new file mode 100644 index 000000000..6169637f6 --- /dev/null +++ b/src/Yasumi/data/translations/novaScotiaHeritageDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Nova Scotia Heritage Day +return [ + 'en' => 'Nova Scotia Heritage Day', + 'fr' => 'Journée du patrimoine de la Nouvelle-Écosse', +]; diff --git a/src/Yasumi/data/translations/orangemensDay.php b/src/Yasumi/data/translations/orangemensDay.php new file mode 100644 index 000000000..24981cea4 --- /dev/null +++ b/src/Yasumi/data/translations/orangemensDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Orangemen's Day +return [ + 'en' => 'Orangemen’s Day', + 'fr' => 'Fête des orangistes', +]; diff --git a/src/Yasumi/data/translations/remembranceDay.php b/src/Yasumi/data/translations/remembranceDay.php new file mode 100644 index 000000000..0ee4f1c6c --- /dev/null +++ b/src/Yasumi/data/translations/remembranceDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Remembrance Day +return [ + 'en' => 'Remembrance Day', + 'fr' => 'Jour du souvenir', +]; diff --git a/src/Yasumi/data/translations/saintJeanBaptisteDay.php b/src/Yasumi/data/translations/saintJeanBaptisteDay.php new file mode 100644 index 000000000..0d1f1cf0e --- /dev/null +++ b/src/Yasumi/data/translations/saintJeanBaptisteDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Saint-Jean Baptiste Day +return [ + 'en' => 'Saint-Jean-Baptiste Day', + 'fr' => 'Fête de la Saint-Jean-Baptiste', +]; diff --git a/src/Yasumi/data/translations/saskatchewanDay.php b/src/Yasumi/data/translations/saskatchewanDay.php new file mode 100644 index 000000000..f35d3d7c6 --- /dev/null +++ b/src/Yasumi/data/translations/saskatchewanDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Saskatchewan Day +return [ + 'en' => 'Saskatchewan Day', + 'fr' => 'Jour Saskatchewan', +]; diff --git a/src/Yasumi/data/translations/terryFoxDay.php b/src/Yasumi/data/translations/terryFoxDay.php new file mode 100644 index 000000000..41d6394f0 --- /dev/null +++ b/src/Yasumi/data/translations/terryFoxDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Terry Fox Day +return [ + 'en' => 'Terry Fox Day', + 'fr' => 'Journée Terry Fox', +]; diff --git a/src/Yasumi/data/translations/thanksgivingDay.php b/src/Yasumi/data/translations/thanksgivingDay.php new file mode 100644 index 000000000..5fad7ed10 --- /dev/null +++ b/src/Yasumi/data/translations/thanksgivingDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Thanksgiving +return [ + 'en' => 'Thanksgiving', + 'fr' => 'Action de grâce', +]; diff --git a/src/Yasumi/data/translations/victoriaDay.php b/src/Yasumi/data/translations/victoriaDay.php new file mode 100644 index 000000000..d4b87cb0c --- /dev/null +++ b/src/Yasumi/data/translations/victoriaDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Victoria Day +return [ + 'en' => 'Victoria Day', + 'fr' => 'Fête de la Reine', +]; diff --git a/src/Yasumi/data/translations/yukonHeritageDay.php b/src/Yasumi/data/translations/yukonHeritageDay.php new file mode 100644 index 000000000..a4d10b426 --- /dev/null +++ b/src/Yasumi/data/translations/yukonHeritageDay.php @@ -0,0 +1,18 @@ + + */ + +// Translations for Yukon Heritage Day +return [ + 'en' => 'Yukon Heritage Day', + 'fr' => 'Journée du patrimoine du Yukon', +]; diff --git a/tests/Canada/Alberta/AlbertaBaseTestCase.php b/tests/Canada/Alberta/AlbertaBaseTestCase.php new file mode 100644 index 000000000..305b2c781 --- /dev/null +++ b/tests/Canada/Alberta/AlbertaBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Alberta; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Alberta holiday provider. + */ +abstract class AlbertaBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Alberta'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Edmonton'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Alberta/AlbertaTest.php b/tests/Canada/Alberta/AlbertaTest.php new file mode 100644 index 000000000..d4a3e313d --- /dev/null +++ b/tests/Canada/Alberta/AlbertaTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\Alberta; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Alberta. + */ +class AlbertaTest extends AlbertaBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Alberta are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'heritageDay', + 'familyDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Alberta are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Alberta are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Alberta are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Alberta are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php b/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php new file mode 100644 index 000000000..8be5614cc --- /dev/null +++ b/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\BritishColumbia; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the British Columbia holiday provider. + */ +abstract class BritishColumbiaBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\BritishColumbia'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Vancouver'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/BritishColumbia/BritishColumbiaTest.php b/tests/Canada/BritishColumbia/BritishColumbiaTest.php new file mode 100644 index 000000000..b29541e60 --- /dev/null +++ b/tests/Canada/BritishColumbia/BritishColumbiaTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\BritishColumbia; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in British Columbia. + */ +class BritishColumbiaTest extends BritishColumbiaBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in BritishColumbia are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'civicHoliday', + 'familyDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in BritishColumbia are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in BritishColumbia are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in BritishColumbia are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in BritishColumbia are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/CanadaBaseTestCase.php b/tests/Canada/CanadaBaseTestCase.php new file mode 100644 index 000000000..5dc8f7a23 --- /dev/null +++ b/tests/Canada/CanadaBaseTestCase.php @@ -0,0 +1,39 @@ + + */ + +namespace Yasumi\tests\Canada; + +use PHPUnit\Framework\TestCase; +use Yasumi\tests\YasumiBase; + +/** + * Class CanadaBaseTestCase. + */ +abstract class CanadaBaseTestCase extends TestCase +{ + use YasumiBase; + + /** + * Country (name) to be tested + */ + public const REGION = 'Canada'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Toronto'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; +} diff --git a/tests/Canada/CanadaDayTest.php b/tests/Canada/CanadaDayTest.php new file mode 100644 index 000000000..e49293f70 --- /dev/null +++ b/tests/Canada/CanadaDayTest.php @@ -0,0 +1,93 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Canada Day in Canada. + */ +class CanadaDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'canadaDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 1983; + + /** + * Tests Canada Day on or after 1983. Canada Day was established in 1983 on July 1st. + * @throws Exception + * @throws ReflectionException + */ + public function testCanadaDayOnAfter1983() + { + $year = $this->generateRandomYear(1983); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-07-01", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Canada Day before 1879. Canada Day was established as Dominion Day in 1879 on July 1st. + * @throws ReflectionException + */ + public function testCanadaDayBefore1879() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Canada Day'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Canada/CanadaTest.php b/tests/Canada/CanadaTest.php new file mode 100644 index 000000000..a0af70f03 --- /dev/null +++ b/tests/Canada/CanadaTest.php @@ -0,0 +1,90 @@ + + */ + +namespace Yasumi\tests\Canada; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in the Canada. + */ +class CanadaTest extends CanadaBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in the USA are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'newYearsDay', + 'goodFriday', + 'easterMonday', + 'canadaDay', + 'labourDay', + 'remembranceDay', + 'thanksgivingDay', + 'christmasDay', + 'secondChristmasDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in the Canada are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in the Canada are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in the Canada are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in the Canada are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1986); + } +} diff --git a/tests/Canada/ChristmasDayTest.php b/tests/Canada/ChristmasDayTest.php new file mode 100644 index 000000000..7b21f9708 --- /dev/null +++ b/tests/Canada/ChristmasDayTest.php @@ -0,0 +1,70 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing New Years Day in the USA. + */ +class ChristmasDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'christmasDay'; + + /** + * Tests Christmas Day. Christmas Day is celebrated on December 25th. + * @throws Exception + * @throws ReflectionException + */ + public function testChristmasDay() + { + $year = 2001; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Christmas Day'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Canada/LabourDayTest.php b/tests/Canada/LabourDayTest.php new file mode 100644 index 000000000..abb9303d5 --- /dev/null +++ b/tests/Canada/LabourDayTest.php @@ -0,0 +1,93 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Labour Day in Canada. + */ +class LabourDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'labourDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 1894; + + /** + * Tests Labour Day on or after 1894. Labour Day was established since 1894 on the first Monday of September. + * @throws Exception + * @throws ReflectionException + */ + public function testLabourDayOnAfter1894() + { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("first monday of september $year", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Labour Day before 1894. Labour Day was established since 1894 on the first Monday of September. + * @throws ReflectionException + */ + public function testLabourDayBefore1894() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Labour Day'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Canada/Manitoba/ManitobaBaseTestCase.php b/tests/Canada/Manitoba/ManitobaBaseTestCase.php new file mode 100644 index 000000000..3813a457c --- /dev/null +++ b/tests/Canada/Manitoba/ManitobaBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Manitoba; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Manitoba holiday provider. + */ +abstract class ManitobaBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Manitoba'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Winnipeg'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Manitoba/ManitobaTest.php b/tests/Canada/Manitoba/ManitobaTest.php new file mode 100644 index 000000000..c01302460 --- /dev/null +++ b/tests/Canada/Manitoba/ManitobaTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\Manitoba; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Manitoba. + */ +class ManitobaTest extends ManitobaBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Manitoba are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'terryFoxDay', + 'louisRielDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Manitoba are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Manitoba are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Manitoba are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Manitoba are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php b/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php new file mode 100644 index 000000000..cad679d25 --- /dev/null +++ b/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\NewBrunswick; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the New Brunswick holiday provider. + */ +abstract class NewBrunswickBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\NewBrunswick'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Halifax'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/NewBrunswick/NewBrunswickTest.php b/tests/Canada/NewBrunswick/NewBrunswickTest.php new file mode 100644 index 000000000..7952bb723 --- /dev/null +++ b/tests/Canada/NewBrunswick/NewBrunswickTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\NewBrunswick; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in New Brunswick. + */ +class NewBrunswickTest extends NewBrunswickBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in NewBrunswick are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'civicHoliday', + 'familyDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in NewBrunswick are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in NewBrunswick are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in NewBrunswick are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in NewBrunswick are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/NewYearsDayTest.php b/tests/Canada/NewYearsDayTest.php new file mode 100644 index 000000000..867512312 --- /dev/null +++ b/tests/Canada/NewYearsDayTest.php @@ -0,0 +1,70 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing New Years Day in Canada. + */ +class NewYearsDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'newYearsDay'; + + /** + * Tests New Years Day. + * @throws Exception + * @throws ReflectionException + */ + public function testNewYearsDay() + { + $year = 1997; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'New Year’s Day'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} diff --git a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php new file mode 100644 index 000000000..891b8dcd7 --- /dev/null +++ b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\NewfoundlandAndLabrador; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Newfoundland and Labrador holiday provider. + */ +abstract class NewfoundlandAndLabradorBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\NewfoundlandAndLabrador'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/St_Johns'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php new file mode 100644 index 000000000..57d26378e --- /dev/null +++ b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php @@ -0,0 +1,87 @@ + + */ + +namespace Yasumi\tests\Canada\NewfoundlandAndLabrador; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Newfoundland and Labrador. + */ +class NewfoundlandAndLabradorTest extends NewfoundlandAndLabradorBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in NewfoundlandAndLabrador are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'stGeorgesDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in NewfoundlandAndLabrador are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in NewfoundlandAndLabrador are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in NewfoundlandAndLabrador are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([ + 'stPatricksDay', + 'orangemensDay', + ], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in NewfoundlandAndLabrador are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php new file mode 100644 index 000000000..105188a60 --- /dev/null +++ b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\NorthwestTerritories; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Northwest Territories holiday provider. + */ +abstract class NorthwestTerritoriesBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\NorthwestTerritories'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Yellowknife'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php new file mode 100644 index 000000000..e25894788 --- /dev/null +++ b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\NorthwestTerritories; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Northwest Territories. + */ +class NorthwestTerritoriesTest extends NorthwestTerritoriesBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in NorthwestTerritories are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'civicHoliday', + 'nationalIndigenousPeoplesDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in NorthwestTerritories are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in NorthwestTerritories are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in NorthwestTerritories are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in NorthwestTerritories are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php b/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php new file mode 100644 index 000000000..40cd1de90 --- /dev/null +++ b/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\NovaScotia; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Nova Scotia holiday provider. + */ +abstract class NovaScotiaBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\NovaScotia'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Halifax'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/NovaScotia/NovaScotiaTest.php b/tests/Canada/NovaScotia/NovaScotiaTest.php new file mode 100644 index 000000000..891661bf9 --- /dev/null +++ b/tests/Canada/NovaScotia/NovaScotiaTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\NovaScotia; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Nova Scotia. + */ +class NovaScotiaTest extends NovaScotiaBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Nova Scotia are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'natalHoliday', + 'novaScotiaHeritageDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in NovaScotia are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in NovaScotia are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in NovaScotia are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in NovaScotia are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/Nunavut/NunavutBaseTestCase.php b/tests/Canada/Nunavut/NunavutBaseTestCase.php new file mode 100644 index 000000000..bcffb099f --- /dev/null +++ b/tests/Canada/Nunavut/NunavutBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Nunavut; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Nunavut holiday provider. + */ +abstract class NunavutBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Nunavut'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Iqaluit'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Nunavut/NunavutTest.php b/tests/Canada/Nunavut/NunavutTest.php new file mode 100644 index 000000000..a540b905c --- /dev/null +++ b/tests/Canada/Nunavut/NunavutTest.php @@ -0,0 +1,85 @@ + + */ + +namespace Yasumi\tests\Canada\Nunavut; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Nunavut. + */ +class NunavutTest extends NunavutBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Nunavut are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'civicHoliday', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Nunavut are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Nunavut are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Nunavut are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Nunavut are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/Ontario/OntarioBaseTestCase.php b/tests/Canada/Ontario/OntarioBaseTestCase.php new file mode 100644 index 000000000..d7e0ad953 --- /dev/null +++ b/tests/Canada/Ontario/OntarioBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Ontario; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Ontario holiday provider. + */ +abstract class OntarioBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Ontario'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Toronto'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Ontario/OntarioTest.php b/tests/Canada/Ontario/OntarioTest.php new file mode 100644 index 000000000..97d6bfb3d --- /dev/null +++ b/tests/Canada/Ontario/OntarioTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\Ontario; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Ontario. + */ +class OntarioTest extends OntarioBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Ontario are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'civicHoliday', + 'familyDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Ontario are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Ontario are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Ontario are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Ontario are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php new file mode 100644 index 000000000..033cb2119 --- /dev/null +++ b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\PrinceEdwardIsland; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Prince Edward Island holiday provider. + */ +abstract class PrinceEdwardIslandBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\PrinceEdwardIsland'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Halifax'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php new file mode 100644 index 000000000..36a76514a --- /dev/null +++ b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\PrinceEdwardIsland; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Prince Edward Island. + */ +class PrinceEdwardIslandTest extends PrinceEdwardIslandBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Prince Edward Island are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'goldCupParadeDay', + 'islanderDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in PrinceEdwardIsland are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in PrinceEdwardIsland are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in PrinceEdwardIsland are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in PrinceEdwardIsland are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/Quebec/QuebecBaseTestCase.php b/tests/Canada/Quebec/QuebecBaseTestCase.php new file mode 100644 index 000000000..d77226b39 --- /dev/null +++ b/tests/Canada/Quebec/QuebecBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Quebec; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Quebec holiday provider. + */ +abstract class QuebecBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Quebec'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Toronto'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Quebec/QuebecTest.php b/tests/Canada/Quebec/QuebecTest.php new file mode 100644 index 000000000..f97f3d1f0 --- /dev/null +++ b/tests/Canada/Quebec/QuebecTest.php @@ -0,0 +1,85 @@ + + */ + +namespace Yasumi\tests\Canada\Quebec; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Quebec. + */ +class QuebecTest extends QuebecBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Quebec are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'saintJeanBaptisteDay', + 'nationalPatriotsDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Quebec are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Quebec are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Quebec are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Quebec are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/RemembranceDayTest.php b/tests/Canada/RemembranceDayTest.php new file mode 100644 index 000000000..1efc8bb91 --- /dev/null +++ b/tests/Canada/RemembranceDayTest.php @@ -0,0 +1,93 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Remembrance Day in Canada. + */ +class RemembranceDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'remembranceDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 1919; + + /** + * Tests Remembrance Day on or after 1919. Remembrance Day was established in 1919 on November 11. + * @throws Exception + * @throws ReflectionException + */ + public function testRemembranceDayOnAfter1919() + { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("$year-11-11", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Remembrance Day before 1919. Remembrance Day was established in 1919 on November 11. + * @throws ReflectionException + */ + public function testVeteransDayBefore1919() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1954), + [self::LOCALE => 'Remembrance Day'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php b/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php new file mode 100644 index 000000000..e47f84c16 --- /dev/null +++ b/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Saskatchewan; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Saskatchewan holiday provider. + */ +abstract class SaskatchewanBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Saskatchewan'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Regina'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Saskatchewan/SaskatchewanTest.php b/tests/Canada/Saskatchewan/SaskatchewanTest.php new file mode 100644 index 000000000..c6ca3cacd --- /dev/null +++ b/tests/Canada/Saskatchewan/SaskatchewanTest.php @@ -0,0 +1,86 @@ + + */ + +namespace Yasumi\tests\Canada\Saskatchewan; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Saskatchewan. + */ +class SaskatchewanTest extends SaskatchewanBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Saskatchewan are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'victoriaDay', + 'saskatchewanDay', + 'familyDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Saskatchewan are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Saskatchewan are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Saskatchewan are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Saskatchewan are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} diff --git a/tests/Canada/ThanksgivingDayTest.php b/tests/Canada/ThanksgivingDayTest.php new file mode 100644 index 000000000..5ec7c8317 --- /dev/null +++ b/tests/Canada/ThanksgivingDayTest.php @@ -0,0 +1,95 @@ + + */ + +namespace Yasumi\tests\Canada; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing Thanksgiving Day in Canada. + */ +class ThanksgivingDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday + */ + public const HOLIDAY = 'thanksgivingDay'; + + /** + * The year in which the holiday was first established + */ + public const ESTABLISHMENT_YEAR = 1879; + + /** + * Tests Thanksgiving Day on or after 1879. Thanksgiving Day is celebrated since 1879 on the second Monday + * of October. + * @throws Exception + * @throws ReflectionException + */ + public function testThanksgivingDayOnAfter1879() + { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("second monday of october $year", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests Thanksgiving Day before 1879. ThanksgivingDay Day is celebrated since 1879 on the second Monday + * of October. + * @throws ReflectionException + */ + public function testThanksgivingDayBefore1879() + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) + ); + } + + /** + * Tests translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Thanksgiving'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Canada/Yukon/YukonBaseTestCase.php b/tests/Canada/Yukon/YukonBaseTestCase.php new file mode 100644 index 000000000..1db4d570b --- /dev/null +++ b/tests/Canada/Yukon/YukonBaseTestCase.php @@ -0,0 +1,44 @@ + + */ + +namespace Yasumi\tests\Canada\Yukon; + +use Yasumi\tests\Canada\CanadaBaseTestCase; +use Yasumi\tests\YasumiBase; + +/** + * Base class for test cases of the Yukon holiday provider. + */ +abstract class YukonBaseTestCase extends CanadaBaseTestCase +{ + use YasumiBase; + + /** + * Name of the region (e.g. country / state) to be tested + */ + public const REGION = 'Canada\Yukon'; + + /** + * Timezone in which this provider has holidays defined + */ + public const TIMEZONE = 'America/Whitehorse'; + + /** + * Locale that is considered common for this provider + */ + public const LOCALE = 'en_CA'; + + /** + * Number of iterations to be used for the various unit tests of this provider + */ + public const TEST_ITERATIONS = 50; +} diff --git a/tests/Canada/Yukon/YukonTest.php b/tests/Canada/Yukon/YukonTest.php new file mode 100644 index 000000000..c4bd2040e --- /dev/null +++ b/tests/Canada/Yukon/YukonTest.php @@ -0,0 +1,87 @@ + + */ + +namespace Yasumi\tests\Canada\Yukon; + +use ReflectionException; +use Yasumi\Holiday; + +/** + * Class for testing holidays in Yukon. + */ +class YukonTest extends YukonBaseTestCase +{ + /** + * @var int year random year number used for all tests in this Test Case + */ + protected $year; + + /** + * Tests if all official holidays in Yukon are defined by the provider class + * @throws ReflectionException + */ + public function testOfficialHolidays(): void + { + $this->assertDefinedHolidays([ + 'goodFriday', + 'christmasDay', + 'discoveryDay', + 'victoriaDay', + 'yukonHeritageDay', + 'nationalIndigenousPeoplesDay', + ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + } + + /** + * Tests if all observed holidays in Yukon are defined by the provider class + * @throws ReflectionException + */ + public function testObservedHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + } + + /** + * Tests if all seasonal holidays in Yukon are defined by the provider class + * @throws ReflectionException + */ + public function testSeasonalHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); + } + + /** + * Tests if all bank holidays in Yukon are defined by the provider class + * @throws ReflectionException + */ + public function testBankHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); + } + + /** + * Tests if all other holidays in Yukon are defined by the provider class + * @throws ReflectionException + */ + public function testOtherHolidays(): void + { + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); + } + + /** + * Initial setup of this Test Case + */ + protected function setUp(): void + { + $this->year = $this->generateRandomYear(1978); + } +} From 3489e86c2804f71b79c55fd39b1542787a9eef8d Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 10 May 2020 09:37:20 +0900 Subject: [PATCH 071/115] Reformatting and cleanup. --- tests/Base/SubstituteHolidayTest.php | 36 +++---- tests/TypographyTest.php | 7 +- tests/Ukraine/SubstitutedHolidayTest.php | 96 +++++++++---------- tests/UnitedKingdom/England/BoxingDayTest.php | 2 +- .../England/ChristmasDayTest.php | 2 +- .../England/EasterMondayTest.php | 2 +- .../UnitedKingdom/England/NewYearsDayTest.php | 2 +- .../NorthernIreland/BattleOfTheBoyneTest.php | 6 +- .../NorthernIreland/BoxingDayTest.php | 2 +- .../NorthernIreland/ChristmasDayTest.php | 2 +- .../NorthernIreland/EasterMondayTest.php | 2 +- .../NorthernIreland/NewYearsDayTest.php | 2 +- .../NorthernIreland/StPatricksDayTest.php | 6 +- .../UnitedKingdom/Scotland/BoxingDayTest.php | 2 +- .../Scotland/ChristmasDayTest.php | 2 +- .../Scotland/NewYearsDayTest.php | 6 +- .../Scotland/SecondNewYearsDayTest.php | 6 +- .../Scotland/StAndrewsDayTest.php | 6 +- tests/UnitedKingdom/Wales/BoxingDayTest.php | 2 +- .../UnitedKingdom/Wales/ChristmasDayTest.php | 2 +- .../UnitedKingdom/Wales/EasterMondayTest.php | 2 +- tests/UnitedKingdom/Wales/NewYearsDayTest.php | 2 +- tests/YasumiBase.php | 50 +++++----- 23 files changed, 123 insertions(+), 124 deletions(-) diff --git a/tests/Base/SubstituteHolidayTest.php b/tests/Base/SubstituteHolidayTest.php index bd44442b0..a9e1f34f8 100644 --- a/tests/Base/SubstituteHolidayTest.php +++ b/tests/Base/SubstituteHolidayTest.php @@ -79,9 +79,9 @@ public function testConstructor(): void */ public function testSubstituteHolidayIsJsonSerializable(): void { - $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US'); + $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US'); $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US'); - $json = \json_encode($substitute); + $json = \json_encode($substitute); $instance = \json_decode($json, true); $this->assertIsArray($instance); @@ -129,11 +129,11 @@ public function testSubstituteHolidayGetNameWithNoTranslations(): void */ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): void { - $name = 'testHoliday'; + $name = 'testHoliday'; $translation = 'My Holiday'; - $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); + $locale = 'en_US'; + $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn([$locale => 'foo']); @@ -152,11 +152,11 @@ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): v */ public function testSubstituteHolidayGetNameWithPatternFallback(): void { - $name = 'testHoliday'; + $name = 'testHoliday'; $translation = 'My Holiday'; - $locale = 'en_US'; - $holiday = new Holiday($name, [], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); + $locale = 'en_US'; + $holiday = new Holiday($name, [], new DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn(['en' => '{0} obs']); @@ -175,11 +175,11 @@ public function testSubstituteHolidayGetNameWithPatternFallback(): void */ public function testSubstituteHolidayGetNameWithGlobalSubstituteTranslation(): void { - $name = 'testHoliday'; + $name = 'testHoliday'; $translation = 'My Substitute'; - $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); + $locale = 'en_US'; + $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn([$locale => '{0} observed']); @@ -198,11 +198,11 @@ public function testSubstituteHolidayGetNameWithGlobalSubstituteTranslation(): v */ public function testSubstituteHolidayGetNameWithSubstitutedTranslation(): void { - $name = 'testHoliday'; + $name = 'testHoliday'; $translation = 'My Holiday'; - $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => $translation], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); + $locale = 'en_US'; + $holiday = new Holiday($name, [$locale => $translation], new DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub->expects($this->at(0))->method('getTranslations')->with($this->equalTo('substituteHoliday'))->willReturn([$locale => '{0} observed']); diff --git a/tests/TypographyTest.php b/tests/TypographyTest.php index f59c52867..ed767494c 100644 --- a/tests/TypographyTest.php +++ b/tests/TypographyTest.php @@ -14,7 +14,6 @@ namespace Yasumi\tests; use PHPUnit\Framework\TestCase; -use Yasumi\Translations; use Yasumi\Yasumi; /** @@ -33,10 +32,10 @@ class TypographyTest extends TestCase /** * @dataProvider translationProvider * - * @param string $name The localized holiday name - * @param string $class The provider + * @param string $name The localized holiday name + * @param string $class The provider * @param string $shortName The short name (internal name) of the holiday - * @param string $locale The locale + * @param string $locale The locale */ public function testTranslations($name, $class, $shortName, $locale): void { diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index b8e8db952..18b7b000f 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -50,6 +50,54 @@ public function testSaturdaySubstitution() unset($year, $holiday); } + /** + * Asserts that the expected date is indeed a holiday for that given year and name + * + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $shortName string the short name of the holiday to be checked against + * @param int $year holiday calendar year + * @param DateTime $expected the official date to be checked against + * @param DateTime $expected the substituted date to be checked against + * + * @throws UnknownLocaleException + * @throws InvalidDateException + * @throws InvalidArgumentException + * @throws RuntimeException + * @throws AssertionFailedError + * @throws ReflectionException + */ + public function assertHolidayWithSubstitution( + string $provider, + string $shortName, + int $year, + DateTime $expectedOfficial, + DateTime $expectedSubstitution = null + ): void { + $holidays = Yasumi::create($provider, $year); + + $holidayOfficial = $holidays->getHoliday($shortName); + $this->assertInstanceOf(Holiday::class, $holidayOfficial); + $this->assertNotNull($holidayOfficial); + $this->assertEquals($expectedOfficial, $holidayOfficial); + $this->assertTrue($holidays->isHoliday($holidayOfficial)); + $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); + + $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->shortName); + if ($expectedSubstitution === null) { + // without substitution + $this->assertNull($holidaySubstitution); + } else { + // with substitution + $this->assertNotNull($holidaySubstitution); + $this->assertInstanceOf(SubstituteHoliday::class, $holidaySubstitution); + $this->assertEquals($expectedSubstitution, $holidaySubstitution); + $this->assertTrue($holidays->isHoliday($holidaySubstitution)); + $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidaySubstitution->getType()); + } + + unset($holidayOfficial, $holidaySubstitution, $holidays); + } + /** * Tests the substitution of holidays on sunday (weekend). * @throws Exception @@ -133,52 +181,4 @@ public function testHolidayType(): void { $this->assertTrue(true); } - - /** - * Asserts that the expected date is indeed a holiday for that given year and name - * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName string the short name of the holiday to be checked against - * @param int $year holiday calendar year - * @param DateTime $expected the official date to be checked against - * @param DateTime $expected the substituted date to be checked against - * - * @throws UnknownLocaleException - * @throws InvalidDateException - * @throws InvalidArgumentException - * @throws RuntimeException - * @throws AssertionFailedError - * @throws ReflectionException - */ - public function assertHolidayWithSubstitution( - string $provider, - string $shortName, - int $year, - DateTime $expectedOfficial, - DateTime $expectedSubstitution = null - ): void { - $holidays = Yasumi::create($provider, $year); - - $holidayOfficial = $holidays->getHoliday($shortName); - $this->assertInstanceOf(Holiday::class, $holidayOfficial); - $this->assertNotNull($holidayOfficial); - $this->assertEquals($expectedOfficial, $holidayOfficial); - $this->assertTrue($holidays->isHoliday($holidayOfficial)); - $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); - - $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->shortName); - if ($expectedSubstitution === null) { - // without substitution - $this->assertNull($holidaySubstitution); - } else { - // with substitution - $this->assertNotNull($holidaySubstitution); - $this->assertInstanceOf(SubstituteHoliday::class, $holidaySubstitution); - $this->assertEquals($expectedSubstitution, $holidaySubstitution); - $this->assertTrue($holidays->isHoliday($holidaySubstitution)); - $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidaySubstitution->getType()); - } - - unset($holidayOfficial, $holidaySubstitution, $holidays); - } } diff --git a/tests/UnitedKingdom/England/BoxingDayTest.php b/tests/UnitedKingdom/England/BoxingDayTest.php index c9cc00fd3..fbdca605c 100644 --- a/tests/UnitedKingdom/England/BoxingDayTest.php +++ b/tests/UnitedKingdom/England/BoxingDayTest.php @@ -35,7 +35,7 @@ class BoxingDayTest extends EnglandBaseTestCase implements YasumiTestCaseInterfa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/England/ChristmasDayTest.php b/tests/UnitedKingdom/England/ChristmasDayTest.php index cd5057633..883bf3d31 100644 --- a/tests/UnitedKingdom/England/ChristmasDayTest.php +++ b/tests/UnitedKingdom/England/ChristmasDayTest.php @@ -35,7 +35,7 @@ class ChristmasDayTest extends EnglandBaseTestCase implements YasumiTestCaseInte * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/England/EasterMondayTest.php b/tests/UnitedKingdom/England/EasterMondayTest.php index 1b399aa00..56a78fe36 100644 --- a/tests/UnitedKingdom/England/EasterMondayTest.php +++ b/tests/UnitedKingdom/England/EasterMondayTest.php @@ -35,7 +35,7 @@ class EasterMondayTest extends EnglandBaseTestCase implements YasumiTestCaseInte * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/England/NewYearsDayTest.php b/tests/UnitedKingdom/England/NewYearsDayTest.php index 0693204bc..6b70c42ec 100644 --- a/tests/UnitedKingdom/England/NewYearsDayTest.php +++ b/tests/UnitedKingdom/England/NewYearsDayTest.php @@ -44,7 +44,7 @@ class NewYearsDayTest extends EnglandBaseTestCase implements YasumiTestCaseInter * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php index a32bc7ca0..f8616044e 100644 --- a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php @@ -39,7 +39,7 @@ class BattleOfTheBoyneTest extends NorthernIrelandBaseTestCase implements Yasumi * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param \DateTime $expected the expected date * * @throws ReflectionException @@ -80,8 +80,8 @@ public function HolidayDataProvider(): array $data = []; for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-7-12", new DateTimeZone(self::TIMEZONE)); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $date = new DateTime("$year-7-12", new DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } diff --git a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php index 699ba84dd..46943a1db 100644 --- a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php @@ -35,7 +35,7 @@ class BoxingDayTest extends NorthernIrelandBaseTestCase implements YasumiTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php index 48f61604c..a5479b8e6 100644 --- a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php @@ -35,7 +35,7 @@ class ChristmasDayTest extends NorthernIrelandBaseTestCase implements YasumiTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php index d0f47fdcc..bd12f03e5 100644 --- a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php @@ -35,7 +35,7 @@ class EasterMondayTest extends NorthernIrelandBaseTestCase implements YasumiTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php index afa47f9ec..e73c24fd5 100644 --- a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php @@ -44,7 +44,7 @@ class NewYearsDayTest extends NorthernIrelandBaseTestCase implements YasumiTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php index 6872c0f6a..0f76150ab 100644 --- a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php @@ -39,7 +39,7 @@ class StPatricksDayTest extends NorthernIrelandBaseTestCase implements YasumiTes * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param \DateTime $expected the expected date * * @throws ReflectionException @@ -80,8 +80,8 @@ public function HolidayDataProvider(): array $data = []; for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-3-17", new DateTimeZone(self::TIMEZONE)); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $date = new DateTime("$year-3-17", new DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } diff --git a/tests/UnitedKingdom/Scotland/BoxingDayTest.php b/tests/UnitedKingdom/Scotland/BoxingDayTest.php index ece15eb40..741ea6a9b 100644 --- a/tests/UnitedKingdom/Scotland/BoxingDayTest.php +++ b/tests/UnitedKingdom/Scotland/BoxingDayTest.php @@ -35,7 +35,7 @@ class BoxingDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInterf * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php index 03536aad5..9ba0c4605 100644 --- a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php @@ -35,7 +35,7 @@ class ChristmasDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInt * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php index bceaab964..bc5faea1c 100644 --- a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php @@ -45,7 +45,7 @@ class NewYearsDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInte * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException @@ -100,8 +100,8 @@ public function HolidayDataProvider(): array $data = []; for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } diff --git a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php index 710088b6c..c218feb4c 100644 --- a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php @@ -45,7 +45,7 @@ class SecondNewYearsDayTest extends ScotlandBaseTestCase implements YasumiTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException @@ -100,8 +100,8 @@ public function HolidayDataProvider(): array $data = []; for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-2", new DateTimeZone(self::TIMEZONE)); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $date = new DateTime("$year-1-2", new DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } diff --git a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php index 93d3e9871..693416ca9 100644 --- a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php +++ b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php @@ -39,7 +39,7 @@ class StAndrewsDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInt * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param \DateTime $expected the expected date * * @throws ReflectionException @@ -67,8 +67,8 @@ public function HolidayDataProvider(): array $data = []; for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-11-30", new DateTimeZone(self::TIMEZONE)); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + $date = new DateTime("$year-11-30", new DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } diff --git a/tests/UnitedKingdom/Wales/BoxingDayTest.php b/tests/UnitedKingdom/Wales/BoxingDayTest.php index bd8c286ad..950700c2c 100644 --- a/tests/UnitedKingdom/Wales/BoxingDayTest.php +++ b/tests/UnitedKingdom/Wales/BoxingDayTest.php @@ -35,7 +35,7 @@ class BoxingDayTest extends WalesBaseTestCase implements YasumiTestCaseInterface * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/Wales/ChristmasDayTest.php b/tests/UnitedKingdom/Wales/ChristmasDayTest.php index 2166bd554..893d8d39c 100644 --- a/tests/UnitedKingdom/Wales/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Wales/ChristmasDayTest.php @@ -35,7 +35,7 @@ class ChristmasDayTest extends WalesBaseTestCase implements YasumiTestCaseInterf * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/Wales/EasterMondayTest.php b/tests/UnitedKingdom/Wales/EasterMondayTest.php index a653438aa..ff34e9149 100644 --- a/tests/UnitedKingdom/Wales/EasterMondayTest.php +++ b/tests/UnitedKingdom/Wales/EasterMondayTest.php @@ -35,7 +35,7 @@ class EasterMondayTest extends WalesBaseTestCase implements YasumiTestCaseInterf * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/UnitedKingdom/Wales/NewYearsDayTest.php b/tests/UnitedKingdom/Wales/NewYearsDayTest.php index a0eaa04de..66ff7ee26 100644 --- a/tests/UnitedKingdom/Wales/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Wales/NewYearsDayTest.php @@ -44,7 +44,7 @@ class NewYearsDayTest extends WalesBaseTestCase implements YasumiTestCaseInterfa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested + * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * * @throws ReflectionException diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index c6847b837..c4bbf4278 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -116,31 +116,6 @@ public function assertHoliday( $this->assertTrue($holidays->isHoliday($holiday)); } - /** - * Asserts that the given holiday for that given year does not exist. - * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName the short name of the holiday to be checked against - * @param int $year holiday calendar year - * - * @throws InvalidArgumentException - * @throws RuntimeException - * @throws UnknownLocaleException - * @throws InvalidDateException - * @throws AssertionFailedError - * @throws ReflectionException - */ - public function assertNotHoliday( - string $provider, - string $shortName, - int $year - ): void { - $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); - - $this->assertNull($holiday); - } - /** * Asserts that the expected date is indeed a substitute holiday for that given year and name * @@ -196,6 +171,31 @@ public function assertNotSubstituteHoliday( ); } + /** + * Asserts that the given holiday for that given year does not exist. + * + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $shortName the short name of the holiday to be checked against + * @param int $year holiday calendar year + * + * @throws InvalidArgumentException + * @throws RuntimeException + * @throws UnknownLocaleException + * @throws InvalidDateException + * @throws AssertionFailedError + * @throws ReflectionException + */ + public function assertNotHoliday( + string $provider, + string $shortName, + int $year + ): void { + $holidays = Yasumi::create($provider, $year); + $holiday = $holidays->getHoliday($shortName); + + $this->assertNull($holiday); + } + /** * Asserts that the expected name is indeed provided as a translated holiday name for that given year and name * From 45b873a8abbe3379afec206b095e47d6bd321583 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 10 May 2020 09:40:07 +0900 Subject: [PATCH 072/115] Reformatting and cleanup. --- .../Exception/MissingTranslationException.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 50 +++++++++---------- src/Yasumi/Provider/Ukraine.php | 26 +++++----- src/Yasumi/Yasumi.php | 2 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/Yasumi/Exception/MissingTranslationException.php b/src/Yasumi/Exception/MissingTranslationException.php index eac6f75ab..a967d18eb 100644 --- a/src/Yasumi/Exception/MissingTranslationException.php +++ b/src/Yasumi/Exception/MissingTranslationException.php @@ -23,7 +23,7 @@ class MissingTranslationException extends BaseException implements Exception * Initializes the Exception instance * * @param string $shortName The short name (internal name) of the holiday - * @param array $locales The locales that was searched + * @param array $locales The locales that was searched */ public function __construct(string $shortName, array $locales) { diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 618c0009c..5cddd4e42 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -196,31 +196,6 @@ public function isWorkingDay(\DateTimeInterface $date): bool return !$this->isHoliday($date) && !$this->isWeekendDay($date); } - /** - * Determines whether a date represents a weekend day or not. - * - * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, - * \DateTime) - * - * @return bool true if date represents a weekend day, otherwise false - * @throws InvalidDateException - * - */ - public function isWeekendDay(\DateTimeInterface $date): bool - { - // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. - if (\in_array( - (int)$date->format('w'), - self::WEEKEND_DATA[$this::ID] ?? [0, 6], - true - ) - ) { - return true; - } - - return false; - } - /** * Determines whether a date represents a holiday or not. * @@ -253,6 +228,31 @@ public function getHolidayDates(): array }, $this->holidays); } + /** + * Determines whether a date represents a weekend day or not. + * + * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, + * \DateTime) + * + * @return bool true if date represents a weekend day, otherwise false + * @throws InvalidDateException + * + */ + public function isWeekendDay(\DateTimeInterface $date): bool + { + // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. + if (\in_array( + (int)$date->format('w'), + self::WEEKEND_DATA[$this::ID] ?? [0, 6], + true + ) + ) { + return true; + } + + return false; + } + /** * On what date is the given holiday? * diff --git a/src/Yasumi/Provider/Ukraine.php b/src/Yasumi/Provider/Ukraine.php index 61b5bd2b6..4f31a96dd 100644 --- a/src/Yasumi/Provider/Ukraine.php +++ b/src/Yasumi/Provider/Ukraine.php @@ -254,19 +254,6 @@ private function calculateDefenderOfUkraineDay(): void )); } - /** - * @param int $year - * @param string $timezone - * - * @return \DateTime - * - * @throws \Exception - */ - public function calculateEaster(int $year, string $timezone): \DateTime - { - return $this->calculateOrthodoxEaster($year, $timezone); - } - /** * Catholic Christmas Day. * (since 2017 instead of International Workers' Day 2. May) @@ -297,4 +284,17 @@ private function calculateCatholicChristmasDay(): void false // Catholic Christmas Day will not be substituted to an monday if it's on a weekend! ); } + + /** + * @param int $year + * @param string $timezone + * + * @return \DateTime + * + * @throws \Exception + */ + public function calculateEaster(int $year, string $timezone): \DateTime + { + return $this->calculateOrthodoxEaster($year, $timezone); + } } diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index 019c73133..a6982f865 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -92,7 +92,7 @@ public static function nextWorkingDay( while ($workingDays > 0) { $date = $date->add(new \DateInterval('P1D')); - if (! $provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { + if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { $provider = self::create($class, (int)$date->format('Y')); } if ($provider->isWorkingDay($date)) { From cc262d07bbd0e5ac87e09f373ca219fdf0615410 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 10 May 2020 09:49:03 +0900 Subject: [PATCH 073/115] Moved Typography Test to Base folder (as part of all base tests). --- tests/{ => Base}/TypographyTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename tests/{ => Base}/TypographyTest.php (97%) diff --git a/tests/TypographyTest.php b/tests/Base/TypographyTest.php similarity index 97% rename from tests/TypographyTest.php rename to tests/Base/TypographyTest.php index ed767494c..5b8460ae1 100644 --- a/tests/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -11,9 +11,10 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests; +namespace Yasumi\tests\Base; use PHPUnit\Framework\TestCase; +use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; /** From fd72a4b957e456a5aa8fa635d1eb0d7e0a23337c Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 18 May 2020 22:18:55 +0900 Subject: [PATCH 074/115] Added news about new docs website --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d44a9af57..d64f32a1a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Logo](https://github.com/azuyalabs/yasumi/blob/gh-pages/images/yasumi_logo_wb.png) +![Logo](https://www.yasumi.dev/assets/img/yasumi_logo.svg) [![GitHub Release](https://img.shields.io/github/release/azuyalabs/yasumi.svg?style=flat-square)](https://github.com/azuyalabs/yasumi/releases) [![Total Downloads](https://img.shields.io/packagist/dt/azuyalabs/yasumi.svg?style=flat-square)](https://packagist.org/packages/azuyalabs/yasumi) @@ -7,6 +7,11 @@ [![StyleCI](https://styleci.io/repos/32797151/shield?branch=master)](https://styleci.io/repos/32797151) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/azuyalabs/yasumi/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/azuyalabs/yasumi/?branch=master) +Update! +------- +Yasumi has now its own domain https://yasumi.dev and a brand-new documentation website! +Thanks to the [Jigsaw](http://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](http://tailwindcss.com) brothers. Read more about it in this blog post: https://yasumi.dev/blog/new_docs_site… + Introduction ------------ Yasumi (Japanese for 'Holiday'「休み」) is an easy PHP library to help you calculate the dates and names of holidays and other From 0a786cb58219b777ca35f731c95d898d1bcb6d79 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 18 May 2020 22:30:57 +0900 Subject: [PATCH 075/115] Corrections --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d64f32a1a..e17ac39a0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Update! ------- Yasumi has now its own domain https://yasumi.dev and a brand-new documentation website! -Thanks to the [Jigsaw](http://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](http://tailwindcss.com) brothers. Read more about it in this blog post: https://yasumi.dev/blog/new_docs_site… +Thanks to the [Jigsaw](http://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](http://tailwindcss.com) brothers. Read more about it in this blog post: https://www.yasumi.dev/blog/new_docs_site + +Please don't forget to update your bookmarks! The documentation site at https://azuyalabs.github.io/yasumi/ will be removed soon. Introduction ------------ @@ -28,11 +30,11 @@ holidays. The methods of Yasumi can be used to get a holiday's date and name in Documentation ------------- -Yasumi’s documentation is available on [https://azuyalabs.github.io/yasumi/](https://azuyalabs.github.io/yasumi/). You will find all the necessary information how to install Yasumi and also recipes how you can use Yasumi in your project. +Yasumi’s documentation is available on [https://www.yasumi.dev](https://www.yasumi.dev). You will find all the necessary information how to install Yasumi and also recipes how you can use Yasumi in your project. Blog ---- -Checkout the [blog](https://azuyalabs.github.io/yasumi/blog/) section on documentation site regularly for latest updates. Keeping you informed about any news, releases, etc. in a handy blog post format! +Checkout the [blog](https://www.yasumi.dev/blog/) section on documentation site regularly for latest updates. Keeping you informed about any news, releases, etc. in a handy blog post format! ## Contributing From 07ae77156878fc2403a8102ef5fcfec4b87ae99f Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 18 May 2020 22:43:27 +0900 Subject: [PATCH 076/115] Updated links to proper Markdown ones. Signed-off-by: Sacha Telgenhof --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e17ac39a0..fc5d51840 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ Update! ------- -Yasumi has now its own domain https://yasumi.dev and a brand-new documentation website! -Thanks to the [Jigsaw](http://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](http://tailwindcss.com) brothers. Read more about it in this blog post: https://www.yasumi.dev/blog/new_docs_site +Yasumi has now its own domain [https://www.yasumi.dev](https://www.yasumi.dev) and a brand-new documentation website! +Thanks to the [Jigsaw](https://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](https://tailwindcss.com) brothers. Read more about it in this blog post: [https://www.yasumi.dev/blog/new_docs_site](https://www.yasumi.dev/blog/new_docs_site) -Please don't forget to update your bookmarks! The documentation site at https://azuyalabs.github.io/yasumi/ will be removed soon. +Please don't forget to update your bookmarks! The documentation site at [https://azuyalabs.github.io/yasumi/](https://azuyalabs.github.io/yasumi/) will be removed soon. Introduction ------------ @@ -24,7 +24,7 @@ are either not free or offer only limited information. In addition, no complete that covers a wide range of holidays and countries, except maybe [PEAR's Date_Holidays](https://pear.php.net/package/Date_Holidays) which unfortunately hasn't been updated for a long time. The goal of Yasumi is to be powerful while remaining lightweight, by utilizing PHP native classes wherever possible. -Yasumi's calculation is provider-based (i.e. by country/state) so it's easy to add new holiday providers that calculate +Yasumi's calculation is provider-based (i.e. by country/state), so it's easy to add new holiday providers that calculate holidays. The methods of Yasumi can be used to get a holiday's date and name in various languages. Documentation From 89d762450f09f7982cc5f089a3522a144cac6dea Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 24 May 2020 11:31:01 +0900 Subject: [PATCH 077/115] Updated the composer config with more information, including the new documentation website. --- composer.json | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 5d82961cc..6411c39da 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,16 @@ { "name": "azuyalabs/yasumi", - "description": "Yasumi is an easy PHP Library for calculating national holidays.", + "description": "The easy PHP Library for calculating holidays.", + "type": "library", + "authors": [ + { + "name": "Sacha Telgenhof", + "email": "me@sachatelgenhof.com", + "role": "Maintainer" + } + ], + "homepage": "https://www.yasumi.dev", + "license": "MIT", "keywords": [ "holiday", "holidays", @@ -12,11 +22,16 @@ "bank", "national" ], - "license": "MIT", - "authors": [ + "readme": "README.md", + "support": { + "issues": "https://github.com/azuyalabs/yasumi/issues", + "source": "https://github.com/azuyalabs/yasumi", + "docs": "https://www.yasumi.dev" + }, + "funding": [ { - "name": "Sacha Telgenhof", - "email": "me@sachatelgenhof.com" + "type": "other", + "url": "https://www.buymeacoffee.com/sachatelgenhof" } ], "require": { From a266fd7f80de9847839eab5abe993f766e954b63 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 31 May 2020 21:41:43 +0900 Subject: [PATCH 078/115] Removed new documentation website notification --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index fc5d51840..1e4a90016 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,6 @@ [![StyleCI](https://styleci.io/repos/32797151/shield?branch=master)](https://styleci.io/repos/32797151) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/azuyalabs/yasumi/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/azuyalabs/yasumi/?branch=master) -Update! -------- -Yasumi has now its own domain [https://www.yasumi.dev](https://www.yasumi.dev) and a brand-new documentation website! -Thanks to the [Jigsaw](https://jigsaw.tighten.co) documentation template created by the amazing [TightenCo](https://tighten.co) and [TailwindCSS](https://tailwindcss.com) brothers. Read more about it in this blog post: [https://www.yasumi.dev/blog/new_docs_site](https://www.yasumi.dev/blog/new_docs_site) - -Please don't forget to update your bookmarks! The documentation site at [https://azuyalabs.github.io/yasumi/](https://azuyalabs.github.io/yasumi/) will be removed soon. - Introduction ------------ Yasumi (Japanese for 'Holiday'「休み」) is an easy PHP library to help you calculate the dates and names of holidays and other From fed7f280856598553e09b927d8629f33c134daad Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 31 May 2020 21:46:39 +0900 Subject: [PATCH 079/115] Reworded introduction and added highlights --- README.md | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1e4a90016..d1cec8ec9 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,27 @@ Introduction ------------ -Yasumi (Japanese for 'Holiday'「休み」) is an easy PHP library to help you calculate the dates and names of holidays and other -special celebrations from various countries/states. +Yasumi (Japanese for 'Holiday'「休み」) is the easy PHP library that helps you retrieve the dates and names of holidays and other special celebrations from various countries/states. It is calculation and rule driven avoiding the need of a comprehensive database. + +Many services exist that can provide holiday information, however are either not entirely free or only offer limited information. In addition, no exhaustive PHP library exists today covering a wide range of holidays and countries. [PEAR's Date_Holidays](https://pear.php.net/package/Date_Holidays) library was a similar attempt, however it hasn't been updated for a long time. + +Highlights +---------- +The goal of Yasumi is to be powerful while remaining lightweight, by utilizing PHP native classes wherever possible. Yasumi's calculation is provider-based (i.e. by country/state), making it easy to add new holiday providers that calculate holidays. + +- Straightforward API +- Framework-agnostic +- Use of Providers to easily extend and expand new Holidays +- Common Holiday Providers +- Accounts for the date/time when holidays have been officially established and/or abolished +- Filters enabling to easily select certain holiday types (Official, Observed, Bank, Seasonal or Other) +- Global Translations +- Timezone aware +- Implements [ArrayIterator](https://www.php.net/manual/en/class.arrayiterator.php) to easily process a provider's holidays +- Fully documented +- Fully unit tested +- [Composer](https://getcomposer.org) ready, [PSR-2](https://www.php-fig.org/psr/psr-2/) and [PSR-4](https://www.php-fig.org/psr/psr-4/) compliant -Many services exist on the internet that provide holidays, however -are either not free or offer only limited information. In addition, no complete PHP library seems to exist today -that covers a wide range of holidays and countries, except maybe [PEAR's Date_Holidays](https://pear.php.net/package/Date_Holidays) which unfortunately hasn't been updated for a long time. - -The goal of Yasumi is to be powerful while remaining lightweight, by utilizing PHP native classes wherever possible. -Yasumi's calculation is provider-based (i.e. by country/state), so it's easy to add new holiday providers that calculate -holidays. The methods of Yasumi can be used to get a holiday's date and name in various languages. Documentation ------------- From a24d9f039b99a3958a259446d0f8ff62eef178d8 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 3 Jun 2020 09:07:38 +0900 Subject: [PATCH 080/115] Added American English spelling for Labour Day. --- CHANGELOG.md | 1 + src/Yasumi/data/translations/labourDay.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 315c2909d..4cca027ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) +- Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) diff --git a/src/Yasumi/data/translations/labourDay.php b/src/Yasumi/data/translations/labourDay.php index 53dea8d78..435745008 100644 --- a/src/Yasumi/data/translations/labourDay.php +++ b/src/Yasumi/data/translations/labourDay.php @@ -14,6 +14,7 @@ // Translations for Labour Day return [ 'en' => 'Labour Day', + 'en_US' => 'Labor Day', 'ja' => '労働の日', 'ko' => '노동절', 'nl' => 'Dag van de arbeid', From d1e2d6f40582a26b4cffdbd5fe9db9e52b2ba3a8 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 3 Jun 2020 09:13:42 +0900 Subject: [PATCH 081/115] Reordered the items to group similar subjects. --- CHANGELOG.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cca027ca..58692b633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,25 +9,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) +- Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) +- Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) +- Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) +- Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) -- Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) -- Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) -- Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). + - Added missing return (correct) and parameter types in various methods. -- Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) ### Changed -- Renamed the Australian states to be full names in stead of abbreviations to be in line with other Holiday Providers [\#214](https://github.com/azuyalabs/yasumi/pull/214) +- Renamed the Australian states to be full names instead of abbreviations to be in line with other Holiday Providers [\#214](https://github.com/azuyalabs/yasumi/pull/214) - Statehood Day is celebrated at a new date since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) - Independence Day is no longer an official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) - Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) - Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. [\#203](https://github.com/azuyalabs/yasumi/pull/203) ([krukru](https://github.com/krukru)) -- Second International Workers Day was an official holiday only until 2018. [\#202](https://github.com/azuyalabs/yasumi/pull/202) +- Second International Workers Day in Ukraine was an official holiday only until 2018. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. [\#185](https://github.com/azuyalabs/yasumi/pull/185) ([c960657](https://github.com/c960657)) -- Changed the fallback from DEFAULT_LANGUAGE to 'en'. [\#183](https://github.com/azuyalabs/yasumi/pull/183) ([c960657](https://github.com/c960657)) +- Changed the fallback from DEFAULT_LANGUAGE to 'en'. [\#183](https://github.com/azuyalabs/yasumi/pull/183) ([c960657](https://github.com/c960657)) - Introduced a DateTimeZoneFactory class to improve performance. This will keep a static reference to the instantiated DateTimezone, thus saving resources. [\#213](https://github.com/azuyalabs/yasumi/pull/213) ([pvgnd](https://github.com/pvgn)) - Changed DateTime to DateTimeImmutable as dates should be that: immutable (by default) - Explicitly set nullable parameters as such. From 8b41f8a105d9a8e44f3056e3cd97fcb4ba3cd145 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 08:53:05 +0900 Subject: [PATCH 082/115] Fixed translation test for Labour Day (since new spelling was added). --- tests/USA/LabourDayTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/USA/LabourDayTest.php b/tests/USA/LabourDayTest.php index 45b4b8234..022c980b0 100644 --- a/tests/USA/LabourDayTest.php +++ b/tests/USA/LabourDayTest.php @@ -73,7 +73,7 @@ public function testTranslation(): void self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Labour Day'] + [self::LOCALE => 'Labor Day'] ); } From 57fd1c4c22daf2c8b7e1473c89f84bdf7b24675b Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 08:55:14 +0900 Subject: [PATCH 083/115] Added missing return types and exceptions. --- tests/USA/ChristmasDayTest.php | 6 +++--- tests/USA/ColumbusDayTest.php | 6 +++--- tests/USA/IndependenceDayTest.php | 8 ++++---- tests/USA/LabourDayTest.php | 4 ++-- tests/USA/MartinLutherKingDayTest.php | 4 ++-- tests/USA/MemorialDayTest.php | 6 +++--- tests/USA/NewYearsDayTest.php | 6 +++--- tests/USA/ThanksgivingDayTest.php | 4 ++-- tests/USA/VeteransDayTest.php | 15 +++++++++------ tests/USA/WashingtonsBirthdayTest.php | 6 +++--- 10 files changed, 34 insertions(+), 31 deletions(-) diff --git a/tests/USA/ChristmasDayTest.php b/tests/USA/ChristmasDayTest.php index eb1ee27cc..955dcb297 100644 --- a/tests/USA/ChristmasDayTest.php +++ b/tests/USA/ChristmasDayTest.php @@ -34,7 +34,7 @@ class ChristmasDayTest extends USABaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testChristmasDay() + public function testChristmasDay(): void { $year = 2001; $this->assertHoliday( @@ -50,7 +50,7 @@ public function testChristmasDay() * @throws Exception * @throws ReflectionException */ - public function testChristmasDaySubstitutedMonday() + public function testChristmasDaySubstitutedMonday(): void { // Substituted Holiday on Monday (Christmas Day falls on Sunday) $year = 6101; @@ -67,7 +67,7 @@ public function testChristmasDaySubstitutedMonday() * @throws Exception * @throws ReflectionException */ - public function testChristmasDaySubstitutedFriday() + public function testChristmasDaySubstitutedFriday(): void { // Substituted Holiday on Friday (Christmas Day falls on Saturday) $year = 2060; diff --git a/tests/USA/ColumbusDayTest.php b/tests/USA/ColumbusDayTest.php index 54ecd54e5..e02eb3934 100644 --- a/tests/USA/ColumbusDayTest.php +++ b/tests/USA/ColumbusDayTest.php @@ -40,7 +40,7 @@ class ColumbusDayTest extends USABaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testColumbusDayOnAfter1970() + public function testColumbusDayOnAfter1970(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testColumbusDayOnAfter1970() * @throws Exception * @throws ReflectionException */ - public function testColumbusBetween1937And1969() + public function testColumbusBetween1937And1969(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1969); $this->assertHoliday( @@ -73,7 +73,7 @@ public function testColumbusBetween1937And1969() * the second Monday in October since 1970. * @throws ReflectionException */ - public function testColumbusDayBefore1937() + public function testColumbusDayBefore1937(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/IndependenceDayTest.php b/tests/USA/IndependenceDayTest.php index 018e75335..a65697346 100644 --- a/tests/USA/IndependenceDayTest.php +++ b/tests/USA/IndependenceDayTest.php @@ -39,7 +39,7 @@ class IndependenceDayTest extends USABaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testIndependenceDayOnAfter1776() + public function testIndependenceDayOnAfter1776(): void { $year = 1955; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testIndependenceDayOnAfter1776() * @throws Exception * @throws ReflectionException */ - public function testIndependenceDayOnAfter1776SubstitutedMonday() + public function testIndependenceDayOnAfter1776SubstitutedMonday(): void { $year = 3362; $this->assertHoliday( @@ -71,7 +71,7 @@ public function testIndependenceDayOnAfter1776SubstitutedMonday() * @throws Exception * @throws ReflectionException */ - public function testIndependenceDayOnAfter1776SubstitutedFriday() + public function testIndependenceDayOnAfter1776SubstitutedFriday(): void { $year = 8291; $this->assertHoliday( @@ -86,7 +86,7 @@ public function testIndependenceDayOnAfter1776SubstitutedFriday() * Tests Independence Day before 1776. Independence Day is celebrated since 1776 on July 4th. * @throws ReflectionException */ - public function testIndependenceDayBefore1776() + public function testIndependenceDayBefore1776(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/LabourDayTest.php b/tests/USA/LabourDayTest.php index 022c980b0..623f4bd75 100644 --- a/tests/USA/LabourDayTest.php +++ b/tests/USA/LabourDayTest.php @@ -39,7 +39,7 @@ class LabourDayTest extends USABaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testLabourDayOnAfter1887() + public function testLabourDayOnAfter1887(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testLabourDayOnAfter1887() * Tests Labour Day before 1887. Labour Day was established since 1887 on the first Monday of September. * @throws ReflectionException */ - public function testLabourDayBefore1887() + public function testLabourDayBefore1887(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/MartinLutherKingDayTest.php b/tests/USA/MartinLutherKingDayTest.php index 46c93d2f2..d9427ba07 100644 --- a/tests/USA/MartinLutherKingDayTest.php +++ b/tests/USA/MartinLutherKingDayTest.php @@ -40,7 +40,7 @@ class MartinLutherKingDayTest extends USABaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testMartinLutherKingDayOnAfter1986() + public function testMartinLutherKingDayOnAfter1986(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -56,7 +56,7 @@ public function testMartinLutherKingDayOnAfter1986() * Monday of January. * @throws ReflectionException */ - public function testMartinLutherKingDayBefore1986() + public function testMartinLutherKingDayBefore1986(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/MemorialDayTest.php b/tests/USA/MemorialDayTest.php index 17a95fde4..bc8b83963 100644 --- a/tests/USA/MemorialDayTest.php +++ b/tests/USA/MemorialDayTest.php @@ -40,7 +40,7 @@ class MemorialDayTest extends USABaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testMemorialDayOnAfter1968() + public function testMemorialDayOnAfter1968(): void { $year = $this->generateRandomYear(1968); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testMemorialDayOnAfter1968() * @throws Exception * @throws ReflectionException */ - public function testMemorialDayBetween1865And1967() + public function testMemorialDayBetween1865And1967(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1967); $this->assertHoliday( @@ -73,7 +73,7 @@ public function testMemorialDayBetween1865And1967() * last Monday in May. * @throws ReflectionException */ - public function testMemorialDayBefore1865() + public function testMemorialDayBefore1865(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/NewYearsDayTest.php b/tests/USA/NewYearsDayTest.php index 78f54ca45..90f9aa071 100644 --- a/tests/USA/NewYearsDayTest.php +++ b/tests/USA/NewYearsDayTest.php @@ -34,7 +34,7 @@ class NewYearsDayTest extends USABaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testNewYearsDay() + public function testNewYearsDay(): void { $year = 1997; $this->assertHoliday( @@ -50,7 +50,7 @@ public function testNewYearsDay() * @throws Exception * @throws ReflectionException */ - public function testNewYearsDaySubstitutedMonday() + public function testNewYearsDaySubstitutedMonday(): void { $year = 2445; $this->assertHoliday( @@ -66,7 +66,7 @@ public function testNewYearsDaySubstitutedMonday() * @throws Exception * @throws ReflectionException */ - public function testNewYearsDaySubstitutedFriday() + public function testNewYearsDaySubstitutedFriday(): void { $year = 1938; $subYear = $year - 1; diff --git a/tests/USA/ThanksgivingDayTest.php b/tests/USA/ThanksgivingDayTest.php index b49a23af1..5581dc216 100644 --- a/tests/USA/ThanksgivingDayTest.php +++ b/tests/USA/ThanksgivingDayTest.php @@ -40,7 +40,7 @@ class ThanksgivingDayTest extends USABaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testThanksgivingDayOnAfter1863() + public function testThanksgivingDayOnAfter1863(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -56,7 +56,7 @@ public function testThanksgivingDayOnAfter1863() * of November. * @throws ReflectionException */ - public function testThanksgivingDayBefore1863() + public function testThanksgivingDayBefore1863(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/USA/VeteransDayTest.php b/tests/USA/VeteransDayTest.php index 1e20de9d2..eaf072736 100644 --- a/tests/USA/VeteransDayTest.php +++ b/tests/USA/VeteransDayTest.php @@ -16,6 +16,7 @@ use DateTimeZone; use Exception; use ReflectionException; +use Yasumi\Exception\MissingTranslationException; use Yasumi\Holiday; use Yasumi\tests\YasumiTestCaseInterface; use Yasumi\Yasumi; @@ -40,7 +41,7 @@ class VeteransDayTest extends USABaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testVeteransDayOnAfter1919() + public function testVeteransDayOnAfter1919(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -56,7 +57,7 @@ public function testVeteransDayOnAfter1919() * @throws Exception * @throws ReflectionException */ - public function testVeteransDayOnAfter1919SubstitutedMonday() + public function testVeteransDayOnAfter1919SubstitutedMonday(): void { $year = 2018; $this->assertHoliday( @@ -72,7 +73,7 @@ public function testVeteransDayOnAfter1919SubstitutedMonday() * @throws Exception * @throws ReflectionException */ - public function testVeteransDayOnAfter1919SubstitutedFriday() + public function testVeteransDayOnAfter1919SubstitutedFriday(): void { $year = 2017; $this->assertHoliday( @@ -87,7 +88,7 @@ public function testVeteransDayOnAfter1919SubstitutedFriday() * Tests Veterans Day before 1919. Veterans Day was established in 1919 on November 11. * @throws ReflectionException */ - public function testVeteransDayBefore1919() + public function testVeteransDayBefore1919(): void { $this->assertNotHoliday( self::REGION, @@ -99,8 +100,9 @@ public function testVeteransDayBefore1919() /** * Tests name of Veterans Day before 1954. Veterans Day was named 'Armistice Day' before 1954. * @throws ReflectionException + * @throws MissingTranslationException */ - public function testVeteransDayNameBefore1954() + public function testVeteransDayNameBefore1954(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1953); @@ -112,8 +114,9 @@ public function testVeteransDayNameBefore1954() /** * Tests name of Veterans Day after 1954. Veterans Day was named 'Armistice Day' before 1954. * @throws ReflectionException + * @throws MissingTranslationException */ - public function testVeteransDayNameAfter1954() + public function testVeteransDayNameAfter1954(): void { $year = $this->generateRandomYear(1954); diff --git a/tests/USA/WashingtonsBirthdayTest.php b/tests/USA/WashingtonsBirthdayTest.php index 1001502fa..17c677870 100644 --- a/tests/USA/WashingtonsBirthdayTest.php +++ b/tests/USA/WashingtonsBirthdayTest.php @@ -40,7 +40,7 @@ class WashingtonsBirthdayTest extends USABaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testWashingtonsBirthdayOnAfter1968() + public function testWashingtonsBirthdayOnAfter1968(): void { $year = $this->generateRandomYear(1968); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testWashingtonsBirthdayOnAfter1968() * @throws Exception * @throws ReflectionException */ - public function testWashingtonsBirthdayBetween1879And1967() + public function testWashingtonsBirthdayBetween1879And1967(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1967); $this->assertHoliday( @@ -73,7 +73,7 @@ public function testWashingtonsBirthdayBetween1879And1967() * changed in 1968 to the third Monday in February. * @throws ReflectionException */ - public function testWashingtonsBirthdayBefore1879() + public function testWashingtonsBirthdayBefore1879(): void { $this->assertNotHoliday( self::REGION, From 8031c1b180dc8b345309e1e3a6ac9c4181497b2d Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 09:05:10 +0900 Subject: [PATCH 084/115] Added missing return types and corrected docblock comments (exceptions, signature). --- tests/Ukraine/CatholicChristmasDayTest.php | 4 ++-- tests/Ukraine/ChristmasDayTest.php | 2 +- tests/Ukraine/ConstitutionDayTest.php | 2 +- tests/Ukraine/DefenderOfUkraineDayTest.php | 2 +- tests/Ukraine/EasterTest.php | 2 +- tests/Ukraine/IndependenceDayTest.php | 2 +- tests/Ukraine/InternationalWomensDayTest.php | 2 +- tests/Ukraine/InternationalWorkersDayTest.php | 2 +- tests/Ukraine/NewYearsDayTest.php | 2 +- tests/Ukraine/PentecostTest.php | 2 +- tests/Ukraine/SecondInternationalWorkersDayTest.php | 6 +++--- tests/Ukraine/SubstitutedHolidayTest.php | 13 ++++++++----- tests/Ukraine/VictoryDayTest.php | 2 +- tests/UnitedKingdom/BoxingDayTest.php | 2 +- tests/UnitedKingdom/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/EasterMondayTest.php | 2 +- tests/UnitedKingdom/England/BoxingDayTest.php | 2 +- tests/UnitedKingdom/England/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/England/EasterMondayTest.php | 2 +- tests/UnitedKingdom/England/GoodFridayTest.php | 2 +- .../UnitedKingdom/England/MayDayBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/England/NewYearsDayTest.php | 6 +++--- .../UnitedKingdom/England/SpringBankHolidayTest.php | 6 +++--- .../UnitedKingdom/England/SummerBankHolidayTest.php | 8 ++++---- tests/UnitedKingdom/GoodFridayTest.php | 2 +- tests/UnitedKingdom/MayDayBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/NewYearsDayTest.php | 6 +++--- .../NorthernIreland/BattleOfTheBoyneTest.php | 4 ++-- .../UnitedKingdom/NorthernIreland/BoxingDayTest.php | 2 +- .../NorthernIreland/ChristmasDayTest.php | 2 +- .../NorthernIreland/EasterMondayTest.php | 2 +- .../NorthernIreland/GoodFridayTest.php | 2 +- .../NorthernIreland/MayDayBankHolidayTest.php | 6 +++--- .../NorthernIreland/NewYearsDayTest.php | 6 +++--- .../NorthernIreland/SpringBankHolidayTest.php | 4 ++-- .../NorthernIreland/StPatricksDayTest.php | 4 ++-- .../NorthernIreland/SummerBankHolidayTest.php | 8 ++++---- tests/UnitedKingdom/Scotland/BoxingDayTest.php | 2 +- tests/UnitedKingdom/Scotland/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/Scotland/GoodFridayTest.php | 2 +- .../Scotland/MayDayBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/Scotland/NewYearsDayTest.php | 6 +++--- .../Scotland/SecondNewYearsDayTest.php | 6 +++--- .../Scotland/SpringBankHolidayTest.php | 4 ++-- tests/UnitedKingdom/Scotland/StAndrewsDayTest.php | 2 +- .../Scotland/SummerBankHolidayTest.php | 4 ++-- tests/UnitedKingdom/SpringBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/SummerBankHolidayTest.php | 8 ++++---- tests/UnitedKingdom/Wales/BoxingDayTest.php | 2 +- tests/UnitedKingdom/Wales/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/Wales/EasterMondayTest.php | 2 +- tests/UnitedKingdom/Wales/GoodFridayTest.php | 2 +- tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/Wales/NewYearsDayTest.php | 6 +++--- tests/UnitedKingdom/Wales/SpringBankHolidayTest.php | 6 +++--- tests/UnitedKingdom/Wales/SummerBankHolidayTest.php | 8 ++++---- 56 files changed, 111 insertions(+), 108 deletions(-) diff --git a/tests/Ukraine/CatholicChristmasDayTest.php b/tests/Ukraine/CatholicChristmasDayTest.php index 6f2018a1e..71a4860ca 100644 --- a/tests/Ukraine/CatholicChristmasDayTest.php +++ b/tests/Ukraine/CatholicChristmasDayTest.php @@ -41,7 +41,7 @@ class CatholicChristmasDayTest extends UkraineBaseTestCase implements YasumiTest * * @throws ReflectionException */ - public function testCatholicChristmasDay($year, $expected) + public function testCatholicChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -50,7 +50,7 @@ public function testCatholicChristmasDay($year, $expected) * Tests Catholic Christmas Day before 2017. * @throws ReflectionException */ - public function testNoCatholicChristmasDayBefore2017() + public function testNoCatholicChristmasDayBefore2017(): void { $year = $this->generateRandomYear(null, 2016); $holidays = Yasumi::create(self::REGION, $year); diff --git a/tests/Ukraine/ChristmasDayTest.php b/tests/Ukraine/ChristmasDayTest.php index 1962c2507..8173acf4c 100644 --- a/tests/Ukraine/ChristmasDayTest.php +++ b/tests/Ukraine/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends UkraineBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Ukraine/ConstitutionDayTest.php b/tests/Ukraine/ConstitutionDayTest.php index 6d1f4d726..15fa4ce84 100644 --- a/tests/Ukraine/ConstitutionDayTest.php +++ b/tests/Ukraine/ConstitutionDayTest.php @@ -34,7 +34,7 @@ class ConstitutionDayTest extends UkraineBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Ukraine/DefenderOfUkraineDayTest.php b/tests/Ukraine/DefenderOfUkraineDayTest.php index c64d9fc71..e0001bb5f 100644 --- a/tests/Ukraine/DefenderOfUkraineDayTest.php +++ b/tests/Ukraine/DefenderOfUkraineDayTest.php @@ -34,7 +34,7 @@ class DefenderOfUkraineDayTest extends UkraineBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Ukraine/EasterTest.php b/tests/Ukraine/EasterTest.php index 4109ad262..f2cb6da60 100644 --- a/tests/Ukraine/EasterTest.php +++ b/tests/Ukraine/EasterTest.php @@ -35,7 +35,7 @@ class EasterTest extends UkraineBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Ukraine/IndependenceDayTest.php b/tests/Ukraine/IndependenceDayTest.php index 5fb14830b..5b026c9a3 100644 --- a/tests/Ukraine/IndependenceDayTest.php +++ b/tests/Ukraine/IndependenceDayTest.php @@ -34,7 +34,7 @@ class IndependenceDayTest extends UkraineBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Ukraine/InternationalWomensDayTest.php b/tests/Ukraine/InternationalWomensDayTest.php index f836bf78d..74bd14da1 100644 --- a/tests/Ukraine/InternationalWomensDayTest.php +++ b/tests/Ukraine/InternationalWomensDayTest.php @@ -37,7 +37,7 @@ class InternationalWomensDayTest extends UkraineBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Ukraine/InternationalWorkersDayTest.php b/tests/Ukraine/InternationalWorkersDayTest.php index 9ca189e68..39d9bd4a6 100644 --- a/tests/Ukraine/InternationalWorkersDayTest.php +++ b/tests/Ukraine/InternationalWorkersDayTest.php @@ -39,7 +39,7 @@ class InternationalWorkersDayTest extends UkraineBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Ukraine/NewYearsDayTest.php b/tests/Ukraine/NewYearsDayTest.php index a85b80411..b865911d3 100644 --- a/tests/Ukraine/NewYearsDayTest.php +++ b/tests/Ukraine/NewYearsDayTest.php @@ -39,7 +39,7 @@ class NewYearsDayTest extends UkraineBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Ukraine/PentecostTest.php b/tests/Ukraine/PentecostTest.php index 2f92be712..b53bfde9e 100644 --- a/tests/Ukraine/PentecostTest.php +++ b/tests/Ukraine/PentecostTest.php @@ -35,7 +35,7 @@ class PentecostTest extends UkraineBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Ukraine/SecondInternationalWorkersDayTest.php b/tests/Ukraine/SecondInternationalWorkersDayTest.php index 9fff35ba3..0afac4b53 100644 --- a/tests/Ukraine/SecondInternationalWorkersDayTest.php +++ b/tests/Ukraine/SecondInternationalWorkersDayTest.php @@ -40,7 +40,7 @@ class SecondInternationalWorkersDayTest extends UkraineBaseTestCase implements Y * * @throws ReflectionException */ - public function testSecondInternationalWorkersDay($year, $expected) + public function testSecondInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -49,7 +49,7 @@ public function testSecondInternationalWorkersDay($year, $expected) * Tests International Workers' Day since 2018. * @throws ReflectionException */ - public function testNoSecondInternationalWorkersDaySince2018() + public function testNoSecondInternationalWorkersDaySince2018(): void { $year = $this->generateRandomYear(2018); $holidays = Yasumi::create(self::REGION, $year); @@ -92,7 +92,7 @@ public function testHolidayType(): void * Returns a list of random test dates used for assertion of International Workers' Day. * * @return array list of test dates for International Workers' Day - * @throws Exception + * @throws \Exception */ public function SecondInternationalWorkersDayDataProvider(): array { diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index 18b7b000f..582825e82 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -16,7 +16,12 @@ use DateTime; use DateTimeZone; use Exception; +use InvalidArgumentException; +use PHPUnit\Framework\AssertionFailedError; use ReflectionException; +use RuntimeException; +use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; use Yasumi\tests\YasumiTestCaseInterface; @@ -33,7 +38,7 @@ class SubstitutedHolidayTest extends UkraineBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testSaturdaySubstitution() + public function testSaturdaySubstitution(): void { // 2020-05-09 victoryDay (День перемоги) $year = 2020; @@ -56,8 +61,8 @@ public function testSaturdaySubstitution() * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested * @param string $shortName string the short name of the holiday to be checked against * @param int $year holiday calendar year - * @param DateTime $expected the official date to be checked against - * @param DateTime $expected the substituted date to be checked against + * @param DateTime $expectedOfficial the official date to be checked against + * @param DateTime $expectedSubstitution the substituted date to be checked against * * @throws UnknownLocaleException * @throws InvalidDateException @@ -166,7 +171,6 @@ public function testCatholicChristmasDayNoSubstitution(): void /** * Dummy: Tests the translated name of the holiday defined in this test. - * @throws ReflectionException */ public function testTranslation(): void { @@ -175,7 +179,6 @@ public function testTranslation(): void /** * Dummy: Tests type of the holiday defined in this test. - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Ukraine/VictoryDayTest.php b/tests/Ukraine/VictoryDayTest.php index b62469e18..16b16af92 100644 --- a/tests/Ukraine/VictoryDayTest.php +++ b/tests/Ukraine/VictoryDayTest.php @@ -37,7 +37,7 @@ class VictoryDayTest extends UkraineBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/UnitedKingdom/BoxingDayTest.php b/tests/UnitedKingdom/BoxingDayTest.php index 8dccbdb76..181b0404d 100644 --- a/tests/UnitedKingdom/BoxingDayTest.php +++ b/tests/UnitedKingdom/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends UnitedKingdomBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/ChristmasDayTest.php b/tests/UnitedKingdom/ChristmasDayTest.php index cc4e5a6d8..9ec2e039c 100644 --- a/tests/UnitedKingdom/ChristmasDayTest.php +++ b/tests/UnitedKingdom/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends UnitedKingdomBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/EasterMondayTest.php b/tests/UnitedKingdom/EasterMondayTest.php index 29cc843d6..1354746b7 100644 --- a/tests/UnitedKingdom/EasterMondayTest.php +++ b/tests/UnitedKingdom/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends UnitedKingdomBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/UnitedKingdom/England/BoxingDayTest.php b/tests/UnitedKingdom/England/BoxingDayTest.php index fbdca605c..7290b330c 100644 --- a/tests/UnitedKingdom/England/BoxingDayTest.php +++ b/tests/UnitedKingdom/England/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends EnglandBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/England/ChristmasDayTest.php b/tests/UnitedKingdom/England/ChristmasDayTest.php index 883bf3d31..09972d34c 100644 --- a/tests/UnitedKingdom/England/ChristmasDayTest.php +++ b/tests/UnitedKingdom/England/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends EnglandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/England/EasterMondayTest.php b/tests/UnitedKingdom/England/EasterMondayTest.php index 56a78fe36..4dbe2ba9f 100644 --- a/tests/UnitedKingdom/England/EasterMondayTest.php +++ b/tests/UnitedKingdom/England/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends EnglandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/UnitedKingdom/England/GoodFridayTest.php b/tests/UnitedKingdom/England/GoodFridayTest.php index 83bd3361b..445ab79f5 100644 --- a/tests/UnitedKingdom/England/GoodFridayTest.php +++ b/tests/UnitedKingdom/England/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends EnglandBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/UnitedKingdom/England/MayDayBankHolidayTest.php b/tests/UnitedKingdom/England/MayDayBankHolidayTest.php index 9742333e6..97c3ef79e 100644 --- a/tests/UnitedKingdom/England/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/England/MayDayBankHolidayTest.php @@ -40,7 +40,7 @@ class MayDayBankHolidayTest extends EnglandBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2101; $this->assertHoliday( @@ -57,7 +57,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayExceptions() + public function testHolidayExceptions(): void { $this->assertHoliday( self::REGION, @@ -78,7 +78,7 @@ public function testHolidayExceptions() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/England/NewYearsDayTest.php b/tests/UnitedKingdom/England/NewYearsDayTest.php index 6b70c42ec..f79c09f02 100644 --- a/tests/UnitedKingdom/England/NewYearsDayTest.php +++ b/tests/UnitedKingdom/England/NewYearsDayTest.php @@ -50,7 +50,7 @@ class NewYearsDayTest extends EnglandBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $this->assertHoliday( self::REGION, @@ -64,7 +64,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/England/SpringBankHolidayTest.php b/tests/UnitedKingdom/England/SpringBankHolidayTest.php index ca5438621..92eae3a00 100644 --- a/tests/UnitedKingdom/England/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/England/SpringBankHolidayTest.php @@ -40,7 +40,7 @@ class SpringBankHolidayTest extends EnglandBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( @@ -57,7 +57,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayException() + public function testHolidayException(): void { $this->assertHoliday( self::REGION, @@ -78,7 +78,7 @@ public function testHolidayException() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/England/SummerBankHolidayTest.php b/tests/UnitedKingdom/England/SummerBankHolidayTest.php index 2a8261317..702f5ff0b 100644 --- a/tests/UnitedKingdom/England/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/England/SummerBankHolidayTest.php @@ -42,7 +42,7 @@ class SummerBankHolidayTest extends EnglandBaseTestCase implements YasumiTestCas * @throws \Exception * @throws \ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -59,7 +59,7 @@ public function testHoliday() * @throws \Exception * @throws \ReflectionException */ - public function testHolidayBefore1965() + public function testHolidayBefore1965(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1964); $this->assertHoliday( @@ -76,7 +76,7 @@ public function testHolidayBefore1965() * @throws \ReflectionException * @throws \Exception */ - public function testHolidayTrialPeriod() + public function testHolidayTrialPeriod(): void { $this->assertHoliday( self::REGION, @@ -120,7 +120,7 @@ public function testHolidayTrialPeriod() * Tests the holiday defined in this test before establishment. * @throws \ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/GoodFridayTest.php b/tests/UnitedKingdom/GoodFridayTest.php index 4373f02a7..1559199ad 100644 --- a/tests/UnitedKingdom/GoodFridayTest.php +++ b/tests/UnitedKingdom/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends UnitedKingdomBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/UnitedKingdom/MayDayBankHolidayTest.php b/tests/UnitedKingdom/MayDayBankHolidayTest.php index 40011dfcf..5702b6728 100644 --- a/tests/UnitedKingdom/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/MayDayBankHolidayTest.php @@ -39,7 +39,7 @@ class MayDayBankHolidayTest extends UnitedKingdomBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2101; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayExceptions() + public function testHolidayExceptions(): void { $this->assertHoliday( self::REGION, @@ -76,7 +76,7 @@ public function testHolidayExceptions() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NewYearsDayTest.php b/tests/UnitedKingdom/NewYearsDayTest.php index e8760c6d2..6218005d2 100644 --- a/tests/UnitedKingdom/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NewYearsDayTest.php @@ -50,7 +50,7 @@ class NewYearsDayTest extends UnitedKingdomBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $this->assertHoliday( self::REGION, @@ -64,7 +64,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php index f8616044e..1c47c9c09 100644 --- a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php @@ -45,7 +45,7 @@ class BattleOfTheBoyneTest extends NorthernIrelandBaseTestCase implements Yasumi * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -60,7 +60,7 @@ public function testHoliday($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php index 46943a1db..7312e57fb 100644 --- a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends NorthernIrelandBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php index a5479b8e6..c9921a3e7 100644 --- a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends NorthernIrelandBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php index bd12f03e5..97b3da14c 100644 --- a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends NorthernIrelandBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php b/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php index 4c9c59c62..21f94e0da 100644 --- a/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends NorthernIrelandBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php index 8062b2713..c95392da9 100644 --- a/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php @@ -39,7 +39,7 @@ class MayDayBankHolidayTest extends NorthernIrelandBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2101; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayExceptions() + public function testHolidayExceptions(): void { $this->assertHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayExceptions() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php index e73c24fd5..4e3a27bbe 100644 --- a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php @@ -50,7 +50,7 @@ class NewYearsDayTest extends NorthernIrelandBaseTestCase implements YasumiTestC * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $this->assertHoliday( self::REGION, @@ -64,7 +64,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php index 13114a3be..03216cfa8 100644 --- a/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php @@ -39,7 +39,7 @@ class SpringBankHolidayTest extends NorthernIrelandBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php index 0f76150ab..7fb29f2cd 100644 --- a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php @@ -45,7 +45,7 @@ class StPatricksDayTest extends NorthernIrelandBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -60,7 +60,7 @@ public function testHoliday($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php index b87101907..8a1ad96d1 100644 --- a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php @@ -44,7 +44,7 @@ class SummerBankHolidayTest extends NorthernIrelandBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -61,7 +61,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayBefore1965() + public function testHolidayBefore1965(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1964); $this->assertHoliday( @@ -77,7 +77,7 @@ public function testHolidayBefore1965() * @throws ReflectionException * @throws Exception */ - public function testHolidayTrialPeriod() + public function testHolidayTrialPeriod(): void { $this->assertHoliday( self::REGION, @@ -121,7 +121,7 @@ public function testHolidayTrialPeriod() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Scotland/BoxingDayTest.php b/tests/UnitedKingdom/Scotland/BoxingDayTest.php index 741ea6a9b..96b4fac23 100644 --- a/tests/UnitedKingdom/Scotland/BoxingDayTest.php +++ b/tests/UnitedKingdom/Scotland/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php index 9ba0c4605..6e2d3b63e 100644 --- a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/Scotland/GoodFridayTest.php b/tests/UnitedKingdom/Scotland/GoodFridayTest.php index 50764e76d..d6c99d868 100644 --- a/tests/UnitedKingdom/Scotland/GoodFridayTest.php +++ b/tests/UnitedKingdom/Scotland/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends ScotlandBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php b/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php index b3a11a575..7abf4728e 100644 --- a/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php @@ -40,7 +40,7 @@ class MayDayBankHolidayTest extends ScotlandBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2101; $this->assertHoliday( @@ -57,7 +57,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayExceptions() + public function testHolidayExceptions(): void { $this->assertHoliday( self::REGION, @@ -78,7 +78,7 @@ public function testHolidayExceptions() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php index bc5faea1c..3e0543df9 100644 --- a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php @@ -51,7 +51,7 @@ class NewYearsDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -66,7 +66,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -79,7 +79,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php index c218feb4c..61974046f 100644 --- a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php @@ -51,7 +51,7 @@ class SecondNewYearsDayTest extends ScotlandBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -66,7 +66,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -79,7 +79,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php index f45771922..8c0546d3c 100644 --- a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php @@ -39,7 +39,7 @@ class SpringBankHolidayTest extends ScotlandBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php index 693416ca9..485238170 100644 --- a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php +++ b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php @@ -45,7 +45,7 @@ class StAndrewsDayTest extends ScotlandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php index 54957ddfa..1a81e97b4 100644 --- a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php @@ -39,7 +39,7 @@ class SummerBankHolidayTest extends ScotlandBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/SpringBankHolidayTest.php b/tests/UnitedKingdom/SpringBankHolidayTest.php index 3235e79a1..e80a00124 100644 --- a/tests/UnitedKingdom/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/SpringBankHolidayTest.php @@ -39,7 +39,7 @@ class SpringBankHolidayTest extends UnitedKingdomBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayException() + public function testHolidayException(): void { $this->assertHoliday( self::REGION, @@ -76,7 +76,7 @@ public function testHolidayException() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/SummerBankHolidayTest.php b/tests/UnitedKingdom/SummerBankHolidayTest.php index f016d4c6c..3932adc2d 100644 --- a/tests/UnitedKingdom/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/SummerBankHolidayTest.php @@ -44,7 +44,7 @@ class SummerBankHolidayTest extends UnitedKingdomBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -60,7 +60,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayBefore1965() + public function testHolidayBefore1965(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1964); $this->assertHoliday( @@ -76,7 +76,7 @@ public function testHolidayBefore1965() * @throws ReflectionException * @throws Exception */ - public function testHolidayTrialPeriod() + public function testHolidayTrialPeriod(): void { $this->assertHoliday( self::REGION, @@ -120,7 +120,7 @@ public function testHolidayTrialPeriod() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Wales/BoxingDayTest.php b/tests/UnitedKingdom/Wales/BoxingDayTest.php index 950700c2c..2c5fedd22 100644 --- a/tests/UnitedKingdom/Wales/BoxingDayTest.php +++ b/tests/UnitedKingdom/Wales/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends WalesBaseTestCase implements YasumiTestCaseInterface * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/Wales/ChristmasDayTest.php b/tests/UnitedKingdom/Wales/ChristmasDayTest.php index 893d8d39c..4204a2b5a 100644 --- a/tests/UnitedKingdom/Wales/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Wales/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends WalesBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/UnitedKingdom/Wales/EasterMondayTest.php b/tests/UnitedKingdom/Wales/EasterMondayTest.php index ff34e9149..497bd6d94 100644 --- a/tests/UnitedKingdom/Wales/EasterMondayTest.php +++ b/tests/UnitedKingdom/Wales/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends WalesBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Wales/GoodFridayTest.php b/tests/UnitedKingdom/Wales/GoodFridayTest.php index 7d0c4f681..8bfb596bd 100644 --- a/tests/UnitedKingdom/Wales/GoodFridayTest.php +++ b/tests/UnitedKingdom/Wales/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends WalesBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php b/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php index d0962550c..98ca5e67b 100644 --- a/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php @@ -40,7 +40,7 @@ class MayDayBankHolidayTest extends WalesBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2101; $this->assertHoliday( @@ -57,7 +57,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayExceptions() + public function testHolidayExceptions(): void { $this->assertHoliday( self::REGION, @@ -78,7 +78,7 @@ public function testHolidayExceptions() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Wales/NewYearsDayTest.php b/tests/UnitedKingdom/Wales/NewYearsDayTest.php index 66ff7ee26..5980f2f61 100644 --- a/tests/UnitedKingdom/Wales/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Wales/NewYearsDayTest.php @@ -50,7 +50,7 @@ class NewYearsDayTest extends WalesBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment($year, $expected) + public function testHolidayOnAfterEstablishment($year, $expected): void { $this->assertHoliday( self::REGION, @@ -64,7 +64,7 @@ public function testHolidayOnAfterEstablishment($year, $expected) * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayBeforeEstablishment() * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * @throws ReflectionException */ - public function testHolidayIsObservedTypeBeforeChange() + public function testHolidayIsObservedTypeBeforeChange(): void { $this->assertHolidayType( self::REGION, diff --git a/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php b/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php index b1d9e0f6b..5ee770eb8 100644 --- a/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php @@ -39,7 +39,7 @@ class SpringBankHolidayTest extends WalesBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayException() + public function testHolidayException(): void { $this->assertHoliday( self::REGION, @@ -77,7 +77,7 @@ public function testHolidayException() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php b/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php index 0d5a89572..49ee0b703 100644 --- a/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php @@ -44,7 +44,7 @@ class SummerBankHolidayTest extends WalesBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(1970); $this->assertHoliday( @@ -61,7 +61,7 @@ public function testHoliday() * @throws ReflectionException * @throws Exception */ - public function testHolidayBefore1965() + public function testHolidayBefore1965(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1964); $this->assertHoliday( @@ -78,7 +78,7 @@ public function testHolidayBefore1965() * @throws ReflectionException * @throws Exception */ - public function testHolidayTrialPeriod() + public function testHolidayTrialPeriod(): void { $this->assertHoliday( self::REGION, @@ -122,7 +122,7 @@ public function testHolidayTrialPeriod() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, From ec46cb708e86ba3f84f3984824fee73d80853cce Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 09:09:40 +0900 Subject: [PATCH 085/115] Added missing return types. --- tests/Spain/AllSaintsDayTest.php | 2 +- tests/Spain/Andalusia/AndalusiaDayTest.php | 4 ++-- tests/Spain/Aragon/StGeorgesDayTest.php | 2 +- tests/Spain/AssumptionOfMaryTest.php | 2 +- tests/Spain/Asturias/AsturiasDayTest.php | 4 ++-- tests/Spain/BalearicIslands/BalearicIslandsDayTest.php | 4 ++-- tests/Spain/BasqueCountry/BasqueCountryDayTest.php | 6 +++--- tests/Spain/CanaryIslands/CanaryIslandsDayTest.php | 4 ++-- tests/Spain/Cantabria/CantabriaDayTest.php | 4 ++-- tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php | 4 ++-- .../Spain/CastillaLaMancha/CastillaLaManchaDayTest.php | 4 ++-- tests/Spain/Catalonia/nationalCataloniaDayTest.php | 4 ++-- tests/Spain/Catalonia/stJohnsDayTest.php | 2 +- tests/Spain/Ceuta/ceutaDayTest.php | 4 ++-- tests/Spain/ChristmasTest.php | 2 +- .../CommunityOfMadrid/DosdeMayoUprisingDayTest.php | 2 +- tests/Spain/ConstitutionDayTest.php | 4 ++-- tests/Spain/EasterMondayTest.php | 2 +- tests/Spain/EpiphanyTest.php | 2 +- tests/Spain/Extremadura/ExtremaduraDayTest.php | 4 ++-- tests/Spain/Galicia/GalicianLiteratureDayTest.php | 4 ++-- tests/Spain/Galicia/stJamesDayTest.php | 4 ++-- tests/Spain/GoodFridayTest.php | 2 +- tests/Spain/ImmaculateConceptionTest.php | 2 +- tests/Spain/InternationalWorkersDayTest.php | 2 +- tests/Spain/LaRioja/LaRiojaDayTest.php | 4 ++-- tests/Spain/MaundyThursdayTest.php | 2 +- tests/Spain/NationalDayTest.php | 4 ++-- tests/Spain/NewYearsDayTest.php | 2 +- tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php | 4 ++-- .../ValencianCommunity/ValencianCommunityDayTest.php | 4 ++-- tests/Spain/ValentinesDayTest.php | 2 +- tests/Spain/stJosephsDayTest.php | 2 +- tests/Sweden/AllSaintsDayTest.php | 2 +- tests/Sweden/AllSaintsEveTest.php | 2 +- tests/Sweden/AscensionDayTest.php | 2 +- tests/Sweden/ChristmasDayTest.php | 2 +- tests/Sweden/ChristmasEveTest.php | 2 +- tests/Sweden/EasterMondayTest.php | 2 +- tests/Sweden/EasterTest.php | 2 +- tests/Sweden/EpiphanyEveTest.php | 2 +- tests/Sweden/EpiphanyTest.php | 2 +- tests/Sweden/GoodFridayTest.php | 2 +- tests/Sweden/InternationalWorkersDayTest.php | 2 +- tests/Sweden/NationalDayTest.php | 6 +++--- tests/Sweden/NewYearsDayTest.php | 2 +- tests/Sweden/NewYearsEveTest.php | 2 +- tests/Sweden/PentecostTest.php | 2 +- tests/Sweden/SecondChristmasDayTest.php | 2 +- tests/Sweden/StJohnsDayTest.php | 2 +- tests/Sweden/StJohnsEveTest.php | 2 +- tests/Sweden/WalpurgisEveTest.php | 2 +- tests/Switzerland/Aargau/AscensionDayTest.php | 2 +- tests/Switzerland/Aargau/ChristmasDayTest.php | 2 +- tests/Switzerland/Aargau/GoodFridayTest.php | 2 +- tests/Switzerland/Aargau/NewYearsDayTest.php | 2 +- .../AppenzellAusserrhoden/AscensionDayTest.php | 2 +- .../AppenzellAusserrhoden/ChristmasDayTest.php | 2 +- .../AppenzellAusserrhoden/EasterMondayTest.php | 2 +- .../AppenzellAusserrhoden/GoodFridayTest.php | 2 +- .../AppenzellAusserrhoden/NewYearsDayTest.php | 2 +- .../AppenzellAusserrhoden/PentecostMondayTest.php | 2 +- .../AppenzellAusserrhoden/StStephensDayTest.php | 2 +- .../AppenzellInnerrhoden/AllSaintsDayTest.php | 2 +- .../AppenzellInnerrhoden/AscensionDayTest.php | 2 +- .../AppenzellInnerrhoden/AssumptionOfMaryTest.php | 2 +- .../AppenzellInnerrhoden/ChristmasDayTest.php | 2 +- .../AppenzellInnerrhoden/CorpusChristiTest.php | 2 +- .../AppenzellInnerrhoden/EasterMondayTest.php | 2 +- .../AppenzellInnerrhoden/GoodFridayTest.php | 2 +- .../AppenzellInnerrhoden/ImmaculateConceptionTest.php | 2 +- .../AppenzellInnerrhoden/NewYearsDayTest.php | 2 +- .../AppenzellInnerrhoden/PentecostMondayTest.php | 2 +- .../AppenzellInnerrhoden/StStephensDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/AscensionDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/ChristmasDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/EasterMondayTest.php | 2 +- tests/Switzerland/BaselLandschaft/GoodFridayTest.php | 2 +- tests/Switzerland/BaselLandschaft/NewYearsDayTest.php | 2 +- .../BaselLandschaft/PentecostMondayTest.php | 2 +- .../Switzerland/BaselLandschaft/StStephensDayTest.php | 2 +- tests/Switzerland/BaselLandschaft/WorkersDayTest.php | 2 +- tests/Switzerland/BaselStadt/AscensionDayTest.php | 2 +- tests/Switzerland/BaselStadt/ChristmasDayTest.php | 2 +- tests/Switzerland/BaselStadt/EasterMondayTest.php | 2 +- tests/Switzerland/BaselStadt/GoodFridayTest.php | 2 +- tests/Switzerland/BaselStadt/NewYearsDayTest.php | 2 +- tests/Switzerland/BaselStadt/PentecostMondayTest.php | 2 +- tests/Switzerland/BaselStadt/StStephensDayTest.php | 2 +- tests/Switzerland/BaselStadt/WorkersDayTest.php | 2 +- tests/Switzerland/Bern/AscensionDayTest.php | 2 +- tests/Switzerland/Bern/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Bern/ChristmasDayTest.php | 2 +- tests/Switzerland/Bern/EasterMondayTest.php | 2 +- tests/Switzerland/Bern/GoodFridayTest.php | 2 +- tests/Switzerland/Bern/NewYearsDayTest.php | 2 +- tests/Switzerland/Bern/PentecostMondayTest.php | 2 +- tests/Switzerland/Bern/StStephensDayTest.php | 2 +- tests/Switzerland/Fribourg/AscensionDayTest.php | 2 +- tests/Switzerland/Fribourg/ChristmasDayTest.php | 2 +- tests/Switzerland/Fribourg/EasterMondayTest.php | 2 +- tests/Switzerland/Fribourg/GoodFridayTest.php | 2 +- tests/Switzerland/Fribourg/NewYearsDayTest.php | 2 +- tests/Switzerland/Fribourg/PentecostMondayTest.php | 2 +- tests/Switzerland/Geneva/AscensionDayTest.php | 2 +- tests/Switzerland/Geneva/ChristmasDayTest.php | 2 +- tests/Switzerland/Geneva/EasterMondayTest.php | 2 +- tests/Switzerland/Geneva/GoodFridayTest.php | 2 +- tests/Switzerland/Geneva/JeuneGenevoisTest.php | 6 +++--- tests/Switzerland/Geneva/NewYearsDayTest.php | 2 +- tests/Switzerland/Geneva/PentecostMondayTest.php | 2 +- tests/Switzerland/Geneva/RestaurationGenevoiseTest.php | 2 +- tests/Switzerland/Glarus/AllSaintsDayTest.php | 2 +- tests/Switzerland/Glarus/AscensionDayTest.php | 2 +- tests/Switzerland/Glarus/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Glarus/ChristmasDayTest.php | 2 +- tests/Switzerland/Glarus/EasterMondayTest.php | 2 +- tests/Switzerland/Glarus/GoodFridayTest.php | 2 +- tests/Switzerland/Glarus/NafelserFahrtTest.php | 4 ++-- tests/Switzerland/Glarus/NewYearsDayTest.php | 2 +- tests/Switzerland/Glarus/PentecostMondayTest.php | 2 +- tests/Switzerland/Glarus/StStephensDayTest.php | 2 +- tests/Switzerland/Grisons/AscensionDayTest.php | 2 +- tests/Switzerland/Grisons/ChristmasDayTest.php | 2 +- tests/Switzerland/Grisons/EasterMondayTest.php | 2 +- tests/Switzerland/Grisons/GoodFridayTest.php | 2 +- tests/Switzerland/Grisons/NewYearsDayTest.php | 2 +- tests/Switzerland/Grisons/PentecostMondayTest.php | 2 +- tests/Switzerland/Grisons/StStephensDayTest.php | 2 +- tests/Switzerland/Jura/AllSaintsDayTest.php | 2 +- tests/Switzerland/Jura/AscensionDayTest.php | 2 +- tests/Switzerland/Jura/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Jura/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Jura/ChristmasDayTest.php | 2 +- tests/Switzerland/Jura/CorpusChristiTest.php | 2 +- tests/Switzerland/Jura/EasterMondayTest.php | 2 +- tests/Switzerland/Jura/GoodFridayTest.php | 2 +- tests/Switzerland/Jura/NewYearsDayTest.php | 2 +- tests/Switzerland/Jura/PentecostMondayTest.php | 2 +- tests/Switzerland/Jura/PlebisciteJurassienTest.php | 4 ++-- tests/Switzerland/Jura/WorkersDayTest.php | 2 +- tests/Switzerland/Lucerne/AllSaintsDayTest.php | 2 +- tests/Switzerland/Lucerne/AscensionDayTest.php | 2 +- tests/Switzerland/Lucerne/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Lucerne/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Lucerne/ChristmasDayTest.php | 2 +- tests/Switzerland/Lucerne/CorpusChristiTest.php | 2 +- tests/Switzerland/Lucerne/EasterMondayTest.php | 2 +- tests/Switzerland/Lucerne/GoodFridayTest.php | 2 +- tests/Switzerland/Lucerne/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Lucerne/NewYearsDayTest.php | 2 +- tests/Switzerland/Lucerne/PentecostMondayTest.php | 2 +- tests/Switzerland/Lucerne/StStephensDayTest.php | 2 +- tests/Switzerland/Neuchatel/AscensionDayTest.php | 2 +- tests/Switzerland/Neuchatel/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Neuchatel/BettagsMontagTest.php | 4 ++-- tests/Switzerland/Neuchatel/ChristmasDayTest.php | 2 +- tests/Switzerland/Neuchatel/EasterMondayTest.php | 2 +- tests/Switzerland/Neuchatel/GoodFridayTest.php | 2 +- .../Neuchatel/InstaurationRepubliqueTest.php | 4 ++-- tests/Switzerland/Neuchatel/NewYearsDayTest.php | 2 +- tests/Switzerland/Neuchatel/PentecostMondayTest.php | 2 +- tests/Switzerland/Neuchatel/WorkersDayTest.php | 2 +- tests/Switzerland/Nidwalden/AllSaintsDayTest.php | 2 +- tests/Switzerland/Nidwalden/AscensionDayTest.php | 2 +- tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Nidwalden/ChristmasDayTest.php | 2 +- tests/Switzerland/Nidwalden/CorpusChristiTest.php | 2 +- tests/Switzerland/Nidwalden/EasterMondayTest.php | 2 +- tests/Switzerland/Nidwalden/GoodFridayTest.php | 2 +- .../Switzerland/Nidwalden/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Nidwalden/NewYearsDayTest.php | 2 +- tests/Switzerland/Nidwalden/PentecostMondayTest.php | 2 +- tests/Switzerland/Nidwalden/StJosephDayTest.php | 2 +- tests/Switzerland/Nidwalden/StStephensDayTest.php | 2 +- tests/Switzerland/Obwalden/AllSaintsDayTest.php | 2 +- tests/Switzerland/Obwalden/AscensionDayTest.php | 2 +- tests/Switzerland/Obwalden/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Obwalden/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Obwalden/BruderKlausenFestTest.php | 6 +++--- tests/Switzerland/Obwalden/ChristmasDayTest.php | 2 +- tests/Switzerland/Obwalden/CorpusChristiTest.php | 2 +- tests/Switzerland/Obwalden/EasterMondayTest.php | 2 +- tests/Switzerland/Obwalden/GoodFridayTest.php | 2 +- .../Switzerland/Obwalden/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Obwalden/NewYearsDayTest.php | 2 +- tests/Switzerland/Obwalden/PentecostMondayTest.php | 2 +- tests/Switzerland/Obwalden/StStephensDayTest.php | 2 +- tests/Switzerland/Schaffhausen/AscensionDayTest.php | 2 +- tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Schaffhausen/ChristmasDayTest.php | 2 +- tests/Switzerland/Schaffhausen/EasterMondayTest.php | 2 +- tests/Switzerland/Schaffhausen/GoodFridayTest.php | 2 +- tests/Switzerland/Schaffhausen/NewYearsDayTest.php | 2 +- tests/Switzerland/Schaffhausen/PentecostMondayTest.php | 2 +- tests/Switzerland/Schaffhausen/StStephensDayTest.php | 2 +- tests/Switzerland/Schaffhausen/WorkersDayTest.php | 2 +- tests/Switzerland/Schwyz/AllSaintsDayTest.php | 2 +- tests/Switzerland/Schwyz/AscensionDayTest.php | 2 +- tests/Switzerland/Schwyz/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Schwyz/ChristmasDayTest.php | 2 +- tests/Switzerland/Schwyz/CorpusChristiTest.php | 2 +- tests/Switzerland/Schwyz/EasterMondayTest.php | 2 +- tests/Switzerland/Schwyz/EpiphanyTest.php | 2 +- tests/Switzerland/Schwyz/GoodFridayTest.php | 2 +- tests/Switzerland/Schwyz/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Schwyz/NewYearsDayTest.php | 2 +- tests/Switzerland/Schwyz/PentecostMondayTest.php | 2 +- tests/Switzerland/Schwyz/StJosephDayTest.php | 2 +- tests/Switzerland/Schwyz/StStephensDayTest.php | 2 +- tests/Switzerland/Solothurn/AscensionDayTest.php | 2 +- tests/Switzerland/Solothurn/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Solothurn/ChristmasDayTest.php | 2 +- tests/Switzerland/Solothurn/GoodFridayTest.php | 2 +- tests/Switzerland/Solothurn/NewYearsDayTest.php | 2 +- tests/Switzerland/StGallen/AllSaintsDayTest.php | 2 +- tests/Switzerland/StGallen/AscensionDayTest.php | 2 +- tests/Switzerland/StGallen/ChristmasDayTest.php | 2 +- tests/Switzerland/StGallen/EasterMondayTest.php | 2 +- tests/Switzerland/StGallen/GoodFridayTest.php | 2 +- tests/Switzerland/StGallen/NewYearsDayTest.php | 2 +- tests/Switzerland/StGallen/PentecostMondayTest.php | 2 +- tests/Switzerland/StGallen/StStephensDayTest.php | 2 +- tests/Switzerland/SwissNationalDayTest.php | 10 +++++----- tests/Switzerland/Thurgau/AscensionDayTest.php | 2 +- tests/Switzerland/Thurgau/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Thurgau/ChristmasDayTest.php | 2 +- tests/Switzerland/Thurgau/EasterMondayTest.php | 2 +- tests/Switzerland/Thurgau/GoodFridayTest.php | 2 +- tests/Switzerland/Thurgau/NewYearsDayTest.php | 2 +- tests/Switzerland/Thurgau/PentecostMondayTest.php | 2 +- tests/Switzerland/Thurgau/StStephensDayTest.php | 2 +- tests/Switzerland/Thurgau/WorkersDayTest.php | 2 +- tests/Switzerland/Ticino/AllSaintsDayTest.php | 2 +- tests/Switzerland/Ticino/AscensionDayTest.php | 2 +- tests/Switzerland/Ticino/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Ticino/ChristmasDayTest.php | 2 +- tests/Switzerland/Ticino/CorpusChristiTest.php | 2 +- tests/Switzerland/Ticino/EasterMondayTest.php | 2 +- tests/Switzerland/Ticino/EpiphanyTest.php | 2 +- tests/Switzerland/Ticino/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Ticino/NewYearsDayTest.php | 2 +- tests/Switzerland/Ticino/PentecostMondayTest.php | 2 +- tests/Switzerland/Ticino/StJosephDayTest.php | 2 +- tests/Switzerland/Ticino/StPeterPaulTest.php | 2 +- tests/Switzerland/Ticino/StStephensDayTest.php | 2 +- tests/Switzerland/Ticino/WorkersDayTest.php | 2 +- tests/Switzerland/Uri/AllSaintsDayTest.php | 2 +- tests/Switzerland/Uri/AscensionDayTest.php | 2 +- tests/Switzerland/Uri/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Uri/ChristmasDayTest.php | 2 +- tests/Switzerland/Uri/CorpusChristiTest.php | 2 +- tests/Switzerland/Uri/EasterMondayTest.php | 2 +- tests/Switzerland/Uri/EpiphanyTest.php | 2 +- tests/Switzerland/Uri/GoodFridayTest.php | 2 +- tests/Switzerland/Uri/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Uri/NewYearsDayTest.php | 2 +- tests/Switzerland/Uri/PentecostMondayTest.php | 2 +- tests/Switzerland/Uri/StJosephDayTest.php | 2 +- tests/Switzerland/Uri/StStephensDayTest.php | 2 +- tests/Switzerland/Valais/AllSaintsDayTest.php | 2 +- tests/Switzerland/Valais/AscensionDayTest.php | 2 +- tests/Switzerland/Valais/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Valais/ChristmasDayTest.php | 2 +- tests/Switzerland/Valais/CorpusChristiTest.php | 2 +- tests/Switzerland/Valais/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Valais/NewYearsDayTest.php | 2 +- tests/Switzerland/Valais/StJosephDayTest.php | 2 +- tests/Switzerland/Vaud/AscensionDayTest.php | 2 +- tests/Switzerland/Vaud/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Vaud/BettagsMontagTest.php | 4 ++-- tests/Switzerland/Vaud/ChristmasDayTest.php | 2 +- tests/Switzerland/Vaud/EasterMondayTest.php | 2 +- tests/Switzerland/Vaud/GoodFridayTest.php | 2 +- tests/Switzerland/Vaud/NewYearsDayTest.php | 2 +- tests/Switzerland/Vaud/PentecostMondayTest.php | 2 +- tests/Switzerland/Zug/AllSaintsDayTest.php | 2 +- tests/Switzerland/Zug/AscensionDayTest.php | 2 +- tests/Switzerland/Zug/AssumptionOfMaryTest.php | 2 +- tests/Switzerland/Zug/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Zug/ChristmasDayTest.php | 2 +- tests/Switzerland/Zug/CorpusChristiTest.php | 2 +- tests/Switzerland/Zug/EasterMondayTest.php | 2 +- tests/Switzerland/Zug/GoodFridayTest.php | 2 +- tests/Switzerland/Zug/ImmaculateConceptionTest.php | 2 +- tests/Switzerland/Zug/NewYearsDayTest.php | 2 +- tests/Switzerland/Zug/PentecostMondayTest.php | 2 +- tests/Switzerland/Zug/StStephensDayTest.php | 2 +- tests/Switzerland/Zurich/AscensionDayTest.php | 2 +- tests/Switzerland/Zurich/BerchtoldsTagTest.php | 2 +- tests/Switzerland/Zurich/ChristmasDayTest.php | 2 +- tests/Switzerland/Zurich/EasterMondayTest.php | 2 +- tests/Switzerland/Zurich/GoodFridayTest.php | 2 +- tests/Switzerland/Zurich/NewYearsDayTest.php | 2 +- tests/Switzerland/Zurich/PentecostMondayTest.php | 2 +- tests/Switzerland/Zurich/StStephensDayTest.php | 2 +- tests/Switzerland/Zurich/WorkersDayTest.php | 2 +- 297 files changed, 331 insertions(+), 331 deletions(-) diff --git a/tests/Spain/AllSaintsDayTest.php b/tests/Spain/AllSaintsDayTest.php index 4e567cedc..c41a35195 100644 --- a/tests/Spain/AllSaintsDayTest.php +++ b/tests/Spain/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends SpainBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/Andalusia/AndalusiaDayTest.php b/tests/Spain/Andalusia/AndalusiaDayTest.php index 569a3009f..d56bd7ff9 100644 --- a/tests/Spain/Andalusia/AndalusiaDayTest.php +++ b/tests/Spain/Andalusia/AndalusiaDayTest.php @@ -39,7 +39,7 @@ class AndalusiaDayTest extends AndalusiaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Aragon/StGeorgesDayTest.php b/tests/Spain/Aragon/StGeorgesDayTest.php index 97a4ed7f6..89042cbb9 100644 --- a/tests/Spain/Aragon/StGeorgesDayTest.php +++ b/tests/Spain/Aragon/StGeorgesDayTest.php @@ -34,7 +34,7 @@ class StGeorgesDayTest extends AragonBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(); $this->assertHoliday( diff --git a/tests/Spain/AssumptionOfMaryTest.php b/tests/Spain/AssumptionOfMaryTest.php index f6d5c7df3..79a92edab 100644 --- a/tests/Spain/AssumptionOfMaryTest.php +++ b/tests/Spain/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends SpainBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/Asturias/AsturiasDayTest.php b/tests/Spain/Asturias/AsturiasDayTest.php index 2bd713aad..f1327ec8e 100644 --- a/tests/Spain/Asturias/AsturiasDayTest.php +++ b/tests/Spain/Asturias/AsturiasDayTest.php @@ -39,7 +39,7 @@ class AsturiasDayTest extends AsturiasBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php b/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php index 2141e268f..aad4de6ed 100644 --- a/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php +++ b/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php @@ -39,7 +39,7 @@ class BalearicIslandsDayTest extends BalearicIslandsBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/BasqueCountry/BasqueCountryDayTest.php b/tests/Spain/BasqueCountry/BasqueCountryDayTest.php index a0710a0e6..96011e950 100644 --- a/tests/Spain/BasqueCountry/BasqueCountryDayTest.php +++ b/tests/Spain/BasqueCountry/BasqueCountryDayTest.php @@ -44,7 +44,7 @@ class BasqueCountryDayTest extends BasqueCountryBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::ABOLISHMENT_YEAR); $this->assertHoliday( @@ -59,7 +59,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -72,7 +72,7 @@ public function testHolidayBeforeEstablishment() * Tests the holiday defined in this test after abolishment. * @throws ReflectionException */ - public function testHolidayDayAfterAbolishment() + public function testHolidayDayAfterAbolishment(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ABOLISHMENT_YEAR + 1)); } diff --git a/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php b/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php index 962b33d60..4ffd15fe8 100644 --- a/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php +++ b/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php @@ -39,7 +39,7 @@ class CanaryIslandsDayTest extends CanaryIslandsBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Cantabria/CantabriaDayTest.php b/tests/Spain/Cantabria/CantabriaDayTest.php index c278f644a..a09e462f6 100644 --- a/tests/Spain/Cantabria/CantabriaDayTest.php +++ b/tests/Spain/Cantabria/CantabriaDayTest.php @@ -39,7 +39,7 @@ class CantabriaDayTest extends CantabriaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php b/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php index eded19398..4bf3aba19 100644 --- a/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php +++ b/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php @@ -39,7 +39,7 @@ class CastileAndLeonDayTest extends CastileAndLeonBaseTestCase implements Yasumi * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php b/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php index d08d37f60..ab326b744 100644 --- a/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php +++ b/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php @@ -39,7 +39,7 @@ class CastillaLaManchaDayTest extends CastillaLaManchaBaseTestCase implements Ya * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Catalonia/nationalCataloniaDayTest.php b/tests/Spain/Catalonia/nationalCataloniaDayTest.php index 94ebfc3d2..931ffe061 100644 --- a/tests/Spain/Catalonia/nationalCataloniaDayTest.php +++ b/tests/Spain/Catalonia/nationalCataloniaDayTest.php @@ -39,7 +39,7 @@ class nationalCataloniaDayTest extends CataloniaBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Catalonia/stJohnsDayTest.php b/tests/Spain/Catalonia/stJohnsDayTest.php index 5b63f65d4..bc2166538 100644 --- a/tests/Spain/Catalonia/stJohnsDayTest.php +++ b/tests/Spain/Catalonia/stJohnsDayTest.php @@ -38,7 +38,7 @@ class stJohnsDayTest extends CataloniaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/Ceuta/ceutaDayTest.php b/tests/Spain/Ceuta/ceutaDayTest.php index 63c82138d..164cbd021 100644 --- a/tests/Spain/Ceuta/ceutaDayTest.php +++ b/tests/Spain/Ceuta/ceutaDayTest.php @@ -39,7 +39,7 @@ class ceutaDayTest extends CeutaBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/ChristmasTest.php b/tests/Spain/ChristmasTest.php index 9acc67748..d40f58451 100644 --- a/tests/Spain/ChristmasTest.php +++ b/tests/Spain/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends SpainBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php b/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php index 2f8b97db1..15849e67c 100644 --- a/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php +++ b/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php @@ -34,7 +34,7 @@ class DosdeMayoUprisingDayTest extends CommunityOfMadridBaseTestCase implements * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(); $this->assertHoliday( diff --git a/tests/Spain/ConstitutionDayTest.php b/tests/Spain/ConstitutionDayTest.php index f5e3e7cf8..3e3b37baa 100644 --- a/tests/Spain/ConstitutionDayTest.php +++ b/tests/Spain/ConstitutionDayTest.php @@ -39,7 +39,7 @@ class ConstitutionDayTest extends SpainBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/EasterMondayTest.php b/tests/Spain/EasterMondayTest.php index b12683ced..38afecaef 100644 --- a/tests/Spain/EasterMondayTest.php +++ b/tests/Spain/EasterMondayTest.php @@ -40,7 +40,7 @@ class EasterMondayTest extends SpainBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2216; $this->assertHoliday( diff --git a/tests/Spain/EpiphanyTest.php b/tests/Spain/EpiphanyTest.php index bf36a7c4d..95c701b84 100644 --- a/tests/Spain/EpiphanyTest.php +++ b/tests/Spain/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends SpainBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/Extremadura/ExtremaduraDayTest.php b/tests/Spain/Extremadura/ExtremaduraDayTest.php index 5ced297d8..5ab748386 100644 --- a/tests/Spain/Extremadura/ExtremaduraDayTest.php +++ b/tests/Spain/Extremadura/ExtremaduraDayTest.php @@ -39,7 +39,7 @@ class ExtremaduraDayTest extends ExtremaduraBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Galicia/GalicianLiteratureDayTest.php b/tests/Spain/Galicia/GalicianLiteratureDayTest.php index b5c1134cd..9f58c58e7 100644 --- a/tests/Spain/Galicia/GalicianLiteratureDayTest.php +++ b/tests/Spain/Galicia/GalicianLiteratureDayTest.php @@ -39,7 +39,7 @@ class GalicianLiteratureDayTest extends GaliciaBaseTestCase implements YasumiTes * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/Galicia/stJamesDayTest.php b/tests/Spain/Galicia/stJamesDayTest.php index 29411fbd6..db0a1f3ed 100644 --- a/tests/Spain/Galicia/stJamesDayTest.php +++ b/tests/Spain/Galicia/stJamesDayTest.php @@ -39,7 +39,7 @@ class stJamesDayTest extends GaliciaBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/GoodFridayTest.php b/tests/Spain/GoodFridayTest.php index e4a57ebe7..cd0f382e3 100644 --- a/tests/Spain/GoodFridayTest.php +++ b/tests/Spain/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends SpainBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2066; $this->assertHoliday( diff --git a/tests/Spain/ImmaculateConceptionTest.php b/tests/Spain/ImmaculateConceptionTest.php index bedc5be37..38ded2251 100644 --- a/tests/Spain/ImmaculateConceptionTest.php +++ b/tests/Spain/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends SpainBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/InternationalWorkersDayTest.php b/tests/Spain/InternationalWorkersDayTest.php index 42f1feac8..aa1f51843 100644 --- a/tests/Spain/InternationalWorkersDayTest.php +++ b/tests/Spain/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends SpainBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/LaRioja/LaRiojaDayTest.php b/tests/Spain/LaRioja/LaRiojaDayTest.php index 0956203c9..b4eede700 100644 --- a/tests/Spain/LaRioja/LaRiojaDayTest.php +++ b/tests/Spain/LaRioja/LaRiojaDayTest.php @@ -39,7 +39,7 @@ class LaRiojaDayTest extends LaRiojaBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/MaundyThursdayTest.php b/tests/Spain/MaundyThursdayTest.php index 912b447ce..4f31773ef 100644 --- a/tests/Spain/MaundyThursdayTest.php +++ b/tests/Spain/MaundyThursdayTest.php @@ -40,7 +40,7 @@ class MaundyThursdayTest extends SpainBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Spain/NationalDayTest.php b/tests/Spain/NationalDayTest.php index cdba0bf2e..81765ce5d 100644 --- a/tests/Spain/NationalDayTest.php +++ b/tests/Spain/NationalDayTest.php @@ -39,7 +39,7 @@ class NationalDayTest extends SpainBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/NewYearsDayTest.php b/tests/Spain/NewYearsDayTest.php index c4cd7e631..d240ab074 100644 --- a/tests/Spain/NewYearsDayTest.php +++ b/tests/Spain/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends SpainBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php b/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php index 6e7a56aa0..7a1ce5120 100644 --- a/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php +++ b/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php @@ -39,7 +39,7 @@ class RegionOfMurciaDayTest extends RegionOfMurciaBaseTestCase implements Yasumi * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php b/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php index 71f62d2ca..223434095 100644 --- a/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php +++ b/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php @@ -39,7 +39,7 @@ class ValencianCommunityDayTest extends ValencianCommunityBaseTestCase implement * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Spain/ValentinesDayTest.php b/tests/Spain/ValentinesDayTest.php index 0a2e14a0d..37150429d 100644 --- a/tests/Spain/ValentinesDayTest.php +++ b/tests/Spain/ValentinesDayTest.php @@ -38,7 +38,7 @@ class ValentinesDayTest extends SpainBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Spain/stJosephsDayTest.php b/tests/Spain/stJosephsDayTest.php index 396bd09a8..52f636945 100644 --- a/tests/Spain/stJosephsDayTest.php +++ b/tests/Spain/stJosephsDayTest.php @@ -44,7 +44,7 @@ class stJosephsDayTest extends SpainBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/AllSaintsDayTest.php b/tests/Sweden/AllSaintsDayTest.php index 5086e2e71..524636504 100644 --- a/tests/Sweden/AllSaintsDayTest.php +++ b/tests/Sweden/AllSaintsDayTest.php @@ -40,7 +40,7 @@ class AllSaintsDayTest extends SwedenBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/AllSaintsEveTest.php b/tests/Sweden/AllSaintsEveTest.php index 1c4f7b0e0..ab9056cfc 100644 --- a/tests/Sweden/AllSaintsEveTest.php +++ b/tests/Sweden/AllSaintsEveTest.php @@ -40,7 +40,7 @@ class AllSaintsEveTest extends SwedenBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/AscensionDayTest.php b/tests/Sweden/AscensionDayTest.php index 4a8ab1ffa..1e908ce46 100644 --- a/tests/Sweden/AscensionDayTest.php +++ b/tests/Sweden/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends SwedenBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1588; $this->assertHoliday( diff --git a/tests/Sweden/ChristmasDayTest.php b/tests/Sweden/ChristmasDayTest.php index 9530f4b93..426250943 100644 --- a/tests/Sweden/ChristmasDayTest.php +++ b/tests/Sweden/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends SwedenBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/ChristmasEveTest.php b/tests/Sweden/ChristmasEveTest.php index 8603ebeb9..f1e4a7098 100644 --- a/tests/Sweden/ChristmasEveTest.php +++ b/tests/Sweden/ChristmasEveTest.php @@ -38,7 +38,7 @@ class ChristmasEveTest extends SwedenBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/EasterMondayTest.php b/tests/Sweden/EasterMondayTest.php index 470ba62ce..921827a8f 100644 --- a/tests/Sweden/EasterMondayTest.php +++ b/tests/Sweden/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends SwedenBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Sweden/EasterTest.php b/tests/Sweden/EasterTest.php index ca164fe1a..7983489f6 100644 --- a/tests/Sweden/EasterTest.php +++ b/tests/Sweden/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends SwedenBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1847; $this->assertHoliday( diff --git a/tests/Sweden/EpiphanyEveTest.php b/tests/Sweden/EpiphanyEveTest.php index fe51778d7..add4012ec 100644 --- a/tests/Sweden/EpiphanyEveTest.php +++ b/tests/Sweden/EpiphanyEveTest.php @@ -38,7 +38,7 @@ class EpiphanyEveTest extends SwedenBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/EpiphanyTest.php b/tests/Sweden/EpiphanyTest.php index 09457326a..2238c9983 100644 --- a/tests/Sweden/EpiphanyTest.php +++ b/tests/Sweden/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends SwedenBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/GoodFridayTest.php b/tests/Sweden/GoodFridayTest.php index d7addd08b..8062647bd 100644 --- a/tests/Sweden/GoodFridayTest.php +++ b/tests/Sweden/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends SwedenBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2005; $this->assertHoliday( diff --git a/tests/Sweden/InternationalWorkersDayTest.php b/tests/Sweden/InternationalWorkersDayTest.php index f91d5069e..8af659bab 100644 --- a/tests/Sweden/InternationalWorkersDayTest.php +++ b/tests/Sweden/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends SwedenBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/NationalDayTest.php b/tests/Sweden/NationalDayTest.php index f3a86793b..ef3a3dd72 100644 --- a/tests/Sweden/NationalDayTest.php +++ b/tests/Sweden/NationalDayTest.php @@ -39,7 +39,7 @@ class NationalDayTest extends SwedenBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2022; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -95,7 +95,7 @@ public function testHolidayType(): void * Tests the translated name of the holiday defined in this test on or after establishment. * @throws ReflectionException */ - public function testTranslationOnAfterNameChange() + public function testTranslationOnAfterNameChange(): void { $this->assertTranslatedHolidayName( self::REGION, diff --git a/tests/Sweden/NewYearsDayTest.php b/tests/Sweden/NewYearsDayTest.php index 50a8c2343..5d4825f1e 100644 --- a/tests/Sweden/NewYearsDayTest.php +++ b/tests/Sweden/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends SwedenBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/NewYearsEveTest.php b/tests/Sweden/NewYearsEveTest.php index 4295ae58c..5354dbac9 100644 --- a/tests/Sweden/NewYearsEveTest.php +++ b/tests/Sweden/NewYearsEveTest.php @@ -38,7 +38,7 @@ class NewYearsEveTest extends SwedenBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/PentecostTest.php b/tests/Sweden/PentecostTest.php index aaa2bab71..bd4907ab4 100644 --- a/tests/Sweden/PentecostTest.php +++ b/tests/Sweden/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends SwedenBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 4009; $this->assertHoliday( diff --git a/tests/Sweden/SecondChristmasDayTest.php b/tests/Sweden/SecondChristmasDayTest.php index 64099d8bd..6667f4f01 100644 --- a/tests/Sweden/SecondChristmasDayTest.php +++ b/tests/Sweden/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends SwedenBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Sweden/StJohnsDayTest.php b/tests/Sweden/StJohnsDayTest.php index 623910e83..f15072bd0 100644 --- a/tests/Sweden/StJohnsDayTest.php +++ b/tests/Sweden/StJohnsDayTest.php @@ -31,7 +31,7 @@ class StJohnsDayTest extends SwedenBaseTestCase implements YasumiTestCaseInterfa * Tests the holiday defined in this test. * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(); diff --git a/tests/Sweden/StJohnsEveTest.php b/tests/Sweden/StJohnsEveTest.php index ff3f47bb4..22abd0c0c 100644 --- a/tests/Sweden/StJohnsEveTest.php +++ b/tests/Sweden/StJohnsEveTest.php @@ -31,7 +31,7 @@ class StJohnsEveTest extends SwedenBaseTestCase implements YasumiTestCaseInterfa * Tests the holiday defined in this test. * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(); diff --git a/tests/Sweden/WalpurgisEveTest.php b/tests/Sweden/WalpurgisEveTest.php index bdb7c6850..b1783c9b6 100644 --- a/tests/Sweden/WalpurgisEveTest.php +++ b/tests/Sweden/WalpurgisEveTest.php @@ -38,7 +38,7 @@ class WalpurgisEveTest extends SwedenBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Aargau/AscensionDayTest.php b/tests/Switzerland/Aargau/AscensionDayTest.php index b01803759..e53d7bd40 100644 --- a/tests/Switzerland/Aargau/AscensionDayTest.php +++ b/tests/Switzerland/Aargau/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends AargauBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Aargau/ChristmasDayTest.php b/tests/Switzerland/Aargau/ChristmasDayTest.php index 98eaf9cfc..a581d0944 100644 --- a/tests/Switzerland/Aargau/ChristmasDayTest.php +++ b/tests/Switzerland/Aargau/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends AargauBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Aargau/GoodFridayTest.php b/tests/Switzerland/Aargau/GoodFridayTest.php index cd0b75249..b5e073829 100644 --- a/tests/Switzerland/Aargau/GoodFridayTest.php +++ b/tests/Switzerland/Aargau/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends AargauBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Aargau/NewYearsDayTest.php b/tests/Switzerland/Aargau/NewYearsDayTest.php index d36166533..5d8726379 100644 --- a/tests/Switzerland/Aargau/NewYearsDayTest.php +++ b/tests/Switzerland/Aargau/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends AargauBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php index 385509021..480fc9693 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends AppenzellAusserrhodenBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php index 1cb0fd60d..4f8fe1e27 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends AppenzellAusserrhodenBaseTestCase implements Yasu * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php b/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php index bf24ea890..ccbb37b3d 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends AppenzellAusserrhodenBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php b/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php index 09963ce87..e17338c47 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends AppenzellAusserrhodenBaseTestCase implements Yasumi * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php index 115df0915..bdd714ab2 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends AppenzellAusserrhodenBaseTestCase implements Yasum * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php b/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php index bb797bde6..9eba5caf8 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends AppenzellAusserrhodenBaseTestCase implements Y * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php index d4880a5ed..c446f0e9c 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends AppenzellAusserrhodenBaseTestCase implements Yas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php index 7332ba7fa..e0d593bf0 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends AppenzellInnerrhodenBaseTestCase implements Yasum * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php index b6cab9a68..f20704b10 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends AppenzellInnerrhodenBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php b/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php index e2bd328a5..b1ad82e85 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends AppenzellInnerrhodenBaseTestCase implements Y * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php index b848cc314..bef98b4ef 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends AppenzellInnerrhodenBaseTestCase implements Yasum * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php b/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php index e75b56fae..0f34ea058 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends AppenzellInnerrhodenBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php b/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php index 4c620831a..905af5ef5 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends AppenzellInnerrhodenBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php b/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php index 182251ede..85be3c537 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends AppenzellInnerrhodenBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php b/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php index 6c50739b7..f0d0013b4 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends AppenzellInnerrhodenBaseTestCase implemen * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php index f413c2d03..70bfe418c 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends AppenzellInnerrhodenBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php b/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php index b698c912f..ef1028f18 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends AppenzellInnerrhodenBaseTestCase implements Ya * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php index 6a44c264b..88e9d6aee 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends AppenzellInnerrhodenBaseTestCase implements Yasu * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselLandschaft/AscensionDayTest.php b/tests/Switzerland/BaselLandschaft/AscensionDayTest.php index 8e62e45b3..37c57941f 100644 --- a/tests/Switzerland/BaselLandschaft/AscensionDayTest.php +++ b/tests/Switzerland/BaselLandschaft/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends BaselLandschaftBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php b/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php index 00159ea9a..4f8f07ec2 100644 --- a/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php +++ b/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends BaselLandschaftBaseTestCase implements YasumiTest * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselLandschaft/EasterMondayTest.php b/tests/Switzerland/BaselLandschaft/EasterMondayTest.php index 48ff0a482..7eac83258 100644 --- a/tests/Switzerland/BaselLandschaft/EasterMondayTest.php +++ b/tests/Switzerland/BaselLandschaft/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends BaselLandschaftBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/BaselLandschaft/GoodFridayTest.php b/tests/Switzerland/BaselLandschaft/GoodFridayTest.php index f42b7039d..85dc616f5 100644 --- a/tests/Switzerland/BaselLandschaft/GoodFridayTest.php +++ b/tests/Switzerland/BaselLandschaft/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends BaselLandschaftBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php b/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php index 55a355c84..5c7f0ba40 100644 --- a/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php +++ b/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends BaselLandschaftBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php b/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php index 1a968d44b..57addd29a 100644 --- a/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php +++ b/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends BaselLandschaftBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/BaselLandschaft/StStephensDayTest.php b/tests/Switzerland/BaselLandschaft/StStephensDayTest.php index 0b4d0cde2..fd20b6207 100644 --- a/tests/Switzerland/BaselLandschaft/StStephensDayTest.php +++ b/tests/Switzerland/BaselLandschaft/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends BaselLandschaftBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselLandschaft/WorkersDayTest.php b/tests/Switzerland/BaselLandschaft/WorkersDayTest.php index b24fc0e8d..d2e35d790 100644 --- a/tests/Switzerland/BaselLandschaft/WorkersDayTest.php +++ b/tests/Switzerland/BaselLandschaft/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends BaselLandschaftBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/BaselStadt/AscensionDayTest.php b/tests/Switzerland/BaselStadt/AscensionDayTest.php index aaf4b2839..78a212302 100644 --- a/tests/Switzerland/BaselStadt/AscensionDayTest.php +++ b/tests/Switzerland/BaselStadt/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends BaselStadtBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/BaselStadt/ChristmasDayTest.php b/tests/Switzerland/BaselStadt/ChristmasDayTest.php index 3f1eb63db..8bef08ab5 100644 --- a/tests/Switzerland/BaselStadt/ChristmasDayTest.php +++ b/tests/Switzerland/BaselStadt/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends BaselStadtBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselStadt/EasterMondayTest.php b/tests/Switzerland/BaselStadt/EasterMondayTest.php index 40b3bc221..c4facbaa0 100644 --- a/tests/Switzerland/BaselStadt/EasterMondayTest.php +++ b/tests/Switzerland/BaselStadt/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends BaselStadtBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/BaselStadt/GoodFridayTest.php b/tests/Switzerland/BaselStadt/GoodFridayTest.php index 210c5f0a5..0f93e3090 100644 --- a/tests/Switzerland/BaselStadt/GoodFridayTest.php +++ b/tests/Switzerland/BaselStadt/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends BaselStadtBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/BaselStadt/NewYearsDayTest.php b/tests/Switzerland/BaselStadt/NewYearsDayTest.php index cba386f4d..669808bee 100644 --- a/tests/Switzerland/BaselStadt/NewYearsDayTest.php +++ b/tests/Switzerland/BaselStadt/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends BaselStadtBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselStadt/PentecostMondayTest.php b/tests/Switzerland/BaselStadt/PentecostMondayTest.php index fe914a6a9..2c62b9d45 100644 --- a/tests/Switzerland/BaselStadt/PentecostMondayTest.php +++ b/tests/Switzerland/BaselStadt/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends BaselStadtBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/BaselStadt/StStephensDayTest.php b/tests/Switzerland/BaselStadt/StStephensDayTest.php index 18bb8d411..9a0440285 100644 --- a/tests/Switzerland/BaselStadt/StStephensDayTest.php +++ b/tests/Switzerland/BaselStadt/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends BaselStadtBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/BaselStadt/WorkersDayTest.php b/tests/Switzerland/BaselStadt/WorkersDayTest.php index 849e79d64..684056945 100644 --- a/tests/Switzerland/BaselStadt/WorkersDayTest.php +++ b/tests/Switzerland/BaselStadt/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends BaselStadtBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Bern/AscensionDayTest.php b/tests/Switzerland/Bern/AscensionDayTest.php index c63d174a7..62934c036 100644 --- a/tests/Switzerland/Bern/AscensionDayTest.php +++ b/tests/Switzerland/Bern/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends BernBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Bern/BerchtoldsTagTest.php b/tests/Switzerland/Bern/BerchtoldsTagTest.php index fa4a9da52..85f54f421 100644 --- a/tests/Switzerland/Bern/BerchtoldsTagTest.php +++ b/tests/Switzerland/Bern/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends BernBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Bern/ChristmasDayTest.php b/tests/Switzerland/Bern/ChristmasDayTest.php index e970e5390..ba6022df1 100644 --- a/tests/Switzerland/Bern/ChristmasDayTest.php +++ b/tests/Switzerland/Bern/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends BernBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Bern/EasterMondayTest.php b/tests/Switzerland/Bern/EasterMondayTest.php index 898e057a8..12a64d1ed 100644 --- a/tests/Switzerland/Bern/EasterMondayTest.php +++ b/tests/Switzerland/Bern/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends BernBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Bern/GoodFridayTest.php b/tests/Switzerland/Bern/GoodFridayTest.php index d696b6660..27d6af82e 100644 --- a/tests/Switzerland/Bern/GoodFridayTest.php +++ b/tests/Switzerland/Bern/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends BernBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Bern/NewYearsDayTest.php b/tests/Switzerland/Bern/NewYearsDayTest.php index 2f42ae433..72449201c 100644 --- a/tests/Switzerland/Bern/NewYearsDayTest.php +++ b/tests/Switzerland/Bern/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends BernBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Bern/PentecostMondayTest.php b/tests/Switzerland/Bern/PentecostMondayTest.php index 4a72c37e4..07e0d18fc 100644 --- a/tests/Switzerland/Bern/PentecostMondayTest.php +++ b/tests/Switzerland/Bern/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends BernBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Bern/StStephensDayTest.php b/tests/Switzerland/Bern/StStephensDayTest.php index b415afc55..b2aca97d8 100644 --- a/tests/Switzerland/Bern/StStephensDayTest.php +++ b/tests/Switzerland/Bern/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends BernBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Fribourg/AscensionDayTest.php b/tests/Switzerland/Fribourg/AscensionDayTest.php index f7c5b93db..a589a9def 100644 --- a/tests/Switzerland/Fribourg/AscensionDayTest.php +++ b/tests/Switzerland/Fribourg/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends FribourgBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Fribourg/ChristmasDayTest.php b/tests/Switzerland/Fribourg/ChristmasDayTest.php index cf2d27243..a61bf92de 100644 --- a/tests/Switzerland/Fribourg/ChristmasDayTest.php +++ b/tests/Switzerland/Fribourg/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends FribourgBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Fribourg/EasterMondayTest.php b/tests/Switzerland/Fribourg/EasterMondayTest.php index f8d8d7382..efae65b93 100644 --- a/tests/Switzerland/Fribourg/EasterMondayTest.php +++ b/tests/Switzerland/Fribourg/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends FribourgBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Fribourg/GoodFridayTest.php b/tests/Switzerland/Fribourg/GoodFridayTest.php index 0e27cb829..6edfc908d 100644 --- a/tests/Switzerland/Fribourg/GoodFridayTest.php +++ b/tests/Switzerland/Fribourg/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends FribourgBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Fribourg/NewYearsDayTest.php b/tests/Switzerland/Fribourg/NewYearsDayTest.php index d1f90bc50..ee3214b3b 100644 --- a/tests/Switzerland/Fribourg/NewYearsDayTest.php +++ b/tests/Switzerland/Fribourg/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends FribourgBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Fribourg/PentecostMondayTest.php b/tests/Switzerland/Fribourg/PentecostMondayTest.php index 95bb84f40..edf97a9d5 100644 --- a/tests/Switzerland/Fribourg/PentecostMondayTest.php +++ b/tests/Switzerland/Fribourg/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends FribourgBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Geneva/AscensionDayTest.php b/tests/Switzerland/Geneva/AscensionDayTest.php index f15e320b3..df23f9bd4 100644 --- a/tests/Switzerland/Geneva/AscensionDayTest.php +++ b/tests/Switzerland/Geneva/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends GenevaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Geneva/ChristmasDayTest.php b/tests/Switzerland/Geneva/ChristmasDayTest.php index dab140110..fa4c62ac7 100644 --- a/tests/Switzerland/Geneva/ChristmasDayTest.php +++ b/tests/Switzerland/Geneva/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends GenevaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Geneva/EasterMondayTest.php b/tests/Switzerland/Geneva/EasterMondayTest.php index fcb3470ea..4dcea3f5c 100644 --- a/tests/Switzerland/Geneva/EasterMondayTest.php +++ b/tests/Switzerland/Geneva/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends GenevaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Geneva/GoodFridayTest.php b/tests/Switzerland/Geneva/GoodFridayTest.php index b935cd1f6..b0c89c869 100644 --- a/tests/Switzerland/Geneva/GoodFridayTest.php +++ b/tests/Switzerland/Geneva/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends GenevaBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Geneva/JeuneGenevoisTest.php b/tests/Switzerland/Geneva/JeuneGenevoisTest.php index 6e874c839..452c28187 100644 --- a/tests/Switzerland/Geneva/JeuneGenevoisTest.php +++ b/tests/Switzerland/Geneva/JeuneGenevoisTest.php @@ -37,7 +37,7 @@ class JeuneGenevoisTest extends GenevaBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testJeuneGenevoisBetween1870And1965() + public function testJeuneGenevoisBetween1870And1965(): void { $year = $this->generateRandomYear(1870, 1965); // Find first Sunday of September @@ -55,7 +55,7 @@ public function testJeuneGenevoisBetween1870And1965() * @throws ReflectionException * @throws Exception */ - public function testJeuneGenevoisBetween1840And1869() + public function testJeuneGenevoisBetween1840And1869(): void { $year = $this->generateRandomYear(Geneva::JEUNE_GENEVOIS_ESTABLISHMENT_YEAR, 1869); // Find first Sunday of September @@ -71,7 +71,7 @@ public function testJeuneGenevoisBetween1840And1869() * Tests Jeune Genevois before 1840 * @throws ReflectionException */ - public function testJeuneGenevoisBefore1840() + public function testJeuneGenevoisBefore1840(): void { $year = $this->generateRandomYear(1000, Geneva::JEUNE_GENEVOIS_ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Geneva/NewYearsDayTest.php b/tests/Switzerland/Geneva/NewYearsDayTest.php index f7af44741..417c966c2 100644 --- a/tests/Switzerland/Geneva/NewYearsDayTest.php +++ b/tests/Switzerland/Geneva/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends GenevaBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Geneva/PentecostMondayTest.php b/tests/Switzerland/Geneva/PentecostMondayTest.php index a3d74d6a7..04cd35873 100644 --- a/tests/Switzerland/Geneva/PentecostMondayTest.php +++ b/tests/Switzerland/Geneva/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends GenevaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php b/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php index f6a6942a2..27156ba8d 100644 --- a/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php +++ b/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php @@ -34,7 +34,7 @@ class RestaurationGenevoiseTest extends GenevaBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testRestaurationGenevoiseAfter1813() + public function testRestaurationGenevoiseAfter1813(): void { $year = $this->generateRandomYear(1814); diff --git a/tests/Switzerland/Glarus/AllSaintsDayTest.php b/tests/Switzerland/Glarus/AllSaintsDayTest.php index c620c4f10..d00562382 100644 --- a/tests/Switzerland/Glarus/AllSaintsDayTest.php +++ b/tests/Switzerland/Glarus/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends GlarusBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Glarus/AscensionDayTest.php b/tests/Switzerland/Glarus/AscensionDayTest.php index 2ed0cbd91..64657f9de 100644 --- a/tests/Switzerland/Glarus/AscensionDayTest.php +++ b/tests/Switzerland/Glarus/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends GlarusBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Glarus/BerchtoldsTagTest.php b/tests/Switzerland/Glarus/BerchtoldsTagTest.php index 72457efe2..45190c3b5 100644 --- a/tests/Switzerland/Glarus/BerchtoldsTagTest.php +++ b/tests/Switzerland/Glarus/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends GlarusBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Glarus/ChristmasDayTest.php b/tests/Switzerland/Glarus/ChristmasDayTest.php index 030e65436..485a48c8c 100644 --- a/tests/Switzerland/Glarus/ChristmasDayTest.php +++ b/tests/Switzerland/Glarus/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends GlarusBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Glarus/EasterMondayTest.php b/tests/Switzerland/Glarus/EasterMondayTest.php index ac2ff5412..2a1a7386d 100644 --- a/tests/Switzerland/Glarus/EasterMondayTest.php +++ b/tests/Switzerland/Glarus/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends GlarusBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Glarus/GoodFridayTest.php b/tests/Switzerland/Glarus/GoodFridayTest.php index c1270beab..4efe8e8e6 100644 --- a/tests/Switzerland/Glarus/GoodFridayTest.php +++ b/tests/Switzerland/Glarus/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends GlarusBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Glarus/NafelserFahrtTest.php b/tests/Switzerland/Glarus/NafelserFahrtTest.php index a609740dc..a428dec8e 100644 --- a/tests/Switzerland/Glarus/NafelserFahrtTest.php +++ b/tests/Switzerland/Glarus/NafelserFahrtTest.php @@ -39,7 +39,7 @@ class NafelserFahrtTest extends GlarusBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testNafelserFahrtOnAfter1389() + public function testNafelserFahrtOnAfter1389(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $date = new DateTime('First Thursday of ' . $year . '-04', new DateTimeZone(self::TIMEZONE)); @@ -51,7 +51,7 @@ public function testNafelserFahrtOnAfter1389() * Tests Näfelser Fahrt before 1389 * @throws ReflectionException */ - public function testNafelserFahrtBefore1389() + public function testNafelserFahrtBefore1389(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Glarus/NewYearsDayTest.php b/tests/Switzerland/Glarus/NewYearsDayTest.php index 310c7a22b..4b34d50a8 100644 --- a/tests/Switzerland/Glarus/NewYearsDayTest.php +++ b/tests/Switzerland/Glarus/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends GlarusBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Glarus/PentecostMondayTest.php b/tests/Switzerland/Glarus/PentecostMondayTest.php index cea53e82c..1c794d275 100644 --- a/tests/Switzerland/Glarus/PentecostMondayTest.php +++ b/tests/Switzerland/Glarus/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends GlarusBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Glarus/StStephensDayTest.php b/tests/Switzerland/Glarus/StStephensDayTest.php index 2d56b8b09..2bc9c08a4 100644 --- a/tests/Switzerland/Glarus/StStephensDayTest.php +++ b/tests/Switzerland/Glarus/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends GlarusBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Grisons/AscensionDayTest.php b/tests/Switzerland/Grisons/AscensionDayTest.php index 6d3b6fa5f..17553fb59 100644 --- a/tests/Switzerland/Grisons/AscensionDayTest.php +++ b/tests/Switzerland/Grisons/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends GrisonsBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Grisons/ChristmasDayTest.php b/tests/Switzerland/Grisons/ChristmasDayTest.php index 59b27220b..9707e6320 100644 --- a/tests/Switzerland/Grisons/ChristmasDayTest.php +++ b/tests/Switzerland/Grisons/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends GrisonsBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Grisons/EasterMondayTest.php b/tests/Switzerland/Grisons/EasterMondayTest.php index 575bc3900..3b1e83261 100644 --- a/tests/Switzerland/Grisons/EasterMondayTest.php +++ b/tests/Switzerland/Grisons/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends GrisonsBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Grisons/GoodFridayTest.php b/tests/Switzerland/Grisons/GoodFridayTest.php index 9df2b15eb..77498474d 100644 --- a/tests/Switzerland/Grisons/GoodFridayTest.php +++ b/tests/Switzerland/Grisons/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends GrisonsBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Grisons/NewYearsDayTest.php b/tests/Switzerland/Grisons/NewYearsDayTest.php index f812616c4..672d14cdc 100644 --- a/tests/Switzerland/Grisons/NewYearsDayTest.php +++ b/tests/Switzerland/Grisons/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends GrisonsBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Grisons/PentecostMondayTest.php b/tests/Switzerland/Grisons/PentecostMondayTest.php index 576932ee2..b926dba9d 100644 --- a/tests/Switzerland/Grisons/PentecostMondayTest.php +++ b/tests/Switzerland/Grisons/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends GrisonsBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Grisons/StStephensDayTest.php b/tests/Switzerland/Grisons/StStephensDayTest.php index 949547bee..1fb961729 100644 --- a/tests/Switzerland/Grisons/StStephensDayTest.php +++ b/tests/Switzerland/Grisons/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends GrisonsBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Jura/AllSaintsDayTest.php b/tests/Switzerland/Jura/AllSaintsDayTest.php index 805a96900..72fc49414 100644 --- a/tests/Switzerland/Jura/AllSaintsDayTest.php +++ b/tests/Switzerland/Jura/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends JuraBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Jura/AscensionDayTest.php b/tests/Switzerland/Jura/AscensionDayTest.php index c99dff731..ffa307f99 100644 --- a/tests/Switzerland/Jura/AscensionDayTest.php +++ b/tests/Switzerland/Jura/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends JuraBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Jura/AssumptionOfMaryTest.php b/tests/Switzerland/Jura/AssumptionOfMaryTest.php index c7935df78..f1ca4d1cd 100644 --- a/tests/Switzerland/Jura/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Jura/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends JuraBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Jura/BerchtoldsTagTest.php b/tests/Switzerland/Jura/BerchtoldsTagTest.php index de6de0d71..33e604800 100644 --- a/tests/Switzerland/Jura/BerchtoldsTagTest.php +++ b/tests/Switzerland/Jura/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends JuraBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Jura/ChristmasDayTest.php b/tests/Switzerland/Jura/ChristmasDayTest.php index 2a060b2a2..e26c7d8fd 100644 --- a/tests/Switzerland/Jura/ChristmasDayTest.php +++ b/tests/Switzerland/Jura/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends JuraBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Jura/CorpusChristiTest.php b/tests/Switzerland/Jura/CorpusChristiTest.php index 0ef1690e5..f0390e1a0 100644 --- a/tests/Switzerland/Jura/CorpusChristiTest.php +++ b/tests/Switzerland/Jura/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends JuraBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Jura/EasterMondayTest.php b/tests/Switzerland/Jura/EasterMondayTest.php index 1129394cf..328a5e044 100644 --- a/tests/Switzerland/Jura/EasterMondayTest.php +++ b/tests/Switzerland/Jura/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends JuraBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Jura/GoodFridayTest.php b/tests/Switzerland/Jura/GoodFridayTest.php index 44a55a8ec..369d83334 100644 --- a/tests/Switzerland/Jura/GoodFridayTest.php +++ b/tests/Switzerland/Jura/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends JuraBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Jura/NewYearsDayTest.php b/tests/Switzerland/Jura/NewYearsDayTest.php index e46010045..9c4b05505 100644 --- a/tests/Switzerland/Jura/NewYearsDayTest.php +++ b/tests/Switzerland/Jura/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends JuraBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Jura/PentecostMondayTest.php b/tests/Switzerland/Jura/PentecostMondayTest.php index 1414d4949..d57c45c87 100644 --- a/tests/Switzerland/Jura/PentecostMondayTest.php +++ b/tests/Switzerland/Jura/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends JuraBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Jura/PlebisciteJurassienTest.php b/tests/Switzerland/Jura/PlebisciteJurassienTest.php index 82eb56b4f..9116ab876 100644 --- a/tests/Switzerland/Jura/PlebisciteJurassienTest.php +++ b/tests/Switzerland/Jura/PlebisciteJurassienTest.php @@ -39,7 +39,7 @@ class PlebisciteJurassienTest extends JuraBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testInstaurationRepubliqueOnAfter1975() + public function testInstaurationRepubliqueOnAfter1975(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testInstaurationRepubliqueOnAfter1975() * Tests Plébiscite jurassien before 1975. * @throws ReflectionException */ - public function testInstaurationRepubliqueBefore1975() + public function testInstaurationRepubliqueBefore1975(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Switzerland/Jura/WorkersDayTest.php b/tests/Switzerland/Jura/WorkersDayTest.php index ac374fa95..0377d7e64 100644 --- a/tests/Switzerland/Jura/WorkersDayTest.php +++ b/tests/Switzerland/Jura/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends JuraBaseTestCase implements YasumiTestCaseInterface * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Lucerne/AllSaintsDayTest.php b/tests/Switzerland/Lucerne/AllSaintsDayTest.php index 75c095706..3596cdaae 100644 --- a/tests/Switzerland/Lucerne/AllSaintsDayTest.php +++ b/tests/Switzerland/Lucerne/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends LucerneBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Lucerne/AscensionDayTest.php b/tests/Switzerland/Lucerne/AscensionDayTest.php index c873db564..486a750ba 100644 --- a/tests/Switzerland/Lucerne/AscensionDayTest.php +++ b/tests/Switzerland/Lucerne/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends LucerneBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php b/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php index 43f14d9f5..eb23521be 100644 --- a/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends LucerneBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Lucerne/BerchtoldsTagTest.php b/tests/Switzerland/Lucerne/BerchtoldsTagTest.php index 0c19c9acc..fde0f772b 100644 --- a/tests/Switzerland/Lucerne/BerchtoldsTagTest.php +++ b/tests/Switzerland/Lucerne/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends LucerneBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Lucerne/ChristmasDayTest.php b/tests/Switzerland/Lucerne/ChristmasDayTest.php index 3f6e9a5a9..3164ef9b8 100644 --- a/tests/Switzerland/Lucerne/ChristmasDayTest.php +++ b/tests/Switzerland/Lucerne/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends LucerneBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Lucerne/CorpusChristiTest.php b/tests/Switzerland/Lucerne/CorpusChristiTest.php index 99bb81dfe..14dace6d3 100644 --- a/tests/Switzerland/Lucerne/CorpusChristiTest.php +++ b/tests/Switzerland/Lucerne/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends LucerneBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Lucerne/EasterMondayTest.php b/tests/Switzerland/Lucerne/EasterMondayTest.php index 164d85b32..3a8f1060b 100644 --- a/tests/Switzerland/Lucerne/EasterMondayTest.php +++ b/tests/Switzerland/Lucerne/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends LucerneBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Lucerne/GoodFridayTest.php b/tests/Switzerland/Lucerne/GoodFridayTest.php index b973be671..c6895d640 100644 --- a/tests/Switzerland/Lucerne/GoodFridayTest.php +++ b/tests/Switzerland/Lucerne/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends LucerneBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php b/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php index 1fb3ba57d..a8b129b69 100644 --- a/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends LucerneBaseTestCase implements YasumiTest * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Lucerne/NewYearsDayTest.php b/tests/Switzerland/Lucerne/NewYearsDayTest.php index 4400d5a46..1975a72ea 100644 --- a/tests/Switzerland/Lucerne/NewYearsDayTest.php +++ b/tests/Switzerland/Lucerne/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends LucerneBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Lucerne/PentecostMondayTest.php b/tests/Switzerland/Lucerne/PentecostMondayTest.php index 174e5e552..850eb768a 100644 --- a/tests/Switzerland/Lucerne/PentecostMondayTest.php +++ b/tests/Switzerland/Lucerne/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends LucerneBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Lucerne/StStephensDayTest.php b/tests/Switzerland/Lucerne/StStephensDayTest.php index e55b1b1f9..3c461bbbd 100644 --- a/tests/Switzerland/Lucerne/StStephensDayTest.php +++ b/tests/Switzerland/Lucerne/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends LucerneBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Neuchatel/AscensionDayTest.php b/tests/Switzerland/Neuchatel/AscensionDayTest.php index e3da6de96..6bbdbb652 100644 --- a/tests/Switzerland/Neuchatel/AscensionDayTest.php +++ b/tests/Switzerland/Neuchatel/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends NeuchatelBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Neuchatel/BerchtoldsTagTest.php b/tests/Switzerland/Neuchatel/BerchtoldsTagTest.php index 8c3db3377..26335be18 100644 --- a/tests/Switzerland/Neuchatel/BerchtoldsTagTest.php +++ b/tests/Switzerland/Neuchatel/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends NeuchatelBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Neuchatel/BettagsMontagTest.php b/tests/Switzerland/Neuchatel/BettagsMontagTest.php index 2f817bc9a..f32d7f289 100644 --- a/tests/Switzerland/Neuchatel/BettagsMontagTest.php +++ b/tests/Switzerland/Neuchatel/BettagsMontagTest.php @@ -36,7 +36,7 @@ class BettagsMontagTest extends NeuchatelBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testBettagsMontagOnAfter1832() + public function testBettagsMontagOnAfter1832(): void { $year = $this->generateRandomYear(1832); @@ -52,7 +52,7 @@ public function testBettagsMontagOnAfter1832() * Tests Bettags Montag before 1832 * @throws ReflectionException */ - public function testBettagsMontagBefore1832() + public function testBettagsMontagBefore1832(): void { $year = $this->generateRandomYear(1000, 1831); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Neuchatel/ChristmasDayTest.php b/tests/Switzerland/Neuchatel/ChristmasDayTest.php index 72a6405de..002849a41 100644 --- a/tests/Switzerland/Neuchatel/ChristmasDayTest.php +++ b/tests/Switzerland/Neuchatel/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends NeuchatelBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Neuchatel/EasterMondayTest.php b/tests/Switzerland/Neuchatel/EasterMondayTest.php index b2d80b33a..572a09f3a 100644 --- a/tests/Switzerland/Neuchatel/EasterMondayTest.php +++ b/tests/Switzerland/Neuchatel/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends NeuchatelBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Neuchatel/GoodFridayTest.php b/tests/Switzerland/Neuchatel/GoodFridayTest.php index 8541431f5..2b347ff68 100644 --- a/tests/Switzerland/Neuchatel/GoodFridayTest.php +++ b/tests/Switzerland/Neuchatel/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends NeuchatelBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php b/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php index 6a5f5b845..3caf0e4e3 100644 --- a/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php +++ b/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php @@ -39,7 +39,7 @@ class InstaurationRepubliqueTest extends NeuchatelBaseTestCase implements Yasumi * @throws Exception * @throws ReflectionException */ - public function testInstaurationRepubliqueOnAfter1849() + public function testInstaurationRepubliqueOnAfter1849(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testInstaurationRepubliqueOnAfter1849() * Tests Instauration de la République before 1849. * @throws ReflectionException */ - public function testInstaurationRepubliqueBefore1849() + public function testInstaurationRepubliqueBefore1849(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Switzerland/Neuchatel/NewYearsDayTest.php b/tests/Switzerland/Neuchatel/NewYearsDayTest.php index 96feaa908..679eb4dea 100644 --- a/tests/Switzerland/Neuchatel/NewYearsDayTest.php +++ b/tests/Switzerland/Neuchatel/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends NeuchatelBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Neuchatel/PentecostMondayTest.php b/tests/Switzerland/Neuchatel/PentecostMondayTest.php index 353eadbf6..0a9175bc5 100644 --- a/tests/Switzerland/Neuchatel/PentecostMondayTest.php +++ b/tests/Switzerland/Neuchatel/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends NeuchatelBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Neuchatel/WorkersDayTest.php b/tests/Switzerland/Neuchatel/WorkersDayTest.php index ba697b001..863caf8c1 100644 --- a/tests/Switzerland/Neuchatel/WorkersDayTest.php +++ b/tests/Switzerland/Neuchatel/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends NeuchatelBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Nidwalden/AllSaintsDayTest.php b/tests/Switzerland/Nidwalden/AllSaintsDayTest.php index 9ae0656de..f6e95bdad 100644 --- a/tests/Switzerland/Nidwalden/AllSaintsDayTest.php +++ b/tests/Switzerland/Nidwalden/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/AscensionDayTest.php b/tests/Switzerland/Nidwalden/AscensionDayTest.php index e2d18cddf..3a1417aa6 100644 --- a/tests/Switzerland/Nidwalden/AscensionDayTest.php +++ b/tests/Switzerland/Nidwalden/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php b/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php index 4c1fb130e..a9afcb21c 100644 --- a/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends NidwaldenBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/ChristmasDayTest.php b/tests/Switzerland/Nidwalden/ChristmasDayTest.php index 8dad841db..eb8388985 100644 --- a/tests/Switzerland/Nidwalden/ChristmasDayTest.php +++ b/tests/Switzerland/Nidwalden/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/CorpusChristiTest.php b/tests/Switzerland/Nidwalden/CorpusChristiTest.php index a1851b36b..5c268986a 100644 --- a/tests/Switzerland/Nidwalden/CorpusChristiTest.php +++ b/tests/Switzerland/Nidwalden/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends NidwaldenBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Nidwalden/EasterMondayTest.php b/tests/Switzerland/Nidwalden/EasterMondayTest.php index 18a79bb70..23062099a 100644 --- a/tests/Switzerland/Nidwalden/EasterMondayTest.php +++ b/tests/Switzerland/Nidwalden/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends NidwaldenBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Nidwalden/GoodFridayTest.php b/tests/Switzerland/Nidwalden/GoodFridayTest.php index 868fc70d8..e9fa7b191 100644 --- a/tests/Switzerland/Nidwalden/GoodFridayTest.php +++ b/tests/Switzerland/Nidwalden/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends NidwaldenBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php b/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php index 687cb3046..a50b49731 100644 --- a/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends NidwaldenBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/NewYearsDayTest.php b/tests/Switzerland/Nidwalden/NewYearsDayTest.php index 4cc7db69c..af96cec89 100644 --- a/tests/Switzerland/Nidwalden/NewYearsDayTest.php +++ b/tests/Switzerland/Nidwalden/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/PentecostMondayTest.php b/tests/Switzerland/Nidwalden/PentecostMondayTest.php index 18b6685a3..3e4fdedea 100644 --- a/tests/Switzerland/Nidwalden/PentecostMondayTest.php +++ b/tests/Switzerland/Nidwalden/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends NidwaldenBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Nidwalden/StJosephDayTest.php b/tests/Switzerland/Nidwalden/StJosephDayTest.php index 06bdeee7b..c4a668fcd 100644 --- a/tests/Switzerland/Nidwalden/StJosephDayTest.php +++ b/tests/Switzerland/Nidwalden/StJosephDayTest.php @@ -41,7 +41,7 @@ class StJosephDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testStJosephDay($year, $expected) + public function testStJosephDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Nidwalden/StStephensDayTest.php b/tests/Switzerland/Nidwalden/StStephensDayTest.php index 2537d130d..0e3db994c 100644 --- a/tests/Switzerland/Nidwalden/StStephensDayTest.php +++ b/tests/Switzerland/Nidwalden/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends NidwaldenBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/AllSaintsDayTest.php b/tests/Switzerland/Obwalden/AllSaintsDayTest.php index ed729f031..b2ed838e6 100644 --- a/tests/Switzerland/Obwalden/AllSaintsDayTest.php +++ b/tests/Switzerland/Obwalden/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/AscensionDayTest.php b/tests/Switzerland/Obwalden/AscensionDayTest.php index 7d38c2265..d1acae328 100644 --- a/tests/Switzerland/Obwalden/AscensionDayTest.php +++ b/tests/Switzerland/Obwalden/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php b/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php index d8bbacef8..c81a6bddf 100644 --- a/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends ObwaldenBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/BerchtoldsTagTest.php b/tests/Switzerland/Obwalden/BerchtoldsTagTest.php index 44db78d5d..625981079 100644 --- a/tests/Switzerland/Obwalden/BerchtoldsTagTest.php +++ b/tests/Switzerland/Obwalden/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends ObwaldenBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php index bf1a5b315..645c9142e 100644 --- a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php +++ b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php @@ -35,7 +35,7 @@ class BruderKlausenFestTest extends ObwaldenBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testBruderKlausenFestOnAfter1947() + public function testBruderKlausenFestOnAfter1947(): void { $year = $this->generateRandomYear(1947); $date = new DateTime($year . '-09-25', new DateTimeZone(self::TIMEZONE)); @@ -50,7 +50,7 @@ public function testBruderKlausenFestOnAfter1947() * @throws ReflectionException * @throws Exception */ - public function testBruderKlausenFestBetween1649And1946() + public function testBruderKlausenFestBetween1649And1946(): void { $year = $this->generateRandomYear(1649, 1946); $date = new DateTime($year . '-09-21', new DateTimeZone(self::TIMEZONE)); @@ -63,7 +63,7 @@ public function testBruderKlausenFestBetween1649And1946() * Tests Bruder-Klausen-Fest before 1648 * @throws ReflectionException */ - public function testBruderKlausenFestBefore1648() + public function testBruderKlausenFestBefore1648(): void { $year = $this->generateRandomYear(1000, 1648); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Obwalden/ChristmasDayTest.php b/tests/Switzerland/Obwalden/ChristmasDayTest.php index 59bd5581b..f137263bf 100644 --- a/tests/Switzerland/Obwalden/ChristmasDayTest.php +++ b/tests/Switzerland/Obwalden/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/CorpusChristiTest.php b/tests/Switzerland/Obwalden/CorpusChristiTest.php index 2f5b58e7b..47af4cf33 100644 --- a/tests/Switzerland/Obwalden/CorpusChristiTest.php +++ b/tests/Switzerland/Obwalden/CorpusChristiTest.php @@ -36,7 +36,7 @@ class CorpusChristiTest extends ObwaldenBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Obwalden/EasterMondayTest.php b/tests/Switzerland/Obwalden/EasterMondayTest.php index 9013287c5..956eba82a 100644 --- a/tests/Switzerland/Obwalden/EasterMondayTest.php +++ b/tests/Switzerland/Obwalden/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Obwalden/GoodFridayTest.php b/tests/Switzerland/Obwalden/GoodFridayTest.php index 203b52b8f..35e14d64d 100644 --- a/tests/Switzerland/Obwalden/GoodFridayTest.php +++ b/tests/Switzerland/Obwalden/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php b/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php index 3c1965aa5..0139efebf 100644 --- a/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends ObwaldenBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/NewYearsDayTest.php b/tests/Switzerland/Obwalden/NewYearsDayTest.php index ca078c188..6c59d5543 100644 --- a/tests/Switzerland/Obwalden/NewYearsDayTest.php +++ b/tests/Switzerland/Obwalden/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ObwaldenBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Obwalden/PentecostMondayTest.php b/tests/Switzerland/Obwalden/PentecostMondayTest.php index b40019aa9..75550db23 100644 --- a/tests/Switzerland/Obwalden/PentecostMondayTest.php +++ b/tests/Switzerland/Obwalden/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends ObwaldenBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Obwalden/StStephensDayTest.php b/tests/Switzerland/Obwalden/StStephensDayTest.php index e5fb18009..551e26fc0 100644 --- a/tests/Switzerland/Obwalden/StStephensDayTest.php +++ b/tests/Switzerland/Obwalden/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends ObwaldenBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schaffhausen/AscensionDayTest.php b/tests/Switzerland/Schaffhausen/AscensionDayTest.php index f0815f36b..646efe8cd 100644 --- a/tests/Switzerland/Schaffhausen/AscensionDayTest.php +++ b/tests/Switzerland/Schaffhausen/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends SchaffhausenBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php b/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php index 8dc7243d8..38a3ccb6d 100644 --- a/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php +++ b/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends SchaffhausenBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php index b0a64a436..ae4f0caca 100644 --- a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php +++ b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends SchaffhausenBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schaffhausen/EasterMondayTest.php b/tests/Switzerland/Schaffhausen/EasterMondayTest.php index 133a3183b..a649063c0 100644 --- a/tests/Switzerland/Schaffhausen/EasterMondayTest.php +++ b/tests/Switzerland/Schaffhausen/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends SchaffhausenBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Schaffhausen/GoodFridayTest.php b/tests/Switzerland/Schaffhausen/GoodFridayTest.php index 501c09416..184e7679d 100644 --- a/tests/Switzerland/Schaffhausen/GoodFridayTest.php +++ b/tests/Switzerland/Schaffhausen/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends SchaffhausenBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Schaffhausen/NewYearsDayTest.php b/tests/Switzerland/Schaffhausen/NewYearsDayTest.php index 17bae79b2..eb60ab48c 100644 --- a/tests/Switzerland/Schaffhausen/NewYearsDayTest.php +++ b/tests/Switzerland/Schaffhausen/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends SchaffhausenBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schaffhausen/PentecostMondayTest.php b/tests/Switzerland/Schaffhausen/PentecostMondayTest.php index 6530521cf..3c7f0d7b1 100644 --- a/tests/Switzerland/Schaffhausen/PentecostMondayTest.php +++ b/tests/Switzerland/Schaffhausen/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends SchaffhausenBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Schaffhausen/StStephensDayTest.php b/tests/Switzerland/Schaffhausen/StStephensDayTest.php index e1cb276f9..46613f967 100644 --- a/tests/Switzerland/Schaffhausen/StStephensDayTest.php +++ b/tests/Switzerland/Schaffhausen/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends SchaffhausenBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schaffhausen/WorkersDayTest.php b/tests/Switzerland/Schaffhausen/WorkersDayTest.php index 565aacce6..6f3e3dbe6 100644 --- a/tests/Switzerland/Schaffhausen/WorkersDayTest.php +++ b/tests/Switzerland/Schaffhausen/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends SchaffhausenBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Schwyz/AllSaintsDayTest.php b/tests/Switzerland/Schwyz/AllSaintsDayTest.php index b2e20eb09..98032db3d 100644 --- a/tests/Switzerland/Schwyz/AllSaintsDayTest.php +++ b/tests/Switzerland/Schwyz/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/AscensionDayTest.php b/tests/Switzerland/Schwyz/AscensionDayTest.php index 0af3fdc09..bbb5b5605 100644 --- a/tests/Switzerland/Schwyz/AscensionDayTest.php +++ b/tests/Switzerland/Schwyz/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php b/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php index d41825b4b..55c54bf01 100644 --- a/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends SchwyzBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/ChristmasDayTest.php b/tests/Switzerland/Schwyz/ChristmasDayTest.php index dc349e6bc..1f8c98c5d 100644 --- a/tests/Switzerland/Schwyz/ChristmasDayTest.php +++ b/tests/Switzerland/Schwyz/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/CorpusChristiTest.php b/tests/Switzerland/Schwyz/CorpusChristiTest.php index 63843b56b..b7bbf580d 100644 --- a/tests/Switzerland/Schwyz/CorpusChristiTest.php +++ b/tests/Switzerland/Schwyz/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends SchwyzBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Schwyz/EasterMondayTest.php b/tests/Switzerland/Schwyz/EasterMondayTest.php index b687fd774..e5fd0bc6a 100644 --- a/tests/Switzerland/Schwyz/EasterMondayTest.php +++ b/tests/Switzerland/Schwyz/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends SchwyzBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Schwyz/EpiphanyTest.php b/tests/Switzerland/Schwyz/EpiphanyTest.php index 5377937b7..e454edf79 100644 --- a/tests/Switzerland/Schwyz/EpiphanyTest.php +++ b/tests/Switzerland/Schwyz/EpiphanyTest.php @@ -39,7 +39,7 @@ class EpiphanyTest extends SchwyzBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/GoodFridayTest.php b/tests/Switzerland/Schwyz/GoodFridayTest.php index bcbca4f9d..d540994ae 100644 --- a/tests/Switzerland/Schwyz/GoodFridayTest.php +++ b/tests/Switzerland/Schwyz/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends SchwyzBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php b/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php index 41ddf6d2f..769c402de 100644 --- a/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends SchwyzBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/NewYearsDayTest.php b/tests/Switzerland/Schwyz/NewYearsDayTest.php index d45cc11b2..ce51a7045 100644 --- a/tests/Switzerland/Schwyz/NewYearsDayTest.php +++ b/tests/Switzerland/Schwyz/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/PentecostMondayTest.php b/tests/Switzerland/Schwyz/PentecostMondayTest.php index 0ec97e95b..8300aa8ec 100644 --- a/tests/Switzerland/Schwyz/PentecostMondayTest.php +++ b/tests/Switzerland/Schwyz/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends SchwyzBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Schwyz/StJosephDayTest.php b/tests/Switzerland/Schwyz/StJosephDayTest.php index bd0d8189e..fc087ac20 100644 --- a/tests/Switzerland/Schwyz/StJosephDayTest.php +++ b/tests/Switzerland/Schwyz/StJosephDayTest.php @@ -41,7 +41,7 @@ class StJosephDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testStJosephDay($year, $expected) + public function testStJosephDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Schwyz/StStephensDayTest.php b/tests/Switzerland/Schwyz/StStephensDayTest.php index 35d85917e..d47fa0183 100644 --- a/tests/Switzerland/Schwyz/StStephensDayTest.php +++ b/tests/Switzerland/Schwyz/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends SchwyzBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Solothurn/AscensionDayTest.php b/tests/Switzerland/Solothurn/AscensionDayTest.php index e2e6a9eb1..c2cc90223 100644 --- a/tests/Switzerland/Solothurn/AscensionDayTest.php +++ b/tests/Switzerland/Solothurn/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends SolothurnBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Solothurn/BerchtoldsTagTest.php b/tests/Switzerland/Solothurn/BerchtoldsTagTest.php index dacb8597e..ed96799c1 100644 --- a/tests/Switzerland/Solothurn/BerchtoldsTagTest.php +++ b/tests/Switzerland/Solothurn/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends SolothurnBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Solothurn/ChristmasDayTest.php b/tests/Switzerland/Solothurn/ChristmasDayTest.php index 56da040bc..2d0f5cbc7 100644 --- a/tests/Switzerland/Solothurn/ChristmasDayTest.php +++ b/tests/Switzerland/Solothurn/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends SolothurnBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Solothurn/GoodFridayTest.php b/tests/Switzerland/Solothurn/GoodFridayTest.php index 9bd24167d..1a3650e1a 100644 --- a/tests/Switzerland/Solothurn/GoodFridayTest.php +++ b/tests/Switzerland/Solothurn/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends SolothurnBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Solothurn/NewYearsDayTest.php b/tests/Switzerland/Solothurn/NewYearsDayTest.php index f86aa54ee..3d4a978fb 100644 --- a/tests/Switzerland/Solothurn/NewYearsDayTest.php +++ b/tests/Switzerland/Solothurn/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends SolothurnBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/StGallen/AllSaintsDayTest.php b/tests/Switzerland/StGallen/AllSaintsDayTest.php index 3fbda14bf..f2efc188f 100644 --- a/tests/Switzerland/StGallen/AllSaintsDayTest.php +++ b/tests/Switzerland/StGallen/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends StGallenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/StGallen/AscensionDayTest.php b/tests/Switzerland/StGallen/AscensionDayTest.php index c8f9fc958..5f590e3b0 100644 --- a/tests/Switzerland/StGallen/AscensionDayTest.php +++ b/tests/Switzerland/StGallen/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends StGallenBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/StGallen/ChristmasDayTest.php b/tests/Switzerland/StGallen/ChristmasDayTest.php index 4d1d9e35f..76e234274 100644 --- a/tests/Switzerland/StGallen/ChristmasDayTest.php +++ b/tests/Switzerland/StGallen/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends StGallenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/StGallen/EasterMondayTest.php b/tests/Switzerland/StGallen/EasterMondayTest.php index 1fd424b95..ed8cf3891 100644 --- a/tests/Switzerland/StGallen/EasterMondayTest.php +++ b/tests/Switzerland/StGallen/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends StGallenBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/StGallen/GoodFridayTest.php b/tests/Switzerland/StGallen/GoodFridayTest.php index 45e3a4cfe..76cb1a88a 100644 --- a/tests/Switzerland/StGallen/GoodFridayTest.php +++ b/tests/Switzerland/StGallen/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends StGallenBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/StGallen/NewYearsDayTest.php b/tests/Switzerland/StGallen/NewYearsDayTest.php index bc4d9b140..60c52a716 100644 --- a/tests/Switzerland/StGallen/NewYearsDayTest.php +++ b/tests/Switzerland/StGallen/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends StGallenBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/StGallen/PentecostMondayTest.php b/tests/Switzerland/StGallen/PentecostMondayTest.php index ad4ae1272..51ef4ba0d 100644 --- a/tests/Switzerland/StGallen/PentecostMondayTest.php +++ b/tests/Switzerland/StGallen/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends StGallenBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/StGallen/StStephensDayTest.php b/tests/Switzerland/StGallen/StStephensDayTest.php index 8bc7de509..6f17acda4 100644 --- a/tests/Switzerland/StGallen/StStephensDayTest.php +++ b/tests/Switzerland/StGallen/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends StGallenBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/SwissNationalDayTest.php b/tests/Switzerland/SwissNationalDayTest.php index 8a84a3a53..d0170b649 100644 --- a/tests/Switzerland/SwissNationalDayTest.php +++ b/tests/Switzerland/SwissNationalDayTest.php @@ -49,7 +49,7 @@ class SwissNationalDayTest extends SwitzerlandBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testNationalDayOnAfter1994() + public function testNationalDayOnAfter1994(): void { $year = $this->generateRandomYear(self::NATIONAL_ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -66,7 +66,7 @@ public function testNationalDayOnAfter1994() * @throws Exception * @throws ReflectionException */ - public function testNationalDayOnAfter1899() + public function testNationalDayOnAfter1899(): void { $year = $this->generateRandomYear(self::FIRST_ESTABLISHMENT_YEAR, self::NATIONAL_ESTABLISHMENT_YEAR - 1); $this->assertHoliday( @@ -84,7 +84,7 @@ public function testNationalDayOnAfter1899() * @throws Exception * @throws ReflectionException */ - public function testNationalDayOn1891() + public function testNationalDayOn1891(): void { $year = self::FIRST_OBSERVANCE_YEAR; $this->assertHoliday( @@ -100,7 +100,7 @@ public function testNationalDayOn1891() * Tests National Day before 1891. * @throws ReflectionException */ - public function testNationalDayBefore1891() + public function testNationalDayBefore1891(): void { $this->assertNotHoliday( self::REGION, @@ -113,7 +113,7 @@ public function testNationalDayBefore1891() * Tests National Day between 1891 and 1899. * @throws ReflectionException */ - public function testNationalDayBetween1891And1899() + public function testNationalDayBetween1891And1899(): void { $year = $this->generateRandomYear(self::FIRST_OBSERVANCE_YEAR + 1, self::FIRST_ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Thurgau/AscensionDayTest.php b/tests/Switzerland/Thurgau/AscensionDayTest.php index 620f1477f..f196bc1ef 100644 --- a/tests/Switzerland/Thurgau/AscensionDayTest.php +++ b/tests/Switzerland/Thurgau/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends ThurgauBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Thurgau/BerchtoldsTagTest.php b/tests/Switzerland/Thurgau/BerchtoldsTagTest.php index dc1e0f96a..1db73effa 100644 --- a/tests/Switzerland/Thurgau/BerchtoldsTagTest.php +++ b/tests/Switzerland/Thurgau/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends ThurgauBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Thurgau/ChristmasDayTest.php b/tests/Switzerland/Thurgau/ChristmasDayTest.php index a4dfece0e..0983673a3 100644 --- a/tests/Switzerland/Thurgau/ChristmasDayTest.php +++ b/tests/Switzerland/Thurgau/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends ThurgauBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Thurgau/EasterMondayTest.php b/tests/Switzerland/Thurgau/EasterMondayTest.php index d50eeb177..e54b88d65 100644 --- a/tests/Switzerland/Thurgau/EasterMondayTest.php +++ b/tests/Switzerland/Thurgau/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends ThurgauBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Thurgau/GoodFridayTest.php b/tests/Switzerland/Thurgau/GoodFridayTest.php index ac0e6e3a5..deb6fa858 100644 --- a/tests/Switzerland/Thurgau/GoodFridayTest.php +++ b/tests/Switzerland/Thurgau/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends ThurgauBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Thurgau/NewYearsDayTest.php b/tests/Switzerland/Thurgau/NewYearsDayTest.php index 30641f7c4..a6e8fc604 100644 --- a/tests/Switzerland/Thurgau/NewYearsDayTest.php +++ b/tests/Switzerland/Thurgau/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ThurgauBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Thurgau/PentecostMondayTest.php b/tests/Switzerland/Thurgau/PentecostMondayTest.php index e00d1d592..8a990153e 100644 --- a/tests/Switzerland/Thurgau/PentecostMondayTest.php +++ b/tests/Switzerland/Thurgau/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends ThurgauBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Thurgau/StStephensDayTest.php b/tests/Switzerland/Thurgau/StStephensDayTest.php index f0e5cf021..5ae1053f1 100644 --- a/tests/Switzerland/Thurgau/StStephensDayTest.php +++ b/tests/Switzerland/Thurgau/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends ThurgauBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Thurgau/WorkersDayTest.php b/tests/Switzerland/Thurgau/WorkersDayTest.php index f547472cc..df6e46715 100644 --- a/tests/Switzerland/Thurgau/WorkersDayTest.php +++ b/tests/Switzerland/Thurgau/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends ThurgauBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Ticino/AllSaintsDayTest.php b/tests/Switzerland/Ticino/AllSaintsDayTest.php index 28025bede..1d2bca5ed 100644 --- a/tests/Switzerland/Ticino/AllSaintsDayTest.php +++ b/tests/Switzerland/Ticino/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends TicinoBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/AscensionDayTest.php b/tests/Switzerland/Ticino/AscensionDayTest.php index cf69df96b..e537bb3d0 100644 --- a/tests/Switzerland/Ticino/AscensionDayTest.php +++ b/tests/Switzerland/Ticino/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends TicinoBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Ticino/AssumptionOfMaryTest.php b/tests/Switzerland/Ticino/AssumptionOfMaryTest.php index ac3160a19..092068a13 100644 --- a/tests/Switzerland/Ticino/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Ticino/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends TicinoBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/ChristmasDayTest.php b/tests/Switzerland/Ticino/ChristmasDayTest.php index cd972d0c1..78d00c2e2 100644 --- a/tests/Switzerland/Ticino/ChristmasDayTest.php +++ b/tests/Switzerland/Ticino/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends TicinoBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/CorpusChristiTest.php b/tests/Switzerland/Ticino/CorpusChristiTest.php index f4a827f4e..5ada6d17a 100644 --- a/tests/Switzerland/Ticino/CorpusChristiTest.php +++ b/tests/Switzerland/Ticino/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends TicinoBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Ticino/EasterMondayTest.php b/tests/Switzerland/Ticino/EasterMondayTest.php index 89a7b5ac1..8424bb109 100644 --- a/tests/Switzerland/Ticino/EasterMondayTest.php +++ b/tests/Switzerland/Ticino/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends TicinoBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Ticino/EpiphanyTest.php b/tests/Switzerland/Ticino/EpiphanyTest.php index e80e29b33..35d628b9b 100644 --- a/tests/Switzerland/Ticino/EpiphanyTest.php +++ b/tests/Switzerland/Ticino/EpiphanyTest.php @@ -39,7 +39,7 @@ class EpiphanyTest extends TicinoBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/ImmaculateConceptionTest.php b/tests/Switzerland/Ticino/ImmaculateConceptionTest.php index 9c1e702c1..c386b0e5b 100644 --- a/tests/Switzerland/Ticino/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Ticino/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends TicinoBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/NewYearsDayTest.php b/tests/Switzerland/Ticino/NewYearsDayTest.php index ef6cfb559..9c049616a 100644 --- a/tests/Switzerland/Ticino/NewYearsDayTest.php +++ b/tests/Switzerland/Ticino/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends TicinoBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/PentecostMondayTest.php b/tests/Switzerland/Ticino/PentecostMondayTest.php index 1abd4e2d7..92cabd8dd 100644 --- a/tests/Switzerland/Ticino/PentecostMondayTest.php +++ b/tests/Switzerland/Ticino/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends TicinoBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Ticino/StJosephDayTest.php b/tests/Switzerland/Ticino/StJosephDayTest.php index 8a0f01ea5..6b745b59f 100644 --- a/tests/Switzerland/Ticino/StJosephDayTest.php +++ b/tests/Switzerland/Ticino/StJosephDayTest.php @@ -41,7 +41,7 @@ class StJosephDayTest extends TicinoBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testStJosephDay($year, $expected) + public function testStJosephDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/StPeterPaulTest.php b/tests/Switzerland/Ticino/StPeterPaulTest.php index 3313aff8f..e7f98abf2 100644 --- a/tests/Switzerland/Ticino/StPeterPaulTest.php +++ b/tests/Switzerland/Ticino/StPeterPaulTest.php @@ -39,7 +39,7 @@ class StPeterPaulTest extends TicinoBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testStPeterPaul($year, $expected) + public function testStPeterPaul($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/StStephensDayTest.php b/tests/Switzerland/Ticino/StStephensDayTest.php index 52434518e..97696fb73 100644 --- a/tests/Switzerland/Ticino/StStephensDayTest.php +++ b/tests/Switzerland/Ticino/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends TicinoBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Ticino/WorkersDayTest.php b/tests/Switzerland/Ticino/WorkersDayTest.php index 1b6008e73..d45bae3ec 100644 --- a/tests/Switzerland/Ticino/WorkersDayTest.php +++ b/tests/Switzerland/Ticino/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends TicinoBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Switzerland/Uri/AllSaintsDayTest.php b/tests/Switzerland/Uri/AllSaintsDayTest.php index d5e9555ff..98d94efdd 100644 --- a/tests/Switzerland/Uri/AllSaintsDayTest.php +++ b/tests/Switzerland/Uri/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends UriBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/AscensionDayTest.php b/tests/Switzerland/Uri/AscensionDayTest.php index 235a8e48a..5f617494e 100644 --- a/tests/Switzerland/Uri/AscensionDayTest.php +++ b/tests/Switzerland/Uri/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends UriBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Uri/AssumptionOfMaryTest.php b/tests/Switzerland/Uri/AssumptionOfMaryTest.php index 04341fb0b..5eee7fde4 100644 --- a/tests/Switzerland/Uri/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Uri/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends UriBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/ChristmasDayTest.php b/tests/Switzerland/Uri/ChristmasDayTest.php index 89cf00200..736c36b5c 100644 --- a/tests/Switzerland/Uri/ChristmasDayTest.php +++ b/tests/Switzerland/Uri/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends UriBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/CorpusChristiTest.php b/tests/Switzerland/Uri/CorpusChristiTest.php index 3327e4297..a26834d1d 100644 --- a/tests/Switzerland/Uri/CorpusChristiTest.php +++ b/tests/Switzerland/Uri/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends UriBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Uri/EasterMondayTest.php b/tests/Switzerland/Uri/EasterMondayTest.php index abc55ee1e..f69e47075 100644 --- a/tests/Switzerland/Uri/EasterMondayTest.php +++ b/tests/Switzerland/Uri/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends UriBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Uri/EpiphanyTest.php b/tests/Switzerland/Uri/EpiphanyTest.php index 7f349aff3..bf4d78355 100644 --- a/tests/Switzerland/Uri/EpiphanyTest.php +++ b/tests/Switzerland/Uri/EpiphanyTest.php @@ -39,7 +39,7 @@ class EpiphanyTest extends UriBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/GoodFridayTest.php b/tests/Switzerland/Uri/GoodFridayTest.php index a2f96202e..37477b48e 100644 --- a/tests/Switzerland/Uri/GoodFridayTest.php +++ b/tests/Switzerland/Uri/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends UriBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Uri/ImmaculateConceptionTest.php b/tests/Switzerland/Uri/ImmaculateConceptionTest.php index bbede4ec9..ca6117e13 100644 --- a/tests/Switzerland/Uri/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Uri/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends UriBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/NewYearsDayTest.php b/tests/Switzerland/Uri/NewYearsDayTest.php index 1d4c626d0..1b1dc390c 100644 --- a/tests/Switzerland/Uri/NewYearsDayTest.php +++ b/tests/Switzerland/Uri/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends UriBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/PentecostMondayTest.php b/tests/Switzerland/Uri/PentecostMondayTest.php index 40f91843a..4dbb946f7 100644 --- a/tests/Switzerland/Uri/PentecostMondayTest.php +++ b/tests/Switzerland/Uri/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends UriBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Uri/StJosephDayTest.php b/tests/Switzerland/Uri/StJosephDayTest.php index 075036be5..75860374a 100644 --- a/tests/Switzerland/Uri/StJosephDayTest.php +++ b/tests/Switzerland/Uri/StJosephDayTest.php @@ -41,7 +41,7 @@ class StJosephDayTest extends UriBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testStJosephDay($year, $expected) + public function testStJosephDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Uri/StStephensDayTest.php b/tests/Switzerland/Uri/StStephensDayTest.php index 35cbf6ba0..abd2f7d82 100644 --- a/tests/Switzerland/Uri/StStephensDayTest.php +++ b/tests/Switzerland/Uri/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends UriBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/AllSaintsDayTest.php b/tests/Switzerland/Valais/AllSaintsDayTest.php index bf4b3c6bb..1ddd8468a 100644 --- a/tests/Switzerland/Valais/AllSaintsDayTest.php +++ b/tests/Switzerland/Valais/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends ValaisBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/AscensionDayTest.php b/tests/Switzerland/Valais/AscensionDayTest.php index a15d202c9..4983af7fb 100644 --- a/tests/Switzerland/Valais/AscensionDayTest.php +++ b/tests/Switzerland/Valais/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends ValaisBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Valais/AssumptionOfMaryTest.php b/tests/Switzerland/Valais/AssumptionOfMaryTest.php index 87bf0b2d8..dda652662 100644 --- a/tests/Switzerland/Valais/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Valais/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends ValaisBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/ChristmasDayTest.php b/tests/Switzerland/Valais/ChristmasDayTest.php index 05f62636f..17d17b2c5 100644 --- a/tests/Switzerland/Valais/ChristmasDayTest.php +++ b/tests/Switzerland/Valais/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends ValaisBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/CorpusChristiTest.php b/tests/Switzerland/Valais/CorpusChristiTest.php index 39c9886d9..d8786ee2c 100644 --- a/tests/Switzerland/Valais/CorpusChristiTest.php +++ b/tests/Switzerland/Valais/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends ValaisBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Valais/ImmaculateConceptionTest.php b/tests/Switzerland/Valais/ImmaculateConceptionTest.php index ce21de4a3..a9ac0bacd 100644 --- a/tests/Switzerland/Valais/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Valais/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends ValaisBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/NewYearsDayTest.php b/tests/Switzerland/Valais/NewYearsDayTest.php index 5fbbfc865..e94f05f65 100644 --- a/tests/Switzerland/Valais/NewYearsDayTest.php +++ b/tests/Switzerland/Valais/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ValaisBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Valais/StJosephDayTest.php b/tests/Switzerland/Valais/StJosephDayTest.php index e6e123fdb..7f777c894 100644 --- a/tests/Switzerland/Valais/StJosephDayTest.php +++ b/tests/Switzerland/Valais/StJosephDayTest.php @@ -41,7 +41,7 @@ class StJosephDayTest extends ValaisBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testStJosephDay($year, $expected) + public function testStJosephDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Vaud/AscensionDayTest.php b/tests/Switzerland/Vaud/AscensionDayTest.php index bc809c43b..54716ceea 100644 --- a/tests/Switzerland/Vaud/AscensionDayTest.php +++ b/tests/Switzerland/Vaud/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends VaudBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Vaud/BerchtoldsTagTest.php b/tests/Switzerland/Vaud/BerchtoldsTagTest.php index 144c04f6c..0f67ae9ce 100644 --- a/tests/Switzerland/Vaud/BerchtoldsTagTest.php +++ b/tests/Switzerland/Vaud/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends VaudBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Vaud/BettagsMontagTest.php b/tests/Switzerland/Vaud/BettagsMontagTest.php index abbae4bb1..9eed9620d 100644 --- a/tests/Switzerland/Vaud/BettagsMontagTest.php +++ b/tests/Switzerland/Vaud/BettagsMontagTest.php @@ -36,7 +36,7 @@ class BettagsMontagTest extends VaudBaseTestCase implements YasumiTestCaseInterf * * @throws Exception */ - public function testBettagsMontagOnAfter1832() + public function testBettagsMontagOnAfter1832(): void { $year = $this->generateRandomYear(1832); @@ -52,7 +52,7 @@ public function testBettagsMontagOnAfter1832() * Tests Bettags Montag before 1832 * @throws ReflectionException */ - public function testBettagsMontagBefore1832() + public function testBettagsMontagBefore1832(): void { $year = $this->generateRandomYear(1000, 1831); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Switzerland/Vaud/ChristmasDayTest.php b/tests/Switzerland/Vaud/ChristmasDayTest.php index 31d12abc7..ccc10f75f 100644 --- a/tests/Switzerland/Vaud/ChristmasDayTest.php +++ b/tests/Switzerland/Vaud/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends VaudBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Vaud/EasterMondayTest.php b/tests/Switzerland/Vaud/EasterMondayTest.php index b80da1047..f143740c3 100644 --- a/tests/Switzerland/Vaud/EasterMondayTest.php +++ b/tests/Switzerland/Vaud/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends VaudBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Vaud/GoodFridayTest.php b/tests/Switzerland/Vaud/GoodFridayTest.php index d783fd9fe..5f755ab83 100644 --- a/tests/Switzerland/Vaud/GoodFridayTest.php +++ b/tests/Switzerland/Vaud/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends VaudBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Vaud/NewYearsDayTest.php b/tests/Switzerland/Vaud/NewYearsDayTest.php index d37522d69..f225e749c 100644 --- a/tests/Switzerland/Vaud/NewYearsDayTest.php +++ b/tests/Switzerland/Vaud/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends VaudBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Vaud/PentecostMondayTest.php b/tests/Switzerland/Vaud/PentecostMondayTest.php index c2e5fe501..ab99495e6 100644 --- a/tests/Switzerland/Vaud/PentecostMondayTest.php +++ b/tests/Switzerland/Vaud/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends VaudBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/AllSaintsDayTest.php b/tests/Switzerland/Zug/AllSaintsDayTest.php index 18fe331f7..3d2b5de88 100644 --- a/tests/Switzerland/Zug/AllSaintsDayTest.php +++ b/tests/Switzerland/Zug/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends ZugBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zug/AscensionDayTest.php b/tests/Switzerland/Zug/AscensionDayTest.php index 6c19a6ba8..b663660a9 100644 --- a/tests/Switzerland/Zug/AscensionDayTest.php +++ b/tests/Switzerland/Zug/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends ZugBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/AssumptionOfMaryTest.php b/tests/Switzerland/Zug/AssumptionOfMaryTest.php index 147bdf6b7..77fbc08e2 100644 --- a/tests/Switzerland/Zug/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Zug/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends ZugBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zug/BerchtoldsTagTest.php b/tests/Switzerland/Zug/BerchtoldsTagTest.php index 7ad270a28..af14b1a15 100644 --- a/tests/Switzerland/Zug/BerchtoldsTagTest.php +++ b/tests/Switzerland/Zug/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends ZugBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Zug/ChristmasDayTest.php b/tests/Switzerland/Zug/ChristmasDayTest.php index f5f070979..fc2afccac 100644 --- a/tests/Switzerland/Zug/ChristmasDayTest.php +++ b/tests/Switzerland/Zug/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends ZugBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zug/CorpusChristiTest.php b/tests/Switzerland/Zug/CorpusChristiTest.php index 1177d9fff..c3711166d 100644 --- a/tests/Switzerland/Zug/CorpusChristiTest.php +++ b/tests/Switzerland/Zug/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends ZugBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/EasterMondayTest.php b/tests/Switzerland/Zug/EasterMondayTest.php index 79adf5377..d52e0b4f9 100644 --- a/tests/Switzerland/Zug/EasterMondayTest.php +++ b/tests/Switzerland/Zug/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends ZugBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/GoodFridayTest.php b/tests/Switzerland/Zug/GoodFridayTest.php index 6923b9890..717f04826 100644 --- a/tests/Switzerland/Zug/GoodFridayTest.php +++ b/tests/Switzerland/Zug/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends ZugBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/ImmaculateConceptionTest.php b/tests/Switzerland/Zug/ImmaculateConceptionTest.php index 676860c77..c6d6dbc46 100644 --- a/tests/Switzerland/Zug/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Zug/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends ZugBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zug/NewYearsDayTest.php b/tests/Switzerland/Zug/NewYearsDayTest.php index be22a7af5..d19138216 100644 --- a/tests/Switzerland/Zug/NewYearsDayTest.php +++ b/tests/Switzerland/Zug/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ZugBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zug/PentecostMondayTest.php b/tests/Switzerland/Zug/PentecostMondayTest.php index 278942c5d..7e6da5c80 100644 --- a/tests/Switzerland/Zug/PentecostMondayTest.php +++ b/tests/Switzerland/Zug/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends ZugBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Zug/StStephensDayTest.php b/tests/Switzerland/Zug/StStephensDayTest.php index 0452a7ba3..bf97119f5 100644 --- a/tests/Switzerland/Zug/StStephensDayTest.php +++ b/tests/Switzerland/Zug/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends ZugBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zurich/AscensionDayTest.php b/tests/Switzerland/Zurich/AscensionDayTest.php index 8c5734575..4a3ad4392 100644 --- a/tests/Switzerland/Zurich/AscensionDayTest.php +++ b/tests/Switzerland/Zurich/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends ZurichBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Switzerland/Zurich/BerchtoldsTagTest.php b/tests/Switzerland/Zurich/BerchtoldsTagTest.php index ad2600d06..b8d0ceeb0 100644 --- a/tests/Switzerland/Zurich/BerchtoldsTagTest.php +++ b/tests/Switzerland/Zurich/BerchtoldsTagTest.php @@ -35,7 +35,7 @@ class BerchtoldsTagTest extends ZurichBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testBerchtoldsTag() + public function testBerchtoldsTag(): void { $year = $this->generateRandomYear(); $date = new DateTime($year . '-01-02', new DateTimeZone(self::TIMEZONE)); diff --git a/tests/Switzerland/Zurich/ChristmasDayTest.php b/tests/Switzerland/Zurich/ChristmasDayTest.php index 5b540fb3d..bba32dd58 100644 --- a/tests/Switzerland/Zurich/ChristmasDayTest.php +++ b/tests/Switzerland/Zurich/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends ZurichBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zurich/EasterMondayTest.php b/tests/Switzerland/Zurich/EasterMondayTest.php index db7dbfba9..d288337ea 100644 --- a/tests/Switzerland/Zurich/EasterMondayTest.php +++ b/tests/Switzerland/Zurich/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends ZurichBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Switzerland/Zurich/GoodFridayTest.php b/tests/Switzerland/Zurich/GoodFridayTest.php index 0de1c1407..b37fb29da 100644 --- a/tests/Switzerland/Zurich/GoodFridayTest.php +++ b/tests/Switzerland/Zurich/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends ZurichBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/Switzerland/Zurich/NewYearsDayTest.php b/tests/Switzerland/Zurich/NewYearsDayTest.php index d754329fc..69317142e 100644 --- a/tests/Switzerland/Zurich/NewYearsDayTest.php +++ b/tests/Switzerland/Zurich/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ZurichBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zurich/PentecostMondayTest.php b/tests/Switzerland/Zurich/PentecostMondayTest.php index 0e89ecb54..d7966a09d 100644 --- a/tests/Switzerland/Zurich/PentecostMondayTest.php +++ b/tests/Switzerland/Zurich/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends ZurichBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Switzerland/Zurich/StStephensDayTest.php b/tests/Switzerland/Zurich/StStephensDayTest.php index aa517d71a..745e3b169 100644 --- a/tests/Switzerland/Zurich/StStephensDayTest.php +++ b/tests/Switzerland/Zurich/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends ZurichBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Switzerland/Zurich/WorkersDayTest.php b/tests/Switzerland/Zurich/WorkersDayTest.php index 361d2cfda..a1afaea21 100644 --- a/tests/Switzerland/Zurich/WorkersDayTest.php +++ b/tests/Switzerland/Zurich/WorkersDayTest.php @@ -40,7 +40,7 @@ class WorkersDayTest extends ZurichBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); From 93808bf132abc04ba1de7bd1bce0a347312057a4 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 21:49:17 +0900 Subject: [PATCH 086/115] Corrected namespace. Signed-off-by: Sacha Telgenhof --- tests/Base/YasumiWorkdayTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Base/YasumiWorkdayTest.php b/tests/Base/YasumiWorkdayTest.php index 58842ca8d..25e57e5eb 100644 --- a/tests/Base/YasumiWorkdayTest.php +++ b/tests/Base/YasumiWorkdayTest.php @@ -10,7 +10,7 @@ * @author Sacha Telgenhof */ -namespace Yasumi\tests; +namespace Yasumi\tests\Base; use DateTime; use DateTimeImmutable; From 18260ebd4c3df4a3e25f3f37b15b6b25ed265f66 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 21:52:06 +0900 Subject: [PATCH 087/115] Added throws tag for error handling. Signed-off-by: Sacha Telgenhof --- tests/Base/HolidayTest.php | 4 ++++ tests/Base/TypographyTest.php | 1 + 2 files changed, 5 insertions(+) diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index c4839c9a6..c1a4eec75 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -91,6 +91,7 @@ public function testHolidayWithDateTimeInterface(): void /** * Tests the getLocales function of the Holiday object. + * @throws Exception */ public function testHolidayGetLocales(): void { @@ -105,6 +106,7 @@ public function testHolidayGetLocales(): void /** * Tests the getName function of the Holiday object without any arguments provided. + * @throws Exception */ public function testHolidayGetNameWithoutArgument(): void { @@ -155,6 +157,8 @@ public function testHolidayGetNameWithoutArgument(): void /** * Tests the getName function of the Holiday object with an explicit list of locales. + * @throws MissingTranslationException + * @throws Exception */ public function testHolidayGetNameWithArgument(): void { diff --git a/tests/Base/TypographyTest.php b/tests/Base/TypographyTest.php index 5b8460ae1..6944fcd49 100644 --- a/tests/Base/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -46,6 +46,7 @@ public function testTranslations($name, $class, $shortName, $locale): void /** * Provides test data for testProvider(). + * @throws \ReflectionException */ public function translationProvider(): array { From 862ca761a7549c10e9f5c5388712144754096f0b Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 21:55:24 +0900 Subject: [PATCH 088/115] Added missing return type. Signed-off-by: Sacha Telgenhof --- tests/Australia/AnzacDayTest.php | 4 ++-- tests/Australia/AustraliaDayTest.php | 4 ++-- .../AustralianCapitalTerritory/CanberraDayTest.php | 2 +- .../EasterSaturdayTest.php | 2 +- .../EasterSundayTest.php | 2 +- .../AustralianCapitalTerritory/LabourDayTest.php | 2 +- .../QueensBirthdayTest.php | 2 +- .../ReconciliationDayTest.php | 2 +- tests/Australia/BoxingDayTest.php | 2 +- tests/Australia/ChristmasDayTest.php | 2 +- tests/Australia/EasterMondayTest.php | 4 ++-- tests/Australia/GoodFridayTest.php | 2 +- tests/Australia/NewSouthWales/BankHolidayTest.php | 2 +- .../Australia/NewSouthWales/EasterSaturdayTest.php | 2 +- tests/Australia/NewSouthWales/EasterSundayTest.php | 2 +- tests/Australia/NewSouthWales/LabourDayTest.php | 2 +- .../Australia/NewSouthWales/QueensBirthdayTest.php | 2 +- tests/Australia/NewYearsDayTest.php | 2 +- .../NorthernTerritory/EasterSaturdayTest.php | 2 +- tests/Australia/NorthernTerritory/MayDayTest.php | 2 +- .../Australia/NorthernTerritory/PicnicDayTest.php | 2 +- .../NorthernTerritory/QueensBirthdayTest.php | 2 +- .../Queensland/Brisbane/PeoplesDayTest.php | 2 +- tests/Australia/Queensland/LabourDayTest.php | 2 +- tests/Australia/Queensland/QueensBirthdayTest.php | 2 +- .../SouthAustralia/AdelaideCupDayTest.php | 2 +- .../Australia/SouthAustralia/ChristmasDayTest.php | 2 +- .../SouthAustralia/EasterSaturdayTest.php | 2 +- tests/Australia/SouthAustralia/LabourDayTest.php | 2 +- .../SouthAustralia/ProclamationDayTest.php | 2 +- .../SouthAustralia/QueensBirthdayTest.php | 2 +- .../Tasmania/CentralNorth/DevonportShowTest.php | 2 +- tests/Australia/Tasmania/EightHourDayTest.php | 2 +- .../FlindersIsland/FlindersIslandShowTest.php | 2 +- .../Tasmania/KingIsland/KingIslandShowTest.php | 2 +- .../Tasmania/Northeast/LauncestonShowTest.php | 2 +- .../Tasmania/Northwest/BurnieShowTest.php | 2 +- .../Tasmania/Northwest/CircularHead/AGFESTTest.php | 2 +- tests/Australia/Tasmania/QueensBirthdayTest.php | 2 +- tests/Australia/Tasmania/RecreationDayTest.php | 2 +- tests/Australia/Tasmania/South/HobartShowTest.php | 2 +- .../Tasmania/South/Southeast/HobartRegattaTest.php | 2 +- .../Australia/Victoria/AFLGrandFinalFridayTest.php | 4 ++-- tests/Australia/Victoria/EasterSaturdayTest.php | 2 +- tests/Australia/Victoria/EasterSundayTest.php | 2 +- tests/Australia/Victoria/LabourDayTest.php | 2 +- tests/Australia/Victoria/MelbourneCupDayTest.php | 2 +- tests/Australia/Victoria/QueensBirthdayTest.php | 2 +- tests/Australia/WesternAustralia/LabourDayTest.php | 2 +- .../WesternAustralia/QueensBirthdayTest.php | 2 +- .../WesternAustralia/WesternAustraliaDayTest.php | 2 +- tests/Austria/AllSaintsDayTest.php | 2 +- tests/Austria/AscensionDayTest.php | 2 +- tests/Austria/AssumptionOfMaryTest.php | 2 +- tests/Austria/Burgenland/stMartinsDayTest.php | 2 +- tests/Austria/Carinthia/PlebisciteDayTest.php | 4 ++-- tests/Austria/Carinthia/StJosephsDayTest.php | 2 +- tests/Austria/ChristmasTest.php | 2 +- tests/Austria/CorpusChristiTest.php | 2 +- tests/Austria/EasterMondayTest.php | 2 +- tests/Austria/EasterTest.php | 2 +- tests/Austria/EpiphanyTest.php | 2 +- tests/Austria/ImmaculateConceptionTest.php | 2 +- tests/Austria/InternationalWorkersDayTest.php | 2 +- tests/Austria/LowerAustria/StLeopoldsDayTest.php | 4 ++-- tests/Austria/NationalDayTest.php | 4 ++-- tests/Austria/NewYearsDayTest.php | 2 +- tests/Austria/PentecostMondayTest.php | 2 +- tests/Austria/PentecostTest.php | 2 +- tests/Austria/Salzburg/StRupertsDayTest.php | 2 +- tests/Austria/SecondChristmasDayTest.php | 2 +- tests/Austria/Styria/StJosephsDayTest.php | 2 +- tests/Austria/Tyrol/StJosephsDayTest.php | 2 +- tests/Austria/UpperAustria/StFloriansDayTest.php | 2 +- tests/Austria/Vienna/StLeopoldsDayTest.php | 4 ++-- tests/Austria/Vorarlberg/StJosephsDayTest.php | 2 +- tests/Belgium/AllSaintsDayTest.php | 2 +- tests/Belgium/ArmisticeDayTest.php | 2 +- tests/Belgium/AscensionDayTest.php | 2 +- tests/Belgium/AssumptionOfMaryTest.php | 2 +- tests/Belgium/ChristmasTest.php | 2 +- tests/Belgium/EasterMondayTest.php | 2 +- tests/Belgium/EasterTest.php | 2 +- tests/Belgium/InternationalWorkersDayTest.php | 2 +- tests/Belgium/NationalDayTest.php | 2 +- tests/Belgium/NewYearsDayTest.php | 2 +- tests/Belgium/PentecostTest.php | 2 +- tests/Belgium/pentecostMondayTest.php | 2 +- tests/Bosnia/ChristmasDayTest.php | 2 +- tests/Bosnia/DayAfterNewYearsDay.php | 2 +- tests/Bosnia/EasterTest.php | 2 +- tests/Bosnia/IndependenceDayTest.php | 4 ++-- tests/Bosnia/InternationalWorkersDayTest.php | 2 +- tests/Bosnia/NewYearsDayTest.php | 2 +- tests/Bosnia/OrthodoxChristmasDay.php | 2 +- tests/Bosnia/SecondLabourDay.php | 2 +- tests/Bosnia/StatehoodDayTest.php | 4 ++-- tests/Brazil/AllSoulsDayTest.php | 4 ++-- tests/Brazil/AshWednesdayTest.php | 2 +- tests/Brazil/CarnavalMondayTest.php | 4 ++-- tests/Brazil/CarnavalTuesdayTest.php | 4 ++-- tests/Brazil/ChristmasDayTest.php | 2 +- tests/Brazil/CorpusChristiTest.php | 2 +- tests/Brazil/EasterTest.php | 2 +- tests/Brazil/GoodFridayTest.php | 2 +- tests/Brazil/IndependenceDayTest.php | 4 ++-- tests/Brazil/InternationalWorkersDayTest.php | 2 +- tests/Brazil/NewYearsDayTest.php | 2 +- tests/Brazil/OurLadyOfAparecidaDayTest.php | 4 ++-- tests/Brazil/ProclamationOfRepublicDayTest.php | 4 ++-- tests/Brazil/TiradentesDayTest.php | 4 ++-- tests/Canada/CanadaDayTest.php | 4 ++-- tests/Canada/ChristmasDayTest.php | 2 +- tests/Canada/LabourDayTest.php | 4 ++-- tests/Canada/NewYearsDayTest.php | 2 +- tests/Canada/RemembranceDayTest.php | 4 ++-- tests/Canada/ThanksgivingDayTest.php | 4 ++-- tests/Croatia/AllSaintsDayTest.php | 2 +- tests/Croatia/AntifascistStruggleDayTest.php | 4 ++-- tests/Croatia/AssumptionOfMaryTest.php | 2 +- tests/Croatia/ChristmasDayTest.php | 2 +- tests/Croatia/CorpusChristiTest.php | 2 +- tests/Croatia/EasterMondayTest.php | 2 +- tests/Croatia/EasterTest.php | 2 +- tests/Croatia/EpiphanyTest.php | 2 +- tests/Croatia/HomelandThanksgivingDayTest.php | 4 ++-- tests/Croatia/IndependenceDayTest.php | 6 +++--- tests/Croatia/InternationalWorkersDayTest.php | 2 +- tests/Croatia/NewYearsDayTest.php | 2 +- tests/Croatia/RemembranceDayTest.php | 4 ++-- tests/Croatia/StStephensDayTest.php | 2 +- tests/Croatia/StatehoodDayTest.php | 4 ++-- tests/CzechRepublic/ChristmasDayTest.php | 2 +- tests/CzechRepublic/ChristmasEveTest.php | 2 +- tests/CzechRepublic/CzechStateHoodDayTest.php | 2 +- tests/CzechRepublic/EasterMondayTest.php | 2 +- tests/CzechRepublic/GoodFridayTest.php | 2 +- .../IndependentCzechoslovakStateDayTest.php | 2 +- .../CzechRepublic/InternationalWorkersDayTest.php | 2 +- tests/CzechRepublic/JanHusDayTest.php | 2 +- tests/CzechRepublic/NewYearsDayTest.php | 2 +- .../RenewalOfIndependentCzechStateDayTest.php | 2 +- .../SaintsCyrilAndMethodiusDayTest.php | 2 +- tests/CzechRepublic/SecondChristmasDayTest.php | 2 +- .../StruggleForFreedomAndDemocracyDayTest.php | 2 +- tests/CzechRepublic/VictoryInEuropeDayTest.php | 2 +- tests/Denmark/AscensionDayTest.php | 2 +- tests/Denmark/ChristmasDayTest.php | 2 +- tests/Denmark/ChristmasEveTest.php | 2 +- tests/Denmark/ConstitutionDayTest.php | 4 ++-- tests/Denmark/EasterMondayTest.php | 2 +- tests/Denmark/EasterTest.php | 2 +- tests/Denmark/GoodFridayTest.php | 2 +- tests/Denmark/GreatPrayerDayTest.php | 4 ++-- tests/Denmark/InternationalWorkersDayTest.php | 2 +- tests/Denmark/MaundyThursdayTest.php | 2 +- tests/Denmark/NewYearsDayTest.php | 2 +- tests/Denmark/NewYearsEveTest.php | 2 +- tests/Denmark/PentecostMondayTest.php | 2 +- tests/Denmark/PentecostTest.php | 2 +- tests/Denmark/SecondChristmasDayTest.php | 2 +- tests/Denmark/SummerTimeTest.php | 2 +- tests/Denmark/WinterTimeTest.php | 2 +- tests/Estonia/ChristmasDayTest.php | 2 +- tests/Estonia/ChristmasEveDayTest.php | 2 +- tests/Estonia/EasterDayTest.php | 2 +- tests/Estonia/GoodFridayDayTest.php | 2 +- tests/Estonia/IndependenceDayTest.php | 4 ++-- tests/Estonia/InternationalWorkersDayTest.php | 2 +- tests/Estonia/NewYearsDayTest.php | 2 +- tests/Estonia/PentecostTest.php | 2 +- tests/Estonia/RestorationOfIndependenceDayTest.php | 4 ++-- tests/Estonia/SecondChristmasDayTest.php | 2 +- tests/Estonia/StJohnsDayTest.php | 2 +- tests/Estonia/VictoryDayTest.php | 4 ++-- tests/Finland/AllSaintsDayTest.php | 2 +- tests/Finland/AscensionDayTest.php | 2 +- tests/Finland/ChristmasDayTest.php | 2 +- tests/Finland/EasterMondayTest.php | 2 +- tests/Finland/EasterTest.php | 2 +- tests/Finland/EpiphanyTest.php | 2 +- tests/Finland/GoodFridayTest.php | 2 +- tests/Finland/IndependenceDayTest.php | 4 ++-- tests/Finland/InternationalWorkersDayTest.php | 2 +- tests/Finland/NewYearsDayTest.php | 2 +- tests/Finland/PentecostTest.php | 2 +- tests/Finland/SecondChristmasDayTest.php | 2 +- tests/Finland/stJohnsDayTest.php | 4 ++-- tests/France/AllSaintsDayTest.php | 2 +- tests/France/ArmisticeDayTest.php | 4 ++-- tests/France/AscensionDayTest.php | 2 +- tests/France/AssumptionOfMaryTest.php | 2 +- tests/France/BasRhin/GoodFridayTest.php | 2 +- tests/France/BasRhin/stStephensDayTest.php | 2 +- tests/France/BastilleDayTest.php | 4 ++-- tests/France/ChristmasDayTest.php | 2 +- tests/France/EasterMondayTest.php | 2 +- tests/France/HautRhin/GoodFridayTest.php | 2 +- tests/France/HautRhin/stStephensDayTest.php | 2 +- tests/France/InternationalWorkersDayTest.php | 2 +- tests/France/Moselle/GoodFridayTest.php | 2 +- tests/France/Moselle/stStephensDayTest.php | 2 +- tests/France/NewYearsDayTest.php | 2 +- tests/France/PentecostMondayTest.php | 2 +- tests/France/VictoryInEuropeDayTest.php | 4 ++-- tests/Germany/AscensionDayTest.php | 2 +- .../Germany/BadenWurttemberg/AllSaintsDayTest.php | 2 +- .../Germany/BadenWurttemberg/CorpusChristiTest.php | 2 +- tests/Germany/BadenWurttemberg/EpiphanyTest.php | 2 +- tests/Germany/Bavaria/AllSaintsDayTest.php | 2 +- tests/Germany/Bavaria/CorpusChristiTest.php | 2 +- tests/Germany/Bavaria/EpiphanyTest.php | 2 +- tests/Germany/Berlin/DayOfLiberation2020Test.php | 6 +++--- .../Berlin/InternationalWomensDay2019Test.php | 6 +++--- tests/Germany/Brandenburg/ReformationDayTest.php | 4 ++-- tests/Germany/Bremen/ReformationDayTest.php | 4 ++-- tests/Germany/ChristmasTest.php | 2 +- tests/Germany/EasterMondayTest.php | 2 +- tests/Germany/GermanUnityDayTest.php | 4 ++-- tests/Germany/GoodFridayTest.php | 2 +- tests/Germany/Hamburg/DayOfReformationTest.php | 4 ++-- tests/Germany/Hesse/CorpusChristiTest.php | 2 +- tests/Germany/InternationalWorkersDayTest.php | 2 +- tests/Germany/LowerSaxony/ReformationDayTest.php | 4 ++-- .../ReformationDayTest.php | 2 +- tests/Germany/NewYearsDayTest.php | 2 +- .../NorthRhineWestphalia/AllSaintsDayTest.php | 2 +- .../NorthRhineWestphalia/CorpusChristiTest.php | 2 +- tests/Germany/PentecostMondayTest.php | 2 +- tests/Germany/ReformationDay2017Test.php | 6 +++--- .../RhinelandPalatinate/AllSaintsDayTest.php | 2 +- .../RhinelandPalatinate/CorpusChristiTest.php | 2 +- tests/Germany/Saarland/AllSaintsDayTest.php | 2 +- tests/Germany/Saarland/AssumptionOfMaryTest.php | 2 +- tests/Germany/Saarland/CorpusChristiTest.php | 2 +- tests/Germany/Saxony/ReformationDayTest.php | 4 ++-- .../Germany/Saxony/RepentanceAndPrayerDayTest.php | 4 ++-- tests/Germany/SaxonyAnhalt/EpiphanyTest.php | 2 +- tests/Germany/SaxonyAnhalt/ReformationDayTest.php | 4 ++-- .../SchleswigHolstein/ReformationDayTest.php | 4 ++-- tests/Germany/SecondChristmasDayTest.php | 2 +- tests/Germany/Thuringia/ReformationDayTest.php | 4 ++-- tests/Greece/AnnunciationTest.php | 2 +- tests/Greece/AscensionDayTest.php | 2 +- tests/Greece/AssumptionOfMaryTest.php | 2 +- tests/Greece/ChristmasDayTest.php | 2 +- tests/Greece/CleanMondayTest.php | 2 +- tests/Greece/EasterMondayTest.php | 2 +- tests/Greece/EasterTest.php | 2 +- tests/Greece/EpiphanyTest.php | 2 +- tests/Greece/IndepencenceDayTest.php | 4 ++-- tests/Greece/InternationalWorkersDayTest.php | 2 +- tests/Greece/NewYearsDayTest.php | 2 +- tests/Greece/OhiDayTest.php | 4 ++-- tests/Greece/PentecostMondayTest.php | 2 +- tests/Greece/PentecostTest.php | 2 +- tests/Greece/PolytechnioTest.php | 4 ++-- tests/Greece/ThreeHolyHierarchsTest.php | 2 +- tests/Greece/goodFridayTest.php | 2 +- tests/Hungary/AllSaintsDayTest.php | 2 +- tests/Hungary/ChristmasTest.php | 2 +- tests/Hungary/EasterMondayTest.php | 2 +- tests/Hungary/EasterTest.php | 2 +- tests/Hungary/InternationalWorkersDayTest.php | 2 +- tests/Hungary/MemorialDay1848Test.php | 4 ++-- tests/Hungary/MemorialDay1956Test.php | 4 ++-- tests/Hungary/NewYearsDayTest.php | 2 +- tests/Hungary/PentecostMondayTest.php | 2 +- tests/Hungary/PentecostTest.php | 2 +- tests/Hungary/SecondChristmasDayTest.php | 2 +- tests/Hungary/StateFoundationDayTest.php | 4 ++-- tests/Ireland/AugustHolidayTest.php | 2 +- tests/Ireland/ChristmasDayTest.php | 2 +- tests/Ireland/EasterMondayTest.php | 2 +- tests/Ireland/EasterTest.php | 2 +- tests/Ireland/GoodFridayTest.php | 2 +- tests/Ireland/JuneHolidayTest.php | 4 ++-- tests/Ireland/MayDayTest.php | 4 ++-- tests/Ireland/NewYearsDayTest.php | 4 ++-- tests/Ireland/OctoberHolidayTest.php | 4 ++-- tests/Ireland/PentecostTest.php | 2 +- tests/Ireland/StPatricksDayTest.php | 4 ++-- tests/Ireland/StStephensDayTest.php | 2 +- tests/Ireland/pentecostMondayTest.php | 4 ++-- tests/Italy/AllSaintsDayTest.php | 2 +- tests/Italy/AssumptionOfMaryTest.php | 2 +- tests/Italy/ChristmasTest.php | 2 +- tests/Italy/EasterMondayTest.php | 2 +- tests/Italy/EasterTest.php | 2 +- tests/Italy/EpiphanyTest.php | 2 +- tests/Italy/ImmaculateConceptionTest.php | 2 +- tests/Italy/InternationalWorkersDayTest.php | 2 +- tests/Italy/LiberationDayTest.php | 4 ++-- tests/Italy/NewYearsDayTest.php | 2 +- tests/Italy/RepublicDayTest.php | 4 ++-- tests/Italy/stStephensDayTest.php | 2 +- tests/Japan/AutumnalEquinoxDayTest.php | 6 +++--- tests/Japan/ChildrensDayTest.php | 6 +++--- tests/Japan/ComingOfAgeDayTest.php | 6 +++--- tests/Japan/ConstitutionMemorialDayTest.php | 6 +++--- tests/Japan/CoronationDayTest.php | 6 +++--- tests/Japan/CultureDayTest.php | 6 +++--- tests/Japan/EmperorsBirthdayTest.php | 12 ++++++------ .../Japan/EnthronementProclamationCeremonyTest.php | 6 +++--- tests/Japan/GreeneryDayTest.php | 10 +++++----- tests/Japan/LabourThanksgivingDayTest.php | 6 +++--- tests/Japan/MarineDayTest.php | 10 +++++----- tests/Japan/MountainDayTest.php | 8 ++++---- tests/Japan/NationalFoundationDayTest.php | 6 +++--- tests/Japan/NewYearsDayTest.php | 6 +++--- tests/Japan/PublicBridgeDayTest.php | 2 +- tests/Japan/RespectForTheAgedDayTest.php | 8 ++++---- tests/Japan/ShowaDayTest.php | 6 +++--- tests/Japan/SportsDayTest.php | 10 +++++----- tests/Japan/VernalEquinoxDayTest.php | 6 +++--- tests/Latvia/ChristmasDayTest.php | 2 +- tests/Latvia/ChristmasEveDayTest.php | 2 +- tests/Latvia/EasterDayTest.php | 2 +- tests/Latvia/EasterMondayDayTest.php | 2 +- tests/Latvia/GoodFridayDayTest.php | 2 +- tests/Latvia/InternationalWorkersDayTest.php | 2 +- tests/Latvia/MidsummerEveDayTest.php | 2 +- tests/Latvia/NewYearsDayTest.php | 2 +- tests/Latvia/NewYearsEveDayTest.php | 2 +- .../ProclamationOfTheRepublicOfLatviaDayTest.php | 4 ++-- tests/Latvia/RestorationOfIndependenceDayTest.php | 4 ++-- tests/Latvia/SecondChristmasDayTest.php | 2 +- tests/Latvia/StJohnsDayTest.php | 2 +- tests/Lithuania/AllSaintsDayTest.php | 2 +- tests/Lithuania/AssumptionOfMaryDayTest.php | 2 +- tests/Lithuania/ChristmasDayTest.php | 2 +- tests/Lithuania/ChristmasEveDayTest.php | 2 +- tests/Lithuania/EasterDayTest.php | 2 +- tests/Lithuania/EasterMondayDayTest.php | 2 +- tests/Lithuania/InternationalWorkersDayTest.php | 2 +- tests/Lithuania/NewYearsDayTest.php | 2 +- ...RestorationOfIndependenceOfLithuaniaDayTest.php | 4 ++-- .../RestorationOfTheStateOfLithuaniaDayTest.php | 4 ++-- tests/Lithuania/SecondChristmasDayTest.php | 2 +- tests/Lithuania/StJohnsDayTest.php | 2 +- tests/Lithuania/StatehoodDayTest.php | 4 ++-- tests/Luxembourg/AllSaintsDayTest.php | 2 +- tests/Luxembourg/AscensionDayTest.php | 2 +- tests/Luxembourg/AssumptionOfMaryTest.php | 2 +- tests/Luxembourg/ChristmasDayTest.php | 2 +- tests/Luxembourg/EasterMondayTest.php | 2 +- tests/Luxembourg/EuropeDayTest.php | 4 ++-- tests/Luxembourg/InternationalWorkersDayTest.php | 2 +- tests/Luxembourg/NationalDayTest.php | 2 +- tests/Luxembourg/NewYearsDayTest.php | 2 +- tests/Luxembourg/PentecostMondayTest.php | 2 +- tests/Luxembourg/SecondChristmasDayTest.php | 2 +- tests/Netherlands/AscensionDayTest.php | 2 +- tests/Netherlands/AshWednesdayTest.php | 2 +- tests/Netherlands/ChristmasDayTest.php | 2 +- tests/Netherlands/CommemorationDayTest.php | 4 ++-- tests/Netherlands/EasterMondayTest.php | 2 +- tests/Netherlands/EasterTest.php | 2 +- tests/Netherlands/EpiphanyTest.php | 2 +- tests/Netherlands/FathersDayTest.php | 2 +- tests/Netherlands/GoodFridayTest.php | 2 +- tests/Netherlands/HalloweenTest.php | 2 +- tests/Netherlands/InternationalWorkersDayTest.php | 2 +- tests/Netherlands/KingsDayTest.php | 6 +++--- tests/Netherlands/LiberationDayTest.php | 4 ++-- tests/Netherlands/MothersDayTest.php | 2 +- tests/Netherlands/NewYearsDayTest.php | 2 +- tests/Netherlands/PentecostTest.php | 2 +- tests/Netherlands/QueensDayTest.php | 14 +++++++------- tests/Netherlands/SummertimeTest.php | 2 +- tests/Netherlands/ValentinesDayTest.php | 2 +- tests/Netherlands/WintertimeTest.php | 2 +- tests/Netherlands/WorldAnimalDayTest.php | 4 ++-- tests/Netherlands/carnivalDayTest.php | 2 +- tests/Netherlands/pentecostMondayTest.php | 2 +- tests/Netherlands/princesDayTest.php | 2 +- tests/Netherlands/secondCarnivalDay.php | 2 +- tests/Netherlands/secondChristmasdayTest.php | 2 +- tests/Netherlands/stMartinsDayTest.php | 2 +- tests/Netherlands/stNicholasDayTest.php | 2 +- tests/Netherlands/thirdCarnivalDay.php | 2 +- tests/NewZealand/AnzacDayTest.php | 4 ++-- tests/NewZealand/BoxingDayTest.php | 2 +- tests/NewZealand/ChristmasDayTest.php | 2 +- tests/NewZealand/DayAfterNewYearsDayTest.php | 2 +- tests/NewZealand/EasterMondayTest.php | 2 +- tests/NewZealand/GoodFridayTest.php | 2 +- tests/NewZealand/LabourDayTest.php | 4 ++-- tests/NewZealand/NewYearsDayTest.php | 2 +- tests/NewZealand/QueensBirthdayTest.php | 4 ++-- tests/NewZealand/WaitangiDayTest.php | 4 ++-- tests/Norway/AscensionDayTest.php | 2 +- tests/Norway/ChristmasDayTest.php | 2 +- tests/Norway/ConstitutionDayTest.php | 4 ++-- tests/Norway/EasterMondayTest.php | 2 +- tests/Norway/EasterTest.php | 2 +- tests/Norway/GoodFridayTest.php | 2 +- tests/Norway/InternationalWorkersDayTest.php | 2 +- tests/Norway/MaundyThursdayTest.php | 2 +- tests/Norway/NewYearsDayTest.php | 2 +- tests/Norway/PentecostMondayTest.php | 2 +- tests/Norway/PentecostTest.php | 2 +- tests/Norway/SecondChristmasDayTest.php | 2 +- tests/Poland/AllSaintsDayTest.php | 2 +- tests/Poland/AssumptionOfMaryTest.php | 2 +- tests/Poland/ChristmasTest.php | 2 +- tests/Poland/ConstitutionDayTest.php | 4 ++-- tests/Poland/CorpusChristiTest.php | 2 +- tests/Poland/EasterMondayTest.php | 2 +- tests/Poland/EasterTest.php | 2 +- tests/Poland/EpiphanyTest.php | 2 +- tests/Poland/IndependenceDayTest.php | 4 ++-- tests/Poland/InternationalWorkersDayTest.php | 2 +- tests/Poland/NewYearsDayTest.php | 2 +- tests/Poland/PentecostTest.php | 2 +- tests/Poland/SecondChristmasDayTest.php | 2 +- tests/Portugal/AllSaintsDayTest.php | 4 ++-- tests/Portugal/AssumptionOfMaryTest.php | 2 +- tests/Portugal/CarnationRevolutionDayTest.php | 4 ++-- tests/Portugal/ChristmasTest.php | 2 +- tests/Portugal/CorpusChristiTest.php | 4 ++-- tests/Portugal/EasterTest.php | 2 +- tests/Portugal/GoodFridayTest.php | 2 +- tests/Portugal/ImmaculateConceptionTest.php | 2 +- tests/Portugal/InternationalWorkersDayTest.php | 2 +- tests/Portugal/NewYearsDayTest.php | 2 +- tests/Portugal/PortugalDayTest.php | 6 +++--- tests/Portugal/PortugueseRepublicDayTest.php | 8 ++++---- tests/Portugal/RestorationOfIndependenceTest.php | 8 ++++---- tests/Romania/AssumptionOfMaryTest.php | 4 ++-- tests/Romania/ChildrensDayTest.php | 4 ++-- tests/Romania/ChristmasDayTest.php | 2 +- tests/Romania/ConstantinBrancusiDayTest.php | 4 ++-- tests/Romania/DayAfterNewYearsDayTest.php | 2 +- tests/Romania/EasterMondayTest.php | 2 +- tests/Romania/EasterTest.php | 2 +- tests/Romania/InternationalWorkersDayTest.php | 2 +- tests/Romania/NationalDayTest.php | 8 ++++---- tests/Romania/NewYearsDayTest.php | 2 +- tests/Romania/PentecostMondayTest.php | 4 ++-- tests/Romania/PentecostTest.php | 4 ++-- tests/Romania/SecondChristmasDayTest.php | 2 +- tests/Romania/StAndrewsDayTest.php | 4 ++-- tests/Romania/UnitedPrincipalitiesDayTest.php | 4 ++-- tests/Russia/DefenceOfTheFatherlandDayTest.php | 4 ++-- tests/Russia/InternationalWomensDayTest.php | 2 +- tests/Russia/NewYearHolidaysDay2Test.php | 2 +- tests/Russia/NewYearHolidaysDay3Test.php | 2 +- tests/Russia/NewYearHolidaysDay4Test.php | 2 +- tests/Russia/NewYearHolidaysDay5Test.php | 2 +- tests/Russia/NewYearHolidaysDay6Test.php | 2 +- tests/Russia/NewYearHolidaysDay8Test.php | 2 +- tests/Russia/NewYearsDayTest.php | 2 +- tests/Russia/OrthodoxChristmasDayTest.php | 2 +- tests/Russia/RussiaDayTest.php | 4 ++-- tests/Russia/SpringAndLabourDayTest.php | 2 +- tests/Russia/UnityDayTest.php | 4 ++-- tests/Russia/VictoryDayTest.php | 2 +- tests/Slovakia/AllSaintsDayTest.php | 2 +- tests/Slovakia/ChristmasDayTest.php | 2 +- tests/Slovakia/ChristmasEveTest.php | 2 +- tests/Slovakia/EasterMondayTest.php | 2 +- tests/Slovakia/EpiphanyTest.php | 2 +- tests/Slovakia/GoodFridayTest.php | 2 +- tests/Slovakia/InternationalWorkersDayTest.php | 2 +- tests/Slovakia/OurLadyOfSorrowsDayTest.php | 2 +- tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php | 2 +- tests/Slovakia/SecondChristmasDayTest.php | 2 +- tests/Slovakia/SlovakConstitutionDayTest.php | 2 +- tests/Slovakia/SlovakIndependeceDayTest.php | 2 +- tests/Slovakia/SlovakNationalUprisingDayTest.php | 2 +- .../StruggleForFreedomAndDemocracyDayTest.php | 2 +- tests/Slovakia/VictoryInEuropeDayTest.php | 2 +- tests/SouthAfrica/ChristmasDayTest.php | 4 ++-- tests/SouthAfrica/FamilyDayTest.php | 4 ++-- tests/SouthAfrica/FreedomDayTest.php | 4 ++-- tests/SouthAfrica/GoodFridayTest.php | 4 ++-- tests/SouthAfrica/HeritageDayTest.php | 4 ++-- tests/SouthAfrica/HumanRightsDayTest.php | 4 ++-- .../SouthAfrica/MunicipalElections2016DayTest.php | 6 +++--- tests/SouthAfrica/NationalWomensDayTest.php | 4 ++-- tests/SouthAfrica/NewYearsDayTest.php | 4 ++-- tests/SouthAfrica/ReconciliationDayTest.php | 4 ++-- tests/SouthAfrica/SecondChristmasDayTest.php | 4 ++-- tests/SouthAfrica/SubstituteDayOfGoodwillTest.php | 6 +++--- tests/SouthAfrica/WorkersDayTest.php | 4 ++-- tests/SouthAfrica/YouthDayTest.php | 4 ++-- tests/SouthKorea/ArborDayTest.php | 6 +++--- tests/SouthKorea/ArmedForcesDayTest.php | 6 +++--- tests/SouthKorea/BuddhasBirthdayTest.php | 4 ++-- tests/SouthKorea/ChildrensDayTest.php | 10 +++++----- tests/SouthKorea/ChristmasDayTest.php | 4 ++-- tests/SouthKorea/ChuseokTest.php | 8 ++++---- tests/SouthKorea/ConstitutionDayTest.php | 6 +++--- tests/SouthKorea/GaecheonjeolTest.php | 4 ++-- tests/SouthKorea/HangulDayTest.php | 4 ++-- tests/SouthKorea/IndependenceMovementDayTest.php | 4 ++-- tests/SouthKorea/LiberationDayTest.php | 4 ++-- tests/SouthKorea/MemorialDayTest.php | 4 ++-- tests/SouthKorea/NewYearsDayTest.php | 6 +++--- tests/SouthKorea/SeollalTest.php | 6 +++--- 501 files changed, 703 insertions(+), 703 deletions(-) diff --git a/tests/Australia/AnzacDayTest.php b/tests/Australia/AnzacDayTest.php index 2151f5183..1d6028727 100644 --- a/tests/Australia/AnzacDayTest.php +++ b/tests/Australia/AnzacDayTest.php @@ -45,7 +45,7 @@ class AnzacDayTest extends AustraliaBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, @@ -59,7 +59,7 @@ public function testHoliday($year, $expected) * Tests that ANZAC Day is not present before 1921 * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday($this->region, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/Australia/AustraliaDayTest.php b/tests/Australia/AustraliaDayTest.php index 158df0e3d..d679e20e7 100644 --- a/tests/Australia/AustraliaDayTest.php +++ b/tests/Australia/AustraliaDayTest.php @@ -39,7 +39,7 @@ class AustraliaDayTest extends AustraliaBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday($this->region, self::HOLIDAY, $year, $expected); } @@ -55,7 +55,7 @@ public function testHoliday($year, $expected) * @throws ReflectionException * @throws Exception */ - public function testSubstituteHoliday($year, $expected) + public function testSubstituteHoliday($year, $expected): void { if ($expected) { $this->assertSubstituteHoliday( diff --git a/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php index 377f67504..57deb0bec 100644 --- a/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php @@ -45,7 +45,7 @@ class CanberraDayTest extends AustralianCapitalTerritoryBaseTestCase implements * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php index d57ebbbe4..6233703e8 100644 --- a/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php @@ -41,7 +41,7 @@ class EasterSaturdayTest extends AustralianCapitalTerritoryBaseTestCase implemen * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php index 6c3654565..16b6a7dfd 100644 --- a/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php @@ -40,7 +40,7 @@ class EasterSundayTest extends AustralianCapitalTerritoryBaseTestCase implements * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php index b68c1a054..17ce5ace6 100644 --- a/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends AustralianCapitalTerritoryBaseTestCase implements Ya * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php index 4620b957d..6e045cca9 100644 --- a/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends AustralianCapitalTerritoryBaseTestCase implemen * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php index 47d93e5de..cddb95459 100644 --- a/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php @@ -45,7 +45,7 @@ class ReconciliationDayTest extends AustralianCapitalTerritoryBaseTestCase imple * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/BoxingDayTest.php b/tests/Australia/BoxingDayTest.php index 5c6c4a8ef..9c712707b 100644 --- a/tests/Australia/BoxingDayTest.php +++ b/tests/Australia/BoxingDayTest.php @@ -42,7 +42,7 @@ class BoxingDayTest extends AustraliaBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected, $expectedExtra) + public function testHoliday($year, $expected, $expectedExtra): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/ChristmasDayTest.php b/tests/Australia/ChristmasDayTest.php index 5fab37045..84545d485 100644 --- a/tests/Australia/ChristmasDayTest.php +++ b/tests/Australia/ChristmasDayTest.php @@ -42,7 +42,7 @@ class ChristmasDayTest extends AustraliaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected, $expectedExtra) + public function testHoliday($year, $expected, $expectedExtra): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/EasterMondayTest.php b/tests/Australia/EasterMondayTest.php index be695b2db..2c2a341eb 100644 --- a/tests/Australia/EasterMondayTest.php +++ b/tests/Australia/EasterMondayTest.php @@ -42,7 +42,7 @@ class EasterMondayTest extends AustraliaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, @@ -63,7 +63,7 @@ public function testHoliday($year, $expected) * @throws ReflectionException * @throws Exception */ - public function testHoliday2($year, $expected) + public function testHoliday2($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/GoodFridayTest.php b/tests/Australia/GoodFridayTest.php index 1219158ca..66ed26624 100644 --- a/tests/Australia/GoodFridayTest.php +++ b/tests/Australia/GoodFridayTest.php @@ -41,7 +41,7 @@ class GoodFridayTest extends AustraliaBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewSouthWales/BankHolidayTest.php b/tests/Australia/NewSouthWales/BankHolidayTest.php index 64e8fa137..1d42a93c2 100644 --- a/tests/Australia/NewSouthWales/BankHolidayTest.php +++ b/tests/Australia/NewSouthWales/BankHolidayTest.php @@ -40,7 +40,7 @@ class BankHolidayTest extends NewSouthWalesBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewSouthWales/EasterSaturdayTest.php b/tests/Australia/NewSouthWales/EasterSaturdayTest.php index c6b63a312..770163fe0 100644 --- a/tests/Australia/NewSouthWales/EasterSaturdayTest.php +++ b/tests/Australia/NewSouthWales/EasterSaturdayTest.php @@ -41,7 +41,7 @@ class EasterSaturdayTest extends NewSouthWalesBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewSouthWales/EasterSundayTest.php b/tests/Australia/NewSouthWales/EasterSundayTest.php index 84dcb3e61..bb37936f8 100644 --- a/tests/Australia/NewSouthWales/EasterSundayTest.php +++ b/tests/Australia/NewSouthWales/EasterSundayTest.php @@ -40,7 +40,7 @@ class EasterSundayTest extends NewSouthWalesBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewSouthWales/LabourDayTest.php b/tests/Australia/NewSouthWales/LabourDayTest.php index b29e86d83..c7e1df61d 100644 --- a/tests/Australia/NewSouthWales/LabourDayTest.php +++ b/tests/Australia/NewSouthWales/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends NewSouthWalesBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewSouthWales/QueensBirthdayTest.php b/tests/Australia/NewSouthWales/QueensBirthdayTest.php index 905f26eb5..c428fb196 100644 --- a/tests/Australia/NewSouthWales/QueensBirthdayTest.php +++ b/tests/Australia/NewSouthWales/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends NewSouthWalesBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NewYearsDayTest.php b/tests/Australia/NewYearsDayTest.php index e493721d3..03c3257d5 100644 --- a/tests/Australia/NewYearsDayTest.php +++ b/tests/Australia/NewYearsDayTest.php @@ -42,7 +42,7 @@ class NewYearsDayTest extends AustraliaBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected, $expectedExtra) + public function testHoliday($year, $expected, $expectedExtra): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NorthernTerritory/EasterSaturdayTest.php b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php index 35796632f..430cb8b2f 100644 --- a/tests/Australia/NorthernTerritory/EasterSaturdayTest.php +++ b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php @@ -41,7 +41,7 @@ class EasterSaturdayTest extends NorthernTerritoryBaseTestCase implements Yasumi * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NorthernTerritory/MayDayTest.php b/tests/Australia/NorthernTerritory/MayDayTest.php index 6c68c361f..9b9fcfe2d 100644 --- a/tests/Australia/NorthernTerritory/MayDayTest.php +++ b/tests/Australia/NorthernTerritory/MayDayTest.php @@ -40,7 +40,7 @@ class MayDayTest extends NorthernTerritoryBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NorthernTerritory/PicnicDayTest.php b/tests/Australia/NorthernTerritory/PicnicDayTest.php index 88ba1a5f0..c7ac6dfab 100644 --- a/tests/Australia/NorthernTerritory/PicnicDayTest.php +++ b/tests/Australia/NorthernTerritory/PicnicDayTest.php @@ -40,7 +40,7 @@ class PicnicDayTest extends NorthernTerritoryBaseTestCase implements YasumiTestC * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/NorthernTerritory/QueensBirthdayTest.php b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php index 4eccecce9..3d9edaaec 100644 --- a/tests/Australia/NorthernTerritory/QueensBirthdayTest.php +++ b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends NorthernTerritoryBaseTestCase implements Yasumi * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php index add610548..06820b3fb 100644 --- a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php +++ b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php @@ -40,7 +40,7 @@ class PeoplesDayTest extends BrisbaneBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Queensland/LabourDayTest.php b/tests/Australia/Queensland/LabourDayTest.php index 825f3febe..f6148f2f0 100644 --- a/tests/Australia/Queensland/LabourDayTest.php +++ b/tests/Australia/Queensland/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends QueenslandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Queensland/QueensBirthdayTest.php b/tests/Australia/Queensland/QueensBirthdayTest.php index 57d8f34af..4faae13b9 100644 --- a/tests/Australia/Queensland/QueensBirthdayTest.php +++ b/tests/Australia/Queensland/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends QueenslandBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/AdelaideCupDayTest.php b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php index baa61cdaf..eef37da5f 100644 --- a/tests/Australia/SouthAustralia/AdelaideCupDayTest.php +++ b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php @@ -45,7 +45,7 @@ class AdelaideCupDayTest extends SouthAustraliaBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/ChristmasDayTest.php b/tests/Australia/SouthAustralia/ChristmasDayTest.php index 09702618e..5b13d96e1 100644 --- a/tests/Australia/SouthAustralia/ChristmasDayTest.php +++ b/tests/Australia/SouthAustralia/ChristmasDayTest.php @@ -42,7 +42,7 @@ class ChristmasDayTest extends SouthAustraliaBaseTestCase implements YasumiTestC * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected, $expectedExtra) + public function testHoliday($year, $expected, $expectedExtra): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/EasterSaturdayTest.php b/tests/Australia/SouthAustralia/EasterSaturdayTest.php index ee047a322..9da9a09bc 100644 --- a/tests/Australia/SouthAustralia/EasterSaturdayTest.php +++ b/tests/Australia/SouthAustralia/EasterSaturdayTest.php @@ -41,7 +41,7 @@ class EasterSaturdayTest extends SouthAustraliaBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/LabourDayTest.php b/tests/Australia/SouthAustralia/LabourDayTest.php index d569e16a6..8071448bf 100644 --- a/tests/Australia/SouthAustralia/LabourDayTest.php +++ b/tests/Australia/SouthAustralia/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends SouthAustraliaBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/ProclamationDayTest.php b/tests/Australia/SouthAustralia/ProclamationDayTest.php index 7cd08be1c..9a8b98daa 100644 --- a/tests/Australia/SouthAustralia/ProclamationDayTest.php +++ b/tests/Australia/SouthAustralia/ProclamationDayTest.php @@ -40,7 +40,7 @@ class ProclamationDayTest extends SouthAustraliaBaseTestCase implements YasumiTe * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/SouthAustralia/QueensBirthdayTest.php b/tests/Australia/SouthAustralia/QueensBirthdayTest.php index 05499bbf2..151a8949b 100644 --- a/tests/Australia/SouthAustralia/QueensBirthdayTest.php +++ b/tests/Australia/SouthAustralia/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends SouthAustraliaBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php index a5a9dce8c..1510cdc9e 100644 --- a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php +++ b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php @@ -40,7 +40,7 @@ class DevonportShowTest extends CentralNorthBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/EightHourDayTest.php b/tests/Australia/Tasmania/EightHourDayTest.php index a3346339a..57d89f506 100644 --- a/tests/Australia/Tasmania/EightHourDayTest.php +++ b/tests/Australia/Tasmania/EightHourDayTest.php @@ -40,7 +40,7 @@ class EightHourDayTest extends TasmaniaBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php index 15017f18d..3b9eed222 100644 --- a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php @@ -40,7 +40,7 @@ class FlindersIslandShowTest extends FlindersIslandBaseTestCase implements Yasum * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php index 328ae2aef..b72daeecb 100644 --- a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php +++ b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php @@ -40,7 +40,7 @@ class KingIslandShowTest extends KingIslandBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php index 696d54bf0..31c2c861c 100644 --- a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php +++ b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php @@ -40,7 +40,7 @@ class LauncestonShowTest extends NortheastBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php index ecec82595..2e817ee72 100644 --- a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php +++ b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php @@ -40,7 +40,7 @@ class BurnieShowTest extends NorthwestBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php index 3ded129af..af2f381ba 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php @@ -40,7 +40,7 @@ class AGFESTTest extends CircularHeadBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/QueensBirthdayTest.php b/tests/Australia/Tasmania/QueensBirthdayTest.php index 4b6455ddf..00fcceece 100644 --- a/tests/Australia/Tasmania/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends TasmaniaBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/RecreationDayTest.php b/tests/Australia/Tasmania/RecreationDayTest.php index e98d0c251..af856f055 100644 --- a/tests/Australia/Tasmania/RecreationDayTest.php +++ b/tests/Australia/Tasmania/RecreationDayTest.php @@ -40,7 +40,7 @@ class RecreationDayTest extends TasmaniaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/South/HobartShowTest.php b/tests/Australia/Tasmania/South/HobartShowTest.php index 943839f83..c82c0852c 100644 --- a/tests/Australia/Tasmania/South/HobartShowTest.php +++ b/tests/Australia/Tasmania/South/HobartShowTest.php @@ -40,7 +40,7 @@ class HobartShowTest extends SouthBaseTestCase implements YasumiTestCaseInterfac * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php index 40e187b8d..980cc272d 100644 --- a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php +++ b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php @@ -40,7 +40,7 @@ class HobartRegattaTest extends SoutheastBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php index 841d9bad3..1389a7a2c 100644 --- a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php +++ b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php @@ -43,7 +43,7 @@ class AFLGrandFinalFridayTest extends VictoriaBaseTestCase implements YasumiTest * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, @@ -86,7 +86,7 @@ public function testHolidayType(): void * Tests that Holiday is not present before establishment year * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday($this->region, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/Australia/Victoria/EasterSaturdayTest.php b/tests/Australia/Victoria/EasterSaturdayTest.php index ba54910d3..23cd4ceeb 100644 --- a/tests/Australia/Victoria/EasterSaturdayTest.php +++ b/tests/Australia/Victoria/EasterSaturdayTest.php @@ -41,7 +41,7 @@ class EasterSaturdayTest extends VictoriaBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Victoria/EasterSundayTest.php b/tests/Australia/Victoria/EasterSundayTest.php index 0c5636614..68c967256 100644 --- a/tests/Australia/Victoria/EasterSundayTest.php +++ b/tests/Australia/Victoria/EasterSundayTest.php @@ -40,7 +40,7 @@ class EasterSundayTest extends VictoriaBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Victoria/LabourDayTest.php b/tests/Australia/Victoria/LabourDayTest.php index 4d1afdbea..f12beed5d 100644 --- a/tests/Australia/Victoria/LabourDayTest.php +++ b/tests/Australia/Victoria/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends VictoriaBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Victoria/MelbourneCupDayTest.php b/tests/Australia/Victoria/MelbourneCupDayTest.php index 9ead58882..f7caa1230 100644 --- a/tests/Australia/Victoria/MelbourneCupDayTest.php +++ b/tests/Australia/Victoria/MelbourneCupDayTest.php @@ -45,7 +45,7 @@ class MelbourneCupDayTest extends VictoriaBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/Victoria/QueensBirthdayTest.php b/tests/Australia/Victoria/QueensBirthdayTest.php index 5410cdd2e..da2361f4d 100644 --- a/tests/Australia/Victoria/QueensBirthdayTest.php +++ b/tests/Australia/Victoria/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends VictoriaBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/WesternAustralia/LabourDayTest.php b/tests/Australia/WesternAustralia/LabourDayTest.php index fc9c2b0ff..5f59764c8 100644 --- a/tests/Australia/WesternAustralia/LabourDayTest.php +++ b/tests/Australia/WesternAustralia/LabourDayTest.php @@ -40,7 +40,7 @@ class LabourDayTest extends WesternAustraliaBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/WesternAustralia/QueensBirthdayTest.php b/tests/Australia/WesternAustralia/QueensBirthdayTest.php index 23e396bb5..d20c9b4d6 100644 --- a/tests/Australia/WesternAustralia/QueensBirthdayTest.php +++ b/tests/Australia/WesternAustralia/QueensBirthdayTest.php @@ -45,7 +45,7 @@ class QueensBirthdayTest extends WesternAustraliaBaseTestCase implements YasumiT * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php index 27f05e9cf..8a5fbe72a 100644 --- a/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php @@ -40,7 +40,7 @@ class WesternAustraliaDayTest extends WesternAustraliaBaseTestCase implements Ya * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( $this->region, diff --git a/tests/Austria/AllSaintsDayTest.php b/tests/Austria/AllSaintsDayTest.php index a20c45cdd..1ea05aaa6 100644 --- a/tests/Austria/AllSaintsDayTest.php +++ b/tests/Austria/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends AustriaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/AscensionDayTest.php b/tests/Austria/AscensionDayTest.php index 5321e9ffc..de9c13459 100644 --- a/tests/Austria/AscensionDayTest.php +++ b/tests/Austria/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends AustriaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1754; $this->assertHoliday( diff --git a/tests/Austria/AssumptionOfMaryTest.php b/tests/Austria/AssumptionOfMaryTest.php index 88ecdf401..ccea93e8b 100644 --- a/tests/Austria/AssumptionOfMaryTest.php +++ b/tests/Austria/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends AustriaBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/Burgenland/stMartinsDayTest.php b/tests/Austria/Burgenland/stMartinsDayTest.php index ef4f670bb..73d4d5437 100644 --- a/tests/Austria/Burgenland/stMartinsDayTest.php +++ b/tests/Austria/Burgenland/stMartinsDayTest.php @@ -38,7 +38,7 @@ class stMartinsDayTest extends BurgenlandBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function teststMartinsDay($year, $expected) + public function teststMartinsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/Carinthia/PlebisciteDayTest.php b/tests/Austria/Carinthia/PlebisciteDayTest.php index 221035803..a7c1d104b 100644 --- a/tests/Austria/Carinthia/PlebisciteDayTest.php +++ b/tests/Austria/Carinthia/PlebisciteDayTest.php @@ -44,7 +44,7 @@ class PlebisciteDayTest extends CarinthiaBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testPlebisciteDay($year, $expected) + public function testPlebisciteDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function PlebisciteDayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Austria/Carinthia/StJosephsDayTest.php b/tests/Austria/Carinthia/StJosephsDayTest.php index 47f5df2be..2efa59d39 100644 --- a/tests/Austria/Carinthia/StJosephsDayTest.php +++ b/tests/Austria/Carinthia/StJosephsDayTest.php @@ -38,7 +38,7 @@ class StJosephsDayTest extends CarinthiaBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testStJosephsDay($year, $expected) + public function testStJosephsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/ChristmasTest.php b/tests/Austria/ChristmasTest.php index a64e26032..7a1e43818 100644 --- a/tests/Austria/ChristmasTest.php +++ b/tests/Austria/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends AustriaBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/CorpusChristiTest.php b/tests/Austria/CorpusChristiTest.php index 7c0ff557b..110eea967 100644 --- a/tests/Austria/CorpusChristiTest.php +++ b/tests/Austria/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends AustriaBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1988; $this->assertHoliday( diff --git a/tests/Austria/EasterMondayTest.php b/tests/Austria/EasterMondayTest.php index be62e95dc..a9e1068b1 100644 --- a/tests/Austria/EasterMondayTest.php +++ b/tests/Austria/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends AustriaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Austria/EasterTest.php b/tests/Austria/EasterTest.php index fe1122a9d..62d3470c4 100644 --- a/tests/Austria/EasterTest.php +++ b/tests/Austria/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends AustriaBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2009; $this->assertHoliday( diff --git a/tests/Austria/EpiphanyTest.php b/tests/Austria/EpiphanyTest.php index fd8c64c0f..78620d38e 100644 --- a/tests/Austria/EpiphanyTest.php +++ b/tests/Austria/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends AustriaBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/ImmaculateConceptionTest.php b/tests/Austria/ImmaculateConceptionTest.php index d85847583..6add293dd 100644 --- a/tests/Austria/ImmaculateConceptionTest.php +++ b/tests/Austria/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends AustriaBaseTestCase implements YasumiTest * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/InternationalWorkersDayTest.php b/tests/Austria/InternationalWorkersDayTest.php index f20fb2f48..166181edf 100644 --- a/tests/Austria/InternationalWorkersDayTest.php +++ b/tests/Austria/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends AustriaBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/LowerAustria/StLeopoldsDayTest.php b/tests/Austria/LowerAustria/StLeopoldsDayTest.php index 75db36585..b02b72b9e 100644 --- a/tests/Austria/LowerAustria/StLeopoldsDayTest.php +++ b/tests/Austria/LowerAustria/StLeopoldsDayTest.php @@ -44,7 +44,7 @@ class StLeopoldsDayTest extends LowerAustriaBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testStLeopoldsDay($year, $expected) + public function testStLeopoldsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function StLeopoldsDayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Austria/NationalDayTest.php b/tests/Austria/NationalDayTest.php index 392334625..82b866855 100644 --- a/tests/Austria/NationalDayTest.php +++ b/tests/Austria/NationalDayTest.php @@ -39,7 +39,7 @@ class NationalDayTest extends AustriaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Austria/NewYearsDayTest.php b/tests/Austria/NewYearsDayTest.php index f5f9430fe..a9778cd10 100644 --- a/tests/Austria/NewYearsDayTest.php +++ b/tests/Austria/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends AustriaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/PentecostMondayTest.php b/tests/Austria/PentecostMondayTest.php index 33613593e..bb047467a 100644 --- a/tests/Austria/PentecostMondayTest.php +++ b/tests/Austria/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends AustriaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Austria/PentecostTest.php b/tests/Austria/PentecostTest.php index 0260bb56c..7248c91d4 100644 --- a/tests/Austria/PentecostTest.php +++ b/tests/Austria/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends AustriaBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1344; $this->assertHoliday( diff --git a/tests/Austria/Salzburg/StRupertsDayTest.php b/tests/Austria/Salzburg/StRupertsDayTest.php index 801f00f71..aa2a09a97 100644 --- a/tests/Austria/Salzburg/StRupertsDayTest.php +++ b/tests/Austria/Salzburg/StRupertsDayTest.php @@ -38,7 +38,7 @@ class StRupertsDayTest extends SalzburgBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testStRupertsDay($year, $expected) + public function testStRupertsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/SecondChristmasDayTest.php b/tests/Austria/SecondChristmasDayTest.php index f134724c2..1a7c68e03 100644 --- a/tests/Austria/SecondChristmasDayTest.php +++ b/tests/Austria/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends AustriaBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/Styria/StJosephsDayTest.php b/tests/Austria/Styria/StJosephsDayTest.php index 98dcf9ede..6f703a9ea 100644 --- a/tests/Austria/Styria/StJosephsDayTest.php +++ b/tests/Austria/Styria/StJosephsDayTest.php @@ -38,7 +38,7 @@ class StJosephsDayTest extends StyriaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testStJosephsDay($year, $expected) + public function testStJosephsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/Tyrol/StJosephsDayTest.php b/tests/Austria/Tyrol/StJosephsDayTest.php index dbac3b47b..7ad40af6c 100644 --- a/tests/Austria/Tyrol/StJosephsDayTest.php +++ b/tests/Austria/Tyrol/StJosephsDayTest.php @@ -38,7 +38,7 @@ class StJosephsDayTest extends TyrolBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testStJosephsDay($year, $expected) + public function testStJosephsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/UpperAustria/StFloriansDayTest.php b/tests/Austria/UpperAustria/StFloriansDayTest.php index f89b82cb2..f1bf526ba 100644 --- a/tests/Austria/UpperAustria/StFloriansDayTest.php +++ b/tests/Austria/UpperAustria/StFloriansDayTest.php @@ -38,7 +38,7 @@ class StFloriansDayTest extends UpperAustriaBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testStFloriansDay($year, $expected) + public function testStFloriansDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Austria/Vienna/StLeopoldsDayTest.php b/tests/Austria/Vienna/StLeopoldsDayTest.php index c9552e293..83a1e243c 100644 --- a/tests/Austria/Vienna/StLeopoldsDayTest.php +++ b/tests/Austria/Vienna/StLeopoldsDayTest.php @@ -44,7 +44,7 @@ class StLeopoldsDayTest extends ViennaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testStLeopoldsDay($year, $expected) + public function testStLeopoldsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function StLeopoldsDayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Austria/Vorarlberg/StJosephsDayTest.php b/tests/Austria/Vorarlberg/StJosephsDayTest.php index 089db079f..516ae4bfb 100644 --- a/tests/Austria/Vorarlberg/StJosephsDayTest.php +++ b/tests/Austria/Vorarlberg/StJosephsDayTest.php @@ -38,7 +38,7 @@ class StJosephsDayTest extends VorarlbergBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testStJosephsDay($year, $expected) + public function testStJosephsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/AllSaintsDayTest.php b/tests/Belgium/AllSaintsDayTest.php index 329b7ae8c..afb837e71 100644 --- a/tests/Belgium/AllSaintsDayTest.php +++ b/tests/Belgium/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends BelgiumBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/ArmisticeDayTest.php b/tests/Belgium/ArmisticeDayTest.php index 495a0862e..f904232f8 100644 --- a/tests/Belgium/ArmisticeDayTest.php +++ b/tests/Belgium/ArmisticeDayTest.php @@ -38,7 +38,7 @@ class ArmisticeDayTest extends BelgiumBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/AscensionDayTest.php b/tests/Belgium/AscensionDayTest.php index 33192d86d..fe99c2651 100644 --- a/tests/Belgium/AscensionDayTest.php +++ b/tests/Belgium/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends BelgiumBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1818; $this->assertHoliday( diff --git a/tests/Belgium/AssumptionOfMaryTest.php b/tests/Belgium/AssumptionOfMaryTest.php index f03f54db4..67ad8062d 100644 --- a/tests/Belgium/AssumptionOfMaryTest.php +++ b/tests/Belgium/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends BelgiumBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/ChristmasTest.php b/tests/Belgium/ChristmasTest.php index eff406319..7482326b0 100644 --- a/tests/Belgium/ChristmasTest.php +++ b/tests/Belgium/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends BelgiumBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/EasterMondayTest.php b/tests/Belgium/EasterMondayTest.php index abc78c847..1ae235b0e 100644 --- a/tests/Belgium/EasterMondayTest.php +++ b/tests/Belgium/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends BelgiumBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Belgium/EasterTest.php b/tests/Belgium/EasterTest.php index 0556eeca2..3c0623596 100644 --- a/tests/Belgium/EasterTest.php +++ b/tests/Belgium/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends BelgiumBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testEaster() + public function testEaster(): void { $year = 2010; $this->assertHoliday( diff --git a/tests/Belgium/InternationalWorkersDayTest.php b/tests/Belgium/InternationalWorkersDayTest.php index d48e6844a..5b061612c 100644 --- a/tests/Belgium/InternationalWorkersDayTest.php +++ b/tests/Belgium/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends BelgiumBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/NationalDayTest.php b/tests/Belgium/NationalDayTest.php index ae6eb3004..ebe818c5e 100644 --- a/tests/Belgium/NationalDayTest.php +++ b/tests/Belgium/NationalDayTest.php @@ -38,7 +38,7 @@ class NationalDayTest extends BelgiumBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/NewYearsDayTest.php b/tests/Belgium/NewYearsDayTest.php index 298cce780..cc9378bb7 100644 --- a/tests/Belgium/NewYearsDayTest.php +++ b/tests/Belgium/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends BelgiumBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Belgium/PentecostTest.php b/tests/Belgium/PentecostTest.php index 441c8c140..e53755a6c 100644 --- a/tests/Belgium/PentecostTest.php +++ b/tests/Belgium/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends BelgiumBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2025; $this->assertHoliday( diff --git a/tests/Belgium/pentecostMondayTest.php b/tests/Belgium/pentecostMondayTest.php index 7975fedaa..7ac40585d 100644 --- a/tests/Belgium/pentecostMondayTest.php +++ b/tests/Belgium/pentecostMondayTest.php @@ -34,7 +34,7 @@ class pentecostMondayTest extends BelgiumBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Bosnia/ChristmasDayTest.php b/tests/Bosnia/ChristmasDayTest.php index 076e2da0f..6d897967f 100644 --- a/tests/Bosnia/ChristmasDayTest.php +++ b/tests/Bosnia/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends BosniaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/DayAfterNewYearsDay.php b/tests/Bosnia/DayAfterNewYearsDay.php index 75646e1ce..c66b3c7a3 100644 --- a/tests/Bosnia/DayAfterNewYearsDay.php +++ b/tests/Bosnia/DayAfterNewYearsDay.php @@ -38,7 +38,7 @@ class DayAfterNewYearsDay extends BosniaBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/EasterTest.php b/tests/Bosnia/EasterTest.php index d31ed3ced..3afb99f1a 100644 --- a/tests/Bosnia/EasterTest.php +++ b/tests/Bosnia/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends BosniaBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1677; $this->assertHoliday( diff --git a/tests/Bosnia/IndependenceDayTest.php b/tests/Bosnia/IndependenceDayTest.php index 9ce7d31fd..38db56253 100644 --- a/tests/Bosnia/IndependenceDayTest.php +++ b/tests/Bosnia/IndependenceDayTest.php @@ -39,7 +39,7 @@ class IndependenceDayTest extends BosniaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testIndependenceDayOnAfter1992() + public function testIndependenceDayOnAfter1992(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testIndependenceDayOnAfter1992() * Tests Independence Day before 1992. * @throws ReflectionException */ - public function testIndependenceDayBefore1992() + public function testIndependenceDayBefore1992(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Bosnia/InternationalWorkersDayTest.php b/tests/Bosnia/InternationalWorkersDayTest.php index 00b931f1a..4176c1b05 100644 --- a/tests/Bosnia/InternationalWorkersDayTest.php +++ b/tests/Bosnia/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends BosniaBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/NewYearsDayTest.php b/tests/Bosnia/NewYearsDayTest.php index 2235cdaea..c1a970cb2 100644 --- a/tests/Bosnia/NewYearsDayTest.php +++ b/tests/Bosnia/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends BosniaBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/OrthodoxChristmasDay.php b/tests/Bosnia/OrthodoxChristmasDay.php index ed34191ea..9ba9e6880 100644 --- a/tests/Bosnia/OrthodoxChristmasDay.php +++ b/tests/Bosnia/OrthodoxChristmasDay.php @@ -46,7 +46,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/SecondLabourDay.php b/tests/Bosnia/SecondLabourDay.php index bc18f68d9..a37f8c380 100644 --- a/tests/Bosnia/SecondLabourDay.php +++ b/tests/Bosnia/SecondLabourDay.php @@ -38,7 +38,7 @@ class SecondLabourDay extends BosniaBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Bosnia/StatehoodDayTest.php b/tests/Bosnia/StatehoodDayTest.php index 6e5bdeb81..84bed2334 100644 --- a/tests/Bosnia/StatehoodDayTest.php +++ b/tests/Bosnia/StatehoodDayTest.php @@ -39,7 +39,7 @@ class StatehoodDayTest extends BosniaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testStatehoodDayOnAfter1943() + public function testStatehoodDayOnAfter1943(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testStatehoodDayOnAfter1943() * Tests Statehood Day before 1943. * @throws ReflectionException */ - public function testStatehoodDayBefore1943() + public function testStatehoodDayBefore1943(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Brazil/AllSoulsDayTest.php b/tests/Brazil/AllSoulsDayTest.php index 048084d63..cd91307d2 100644 --- a/tests/Brazil/AllSoulsDayTest.php +++ b/tests/Brazil/AllSoulsDayTest.php @@ -39,7 +39,7 @@ class AllSoulsDayTest extends BrazilBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testDiaDosFinadosAfter1300() + public function testDiaDosFinadosAfter1300(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testDiaDosFinadosAfter1300() * Tests Dia dos Finados on or before 1300. * @throws ReflectionException */ - public function testDiaDosFinadosBefore1300() + public function testDiaDosFinadosBefore1300(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/AshWednesdayTest.php b/tests/Brazil/AshWednesdayTest.php index 11b8cdd16..2665f76a2 100644 --- a/tests/Brazil/AshWednesdayTest.php +++ b/tests/Brazil/AshWednesdayTest.php @@ -34,7 +34,7 @@ class AshWednesdayTest extends BrazilBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1999; $this->assertHoliday( diff --git a/tests/Brazil/CarnavalMondayTest.php b/tests/Brazil/CarnavalMondayTest.php index 414074270..56f2acdcb 100644 --- a/tests/Brazil/CarnavalMondayTest.php +++ b/tests/Brazil/CarnavalMondayTest.php @@ -42,7 +42,7 @@ class CarnavalMondayTest extends BrazilBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testCarnavalMondayAfter1700() + public function testCarnavalMondayAfter1700(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testCarnavalMondayAfter1700() * Tests Carnaval Monday on or before 1700. * @throws ReflectionException */ - public function testCarnavalMondayBefore1700() + public function testCarnavalMondayBefore1700(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/CarnavalTuesdayTest.php b/tests/Brazil/CarnavalTuesdayTest.php index 02e5e0651..e96850fa6 100644 --- a/tests/Brazil/CarnavalTuesdayTest.php +++ b/tests/Brazil/CarnavalTuesdayTest.php @@ -42,7 +42,7 @@ class CarnavalTuesdayTest extends BrazilBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testCarnavalTuesdayAfter1700() + public function testCarnavalTuesdayAfter1700(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testCarnavalTuesdayAfter1700() * Tests Carnaval Tuesday on or before 1700. * @throws ReflectionException */ - public function testCarnavalTuesdayBefore1700() + public function testCarnavalTuesdayBefore1700(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/ChristmasDayTest.php b/tests/Brazil/ChristmasDayTest.php index 96430d358..387240ebb 100644 --- a/tests/Brazil/ChristmasDayTest.php +++ b/tests/Brazil/ChristmasDayTest.php @@ -34,7 +34,7 @@ class ChristmasDayTest extends BrazilBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testChristmasDay() + public function testChristmasDay(): void { $year = 1897; $this->assertHoliday( diff --git a/tests/Brazil/CorpusChristiTest.php b/tests/Brazil/CorpusChristiTest.php index d823cc9c7..46243df79 100644 --- a/tests/Brazil/CorpusChristiTest.php +++ b/tests/Brazil/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends BrazilBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 1997; $this->assertHoliday( diff --git a/tests/Brazil/EasterTest.php b/tests/Brazil/EasterTest.php index 8b0f75dbd..f67917fd2 100644 --- a/tests/Brazil/EasterTest.php +++ b/tests/Brazil/EasterTest.php @@ -35,7 +35,7 @@ class EasterTest extends BrazilBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testEaster() + public function testEaster(): void { $year = 1948; $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $this->calculateEaster($year, self::TIMEZONE)); diff --git a/tests/Brazil/GoodFridayTest.php b/tests/Brazil/GoodFridayTest.php index 24a0a1d20..a398a6c4b 100644 --- a/tests/Brazil/GoodFridayTest.php +++ b/tests/Brazil/GoodFridayTest.php @@ -37,7 +37,7 @@ class GoodFridayTest extends BrazilBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testGoodFriday() + public function testGoodFriday(): void { $year = 1997; $this->assertHoliday( diff --git a/tests/Brazil/IndependenceDayTest.php b/tests/Brazil/IndependenceDayTest.php index 6d891bace..9704b59e6 100644 --- a/tests/Brazil/IndependenceDayTest.php +++ b/tests/Brazil/IndependenceDayTest.php @@ -39,7 +39,7 @@ class IndependenceDayTest extends BrazilBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testDiaDaIndependenciaDoBrasilAfter1822() + public function testDiaDaIndependenciaDoBrasilAfter1822(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testDiaDaIndependenciaDoBrasilAfter1822() * Tests Dia da independência do Brasil on or before 1822. * @throws ReflectionException */ - public function testDiaDaIndependenciaDoBrasilBefore1822() + public function testDiaDaIndependenciaDoBrasilBefore1822(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/InternationalWorkersDayTest.php b/tests/Brazil/InternationalWorkersDayTest.php index 439a2ffe4..48b84d939 100644 --- a/tests/Brazil/InternationalWorkersDayTest.php +++ b/tests/Brazil/InternationalWorkersDayTest.php @@ -34,7 +34,7 @@ class InternationalWorkersDayTest extends BrazilBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testInternationalWorkersDay() + public function testInternationalWorkersDay(): void { $year = 1927; $this->assertHoliday( diff --git a/tests/Brazil/NewYearsDayTest.php b/tests/Brazil/NewYearsDayTest.php index 69e66dde3..26e36c6ce 100644 --- a/tests/Brazil/NewYearsDayTest.php +++ b/tests/Brazil/NewYearsDayTest.php @@ -34,7 +34,7 @@ class NewYearsDayTest extends BrazilBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testNewYearsDay() + public function testNewYearsDay(): void { $year = 1997; $this->assertHoliday( diff --git a/tests/Brazil/OurLadyOfAparecidaDayTest.php b/tests/Brazil/OurLadyOfAparecidaDayTest.php index 3be429cc0..fcb50dca0 100644 --- a/tests/Brazil/OurLadyOfAparecidaDayTest.php +++ b/tests/Brazil/OurLadyOfAparecidaDayTest.php @@ -39,7 +39,7 @@ class OurLadyOfAparecidaDayTest extends BrazilBaseTestCase implements YasumiTest * @throws Exception * @throws ReflectionException */ - public function testNossaSenhoraAparecidaAfter1980() + public function testNossaSenhoraAparecidaAfter1980(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testNossaSenhoraAparecidaAfter1980() * Tests Nossa Senhora Aparecida on or before 1980. * @throws ReflectionException */ - public function testNossaSenhoraAparecidaBefore1980() + public function testNossaSenhoraAparecidaBefore1980(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/ProclamationOfRepublicDayTest.php b/tests/Brazil/ProclamationOfRepublicDayTest.php index 57fa79ba8..b5927faae 100644 --- a/tests/Brazil/ProclamationOfRepublicDayTest.php +++ b/tests/Brazil/ProclamationOfRepublicDayTest.php @@ -39,7 +39,7 @@ class ProclamationOfRepublicDayTest extends BrazilBaseTestCase implements Yasumi * @throws Exception * @throws ReflectionException */ - public function testProclamacaoDaRepublicaAfter1889() + public function testProclamacaoDaRepublicaAfter1889(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testProclamacaoDaRepublicaAfter1889() * Tests Proclamação da República on or before 1889. * @throws ReflectionException */ - public function testProclamacaoDaRepublicaBefore1889() + public function testProclamacaoDaRepublicaBefore1889(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Brazil/TiradentesDayTest.php b/tests/Brazil/TiradentesDayTest.php index 2520dfa2b..5fea88365 100644 --- a/tests/Brazil/TiradentesDayTest.php +++ b/tests/Brazil/TiradentesDayTest.php @@ -39,7 +39,7 @@ class TiradentesDayTest extends BrazilBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testDiaDeTiradentesAfter1792() + public function testDiaDeTiradentesAfter1792(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testDiaDeTiradentesAfter1792() * Tests Dia de Tiradentes on or before 1792. * @throws ReflectionException */ - public function testDiaDeTiradentesBefore1792() + public function testDiaDeTiradentesBefore1792(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Canada/CanadaDayTest.php b/tests/Canada/CanadaDayTest.php index e49293f70..71a111818 100644 --- a/tests/Canada/CanadaDayTest.php +++ b/tests/Canada/CanadaDayTest.php @@ -39,7 +39,7 @@ class CanadaDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testCanadaDayOnAfter1983() + public function testCanadaDayOnAfter1983(): void { $year = $this->generateRandomYear(1983); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testCanadaDayOnAfter1983() * Tests Canada Day before 1879. Canada Day was established as Dominion Day in 1879 on July 1st. * @throws ReflectionException */ - public function testCanadaDayBefore1879() + public function testCanadaDayBefore1879(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Canada/ChristmasDayTest.php b/tests/Canada/ChristmasDayTest.php index 7b21f9708..93016dd2d 100644 --- a/tests/Canada/ChristmasDayTest.php +++ b/tests/Canada/ChristmasDayTest.php @@ -34,7 +34,7 @@ class ChristmasDayTest extends CanadaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testChristmasDay() + public function testChristmasDay(): void { $year = 2001; $this->assertHoliday( diff --git a/tests/Canada/LabourDayTest.php b/tests/Canada/LabourDayTest.php index abb9303d5..a2980d907 100644 --- a/tests/Canada/LabourDayTest.php +++ b/tests/Canada/LabourDayTest.php @@ -39,7 +39,7 @@ class LabourDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testLabourDayOnAfter1894() + public function testLabourDayOnAfter1894(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testLabourDayOnAfter1894() * Tests Labour Day before 1894. Labour Day was established since 1894 on the first Monday of September. * @throws ReflectionException */ - public function testLabourDayBefore1894() + public function testLabourDayBefore1894(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Canada/NewYearsDayTest.php b/tests/Canada/NewYearsDayTest.php index 867512312..cd161c5b3 100644 --- a/tests/Canada/NewYearsDayTest.php +++ b/tests/Canada/NewYearsDayTest.php @@ -34,7 +34,7 @@ class NewYearsDayTest extends CanadaBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testNewYearsDay() + public function testNewYearsDay(): void { $year = 1997; $this->assertHoliday( diff --git a/tests/Canada/RemembranceDayTest.php b/tests/Canada/RemembranceDayTest.php index 1efc8bb91..df621108e 100644 --- a/tests/Canada/RemembranceDayTest.php +++ b/tests/Canada/RemembranceDayTest.php @@ -39,7 +39,7 @@ class RemembranceDayTest extends CanadaBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testRemembranceDayOnAfter1919() + public function testRemembranceDayOnAfter1919(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testRemembranceDayOnAfter1919() * Tests Remembrance Day before 1919. Remembrance Day was established in 1919 on November 11. * @throws ReflectionException */ - public function testVeteransDayBefore1919() + public function testVeteransDayBefore1919(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Canada/ThanksgivingDayTest.php b/tests/Canada/ThanksgivingDayTest.php index 5ec7c8317..2b3d1f74c 100644 --- a/tests/Canada/ThanksgivingDayTest.php +++ b/tests/Canada/ThanksgivingDayTest.php @@ -40,7 +40,7 @@ class ThanksgivingDayTest extends CanadaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testThanksgivingDayOnAfter1879() + public function testThanksgivingDayOnAfter1879(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -56,7 +56,7 @@ public function testThanksgivingDayOnAfter1879() * of October. * @throws ReflectionException */ - public function testThanksgivingDayBefore1879() + public function testThanksgivingDayBefore1879(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Croatia/AllSaintsDayTest.php b/tests/Croatia/AllSaintsDayTest.php index 39e4b40ea..56c8f7f72 100644 --- a/tests/Croatia/AllSaintsDayTest.php +++ b/tests/Croatia/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/AntifascistStruggleDayTest.php b/tests/Croatia/AntifascistStruggleDayTest.php index 1e83e60d6..c736e336f 100644 --- a/tests/Croatia/AntifascistStruggleDayTest.php +++ b/tests/Croatia/AntifascistStruggleDayTest.php @@ -39,7 +39,7 @@ class AntifascistStruggleDayTest extends CroatiaBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testAntifascistStruggleDayOnAfter1941() + public function testAntifascistStruggleDayOnAfter1941(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testAntifascistStruggleDayOnAfter1941() * Tests Day of Antifascist Struggle before 1941. * @throws ReflectionException */ - public function testAntifascistStruggleDayBefore1941() + public function testAntifascistStruggleDayBefore1941(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Croatia/AssumptionOfMaryTest.php b/tests/Croatia/AssumptionOfMaryTest.php index c1a2f5ac1..d0f8699d9 100644 --- a/tests/Croatia/AssumptionOfMaryTest.php +++ b/tests/Croatia/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends CroatiaBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/ChristmasDayTest.php b/tests/Croatia/ChristmasDayTest.php index 0bf6371dd..14133006b 100644 --- a/tests/Croatia/ChristmasDayTest.php +++ b/tests/Croatia/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/CorpusChristiTest.php b/tests/Croatia/CorpusChristiTest.php index 1762e8bed..6133fef74 100644 --- a/tests/Croatia/CorpusChristiTest.php +++ b/tests/Croatia/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends CroatiaBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 1997; $this->assertHoliday( diff --git a/tests/Croatia/EasterMondayTest.php b/tests/Croatia/EasterMondayTest.php index 4739f6112..ef63715ea 100644 --- a/tests/Croatia/EasterMondayTest.php +++ b/tests/Croatia/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends CroatiaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1677; $this->assertHoliday( diff --git a/tests/Croatia/EasterTest.php b/tests/Croatia/EasterTest.php index a86b12949..417fdadba 100644 --- a/tests/Croatia/EasterTest.php +++ b/tests/Croatia/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends CroatiaBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1677; $this->assertHoliday( diff --git a/tests/Croatia/EpiphanyTest.php b/tests/Croatia/EpiphanyTest.php index 71a7aece0..23c610cda 100644 --- a/tests/Croatia/EpiphanyTest.php +++ b/tests/Croatia/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends CroatiaBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/HomelandThanksgivingDayTest.php b/tests/Croatia/HomelandThanksgivingDayTest.php index 24ee36efd..468595a90 100644 --- a/tests/Croatia/HomelandThanksgivingDayTest.php +++ b/tests/Croatia/HomelandThanksgivingDayTest.php @@ -44,7 +44,7 @@ class HomelandThanksgivingDayTest extends CroatiaBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testHomelandThanksgivingDayOnAfter1995() + public function testHomelandThanksgivingDayOnAfter1995(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -59,7 +59,7 @@ public function testHomelandThanksgivingDayOnAfter1995() * Tests Homeland Thanksgiving Day before 1995. * @throws ReflectionException */ - public function testHomelandThanksgivingDayBefore1995() + public function testHomelandThanksgivingDayBefore1995(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Croatia/IndependenceDayTest.php b/tests/Croatia/IndependenceDayTest.php index 95a40d791..dc24085fc 100644 --- a/tests/Croatia/IndependenceDayTest.php +++ b/tests/Croatia/IndependenceDayTest.php @@ -44,7 +44,7 @@ class IndependenceDayTest extends CroatiaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testIndependenceDayOnAfter1991() + public function testIndependenceDayOnAfter1991(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DISBANDMENT_YEAR - 1); $this->assertHoliday( @@ -59,7 +59,7 @@ public function testIndependenceDayOnAfter1991() * Tests Independence Day before 1991. * @throws ReflectionException */ - public function testIndependenceDayBefore1991() + public function testIndependenceDayBefore1991(): void { $this->assertNotHoliday( self::REGION, @@ -72,7 +72,7 @@ public function testIndependenceDayBefore1991() * Tests Independence Day before 1991. * @throws ReflectionException */ - public function testIndependenceDayAfterDisbandment() + public function testIndependenceDayAfterDisbandment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Croatia/InternationalWorkersDayTest.php b/tests/Croatia/InternationalWorkersDayTest.php index ced8d7f81..86cf71145 100644 --- a/tests/Croatia/InternationalWorkersDayTest.php +++ b/tests/Croatia/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends CroatiaBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/NewYearsDayTest.php b/tests/Croatia/NewYearsDayTest.php index e9fa0311b..6a4b566e6 100644 --- a/tests/Croatia/NewYearsDayTest.php +++ b/tests/Croatia/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/RemembranceDayTest.php b/tests/Croatia/RemembranceDayTest.php index 3d58faa0d..da041ac03 100644 --- a/tests/Croatia/RemembranceDayTest.php +++ b/tests/Croatia/RemembranceDayTest.php @@ -39,7 +39,7 @@ class RemembranceDayTest extends CroatiaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testRemembranceDayAfterItWasEstablished() + public function testRemembranceDayAfterItWasEstablished(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testRemembranceDayAfterItWasEstablished() * @throws Exception * @throws ReflectionException */ - public function testRemembranceDayBeforeItWasEstablished() + public function testRemembranceDayBeforeItWasEstablished(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Croatia/StStephensDayTest.php b/tests/Croatia/StStephensDayTest.php index b4ceed92d..a07da50f5 100644 --- a/tests/Croatia/StStephensDayTest.php +++ b/tests/Croatia/StStephensDayTest.php @@ -38,7 +38,7 @@ class StStephensDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function teststStephensDay($year, $expected) + public function teststStephensDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Croatia/StatehoodDayTest.php b/tests/Croatia/StatehoodDayTest.php index a8d1100d2..327b9698d 100644 --- a/tests/Croatia/StatehoodDayTest.php +++ b/tests/Croatia/StatehoodDayTest.php @@ -44,7 +44,7 @@ class StatehoodDayTest extends CroatiaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testStatehoodDay() + public function testStatehoodDay(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::DATE_CHANGE_YEAR - 1); $expectedDate = "$year-6-25"; @@ -69,7 +69,7 @@ public function testStatehoodDay() * Tests Statehood Day before 1991. * @throws ReflectionException */ - public function testStatehoodDayBefore1991() + public function testStatehoodDayBefore1991(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/CzechRepublic/ChristmasDayTest.php b/tests/CzechRepublic/ChristmasDayTest.php index d24bef721..c8d5029f0 100644 --- a/tests/CzechRepublic/ChristmasDayTest.php +++ b/tests/CzechRepublic/ChristmasDayTest.php @@ -42,7 +42,7 @@ class ChristmasDayTest extends CzechRepublicBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/ChristmasEveTest.php b/tests/CzechRepublic/ChristmasEveTest.php index 5194713a7..88e98a754 100644 --- a/tests/CzechRepublic/ChristmasEveTest.php +++ b/tests/CzechRepublic/ChristmasEveTest.php @@ -42,7 +42,7 @@ class ChristmasEveTest extends CzechRepublicBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/CzechStateHoodDayTest.php b/tests/CzechRepublic/CzechStateHoodDayTest.php index 7c231dbdc..bd59834d1 100644 --- a/tests/CzechRepublic/CzechStateHoodDayTest.php +++ b/tests/CzechRepublic/CzechStateHoodDayTest.php @@ -42,7 +42,7 @@ class CzechStateHoodDayTest extends CzechRepublicBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/EasterMondayTest.php b/tests/CzechRepublic/EasterMondayTest.php index 571b4194a..eb63bc91f 100644 --- a/tests/CzechRepublic/EasterMondayTest.php +++ b/tests/CzechRepublic/EasterMondayTest.php @@ -38,7 +38,7 @@ class EasterMondayTest extends CzechRepublicBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2000; $this->assertHoliday( diff --git a/tests/CzechRepublic/GoodFridayTest.php b/tests/CzechRepublic/GoodFridayTest.php index 14fafbc6a..626ba5c96 100644 --- a/tests/CzechRepublic/GoodFridayTest.php +++ b/tests/CzechRepublic/GoodFridayTest.php @@ -38,7 +38,7 @@ class GoodFridayTest extends CzechRepublicBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testGoodFriday() + public function testGoodFriday(): void { $year = 1876; $this->assertHoliday( diff --git a/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php b/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php index 51cf6a7d4..0f38fce79 100644 --- a/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php +++ b/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php @@ -38,7 +38,7 @@ class IndependentCzechoslovakStateDayTest extends CzechRepublicBaseTestCase impl * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/InternationalWorkersDayTest.php b/tests/CzechRepublic/InternationalWorkersDayTest.php index b355ad4ad..0bbf4f97a 100644 --- a/tests/CzechRepublic/InternationalWorkersDayTest.php +++ b/tests/CzechRepublic/InternationalWorkersDayTest.php @@ -42,7 +42,7 @@ class InternationalWorkersDayTest extends CzechRepublicBaseTestCase implements Y * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/JanHusDayTest.php b/tests/CzechRepublic/JanHusDayTest.php index a6c321642..2f3f46a91 100644 --- a/tests/CzechRepublic/JanHusDayTest.php +++ b/tests/CzechRepublic/JanHusDayTest.php @@ -38,7 +38,7 @@ class JanHusDayTest extends CzechRepublicBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/NewYearsDayTest.php b/tests/CzechRepublic/NewYearsDayTest.php index 01c4945f2..019d78917 100644 --- a/tests/CzechRepublic/NewYearsDayTest.php +++ b/tests/CzechRepublic/NewYearsDayTest.php @@ -42,7 +42,7 @@ class NewYearsDayTest extends CzechRepublicBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php b/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php index a2b3bd59f..b57f28bad 100644 --- a/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php +++ b/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php @@ -43,7 +43,7 @@ class RenewalOfIndependentCzechStateDayTest extends CzechRepublicBaseTestCase im * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php b/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php index 35b194924..5e66ce7d9 100644 --- a/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php +++ b/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php @@ -42,7 +42,7 @@ class SaintsCyrilAndMethodiusDayTest extends CzechRepublicBaseTestCase implement * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/SecondChristmasDayTest.php b/tests/CzechRepublic/SecondChristmasDayTest.php index 44afffea0..783f9e41a 100644 --- a/tests/CzechRepublic/SecondChristmasDayTest.php +++ b/tests/CzechRepublic/SecondChristmasDayTest.php @@ -42,7 +42,7 @@ class SecondChristmasDayTest extends CzechRepublicBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php b/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php index 9987e49ab..1fe0aaf81 100644 --- a/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php +++ b/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php @@ -38,7 +38,7 @@ class StruggleForFreedomAndDemocracyDayTest extends CzechRepublicBaseTestCase im * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/CzechRepublic/VictoryInEuropeDayTest.php b/tests/CzechRepublic/VictoryInEuropeDayTest.php index 9b12a1d88..e582854cf 100644 --- a/tests/CzechRepublic/VictoryInEuropeDayTest.php +++ b/tests/CzechRepublic/VictoryInEuropeDayTest.php @@ -42,7 +42,7 @@ class VictoryInEuropeDayTest extends CzechRepublicBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/AscensionDayTest.php b/tests/Denmark/AscensionDayTest.php index d91878da3..3d5ee2fb2 100644 --- a/tests/Denmark/AscensionDayTest.php +++ b/tests/Denmark/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends DenmarkBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 2806; $this->assertHoliday( diff --git a/tests/Denmark/ChristmasDayTest.php b/tests/Denmark/ChristmasDayTest.php index 4ba42438a..9fabd5517 100644 --- a/tests/Denmark/ChristmasDayTest.php +++ b/tests/Denmark/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends DenmarkBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/ChristmasEveTest.php b/tests/Denmark/ChristmasEveTest.php index 18d414e6a..53b0ac90a 100644 --- a/tests/Denmark/ChristmasEveTest.php +++ b/tests/Denmark/ChristmasEveTest.php @@ -38,7 +38,7 @@ class ChristmasEveTest extends DenmarkBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/ConstitutionDayTest.php b/tests/Denmark/ConstitutionDayTest.php index 9863a0ad5..6f9bc8683 100644 --- a/tests/Denmark/ConstitutionDayTest.php +++ b/tests/Denmark/ConstitutionDayTest.php @@ -39,7 +39,7 @@ class ConstitutionDayTest extends DenmarkBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2077; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Denmark/EasterMondayTest.php b/tests/Denmark/EasterMondayTest.php index b987febfd..3e13c7f53 100644 --- a/tests/Denmark/EasterMondayTest.php +++ b/tests/Denmark/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends DenmarkBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2000; $this->assertHoliday( diff --git a/tests/Denmark/EasterTest.php b/tests/Denmark/EasterTest.php index e519373f1..94be28454 100644 --- a/tests/Denmark/EasterTest.php +++ b/tests/Denmark/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends DenmarkBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2654; $this->assertHoliday( diff --git a/tests/Denmark/GoodFridayTest.php b/tests/Denmark/GoodFridayTest.php index 4151d7e19..507ebbcc8 100644 --- a/tests/Denmark/GoodFridayTest.php +++ b/tests/Denmark/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends DenmarkBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2178; $this->assertHoliday( diff --git a/tests/Denmark/GreatPrayerDayTest.php b/tests/Denmark/GreatPrayerDayTest.php index e46c5ef93..8a86d5eb3 100644 --- a/tests/Denmark/GreatPrayerDayTest.php +++ b/tests/Denmark/GreatPrayerDayTest.php @@ -39,7 +39,7 @@ class GreatPrayerDayTest extends DenmarkBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2022; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Denmark/InternationalWorkersDayTest.php b/tests/Denmark/InternationalWorkersDayTest.php index 37b4cb111..f69162edf 100644 --- a/tests/Denmark/InternationalWorkersDayTest.php +++ b/tests/Denmark/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends DenmarkBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/MaundyThursdayTest.php b/tests/Denmark/MaundyThursdayTest.php index 0a6b206f3..f88bbbd30 100644 --- a/tests/Denmark/MaundyThursdayTest.php +++ b/tests/Denmark/MaundyThursdayTest.php @@ -34,7 +34,7 @@ class MaundyThursdayTest extends DenmarkBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1866; $this->assertHoliday( diff --git a/tests/Denmark/NewYearsDayTest.php b/tests/Denmark/NewYearsDayTest.php index 546465012..5e738ec15 100644 --- a/tests/Denmark/NewYearsDayTest.php +++ b/tests/Denmark/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends DenmarkBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/NewYearsEveTest.php b/tests/Denmark/NewYearsEveTest.php index afa36d192..51a7e2f04 100644 --- a/tests/Denmark/NewYearsEveTest.php +++ b/tests/Denmark/NewYearsEveTest.php @@ -38,7 +38,7 @@ class NewYearsEveTest extends DenmarkBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/PentecostMondayTest.php b/tests/Denmark/PentecostMondayTest.php index 74c9d8141..d4881687e 100644 --- a/tests/Denmark/PentecostMondayTest.php +++ b/tests/Denmark/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends DenmarkBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Denmark/PentecostTest.php b/tests/Denmark/PentecostTest.php index af0e18bf0..77f81a56c 100644 --- a/tests/Denmark/PentecostTest.php +++ b/tests/Denmark/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends DenmarkBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Denmark/SecondChristmasDayTest.php b/tests/Denmark/SecondChristmasDayTest.php index 927eddc83..17ccbd161 100644 --- a/tests/Denmark/SecondChristmasDayTest.php +++ b/tests/Denmark/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends DenmarkBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Denmark/SummerTimeTest.php b/tests/Denmark/SummerTimeTest.php index 36c766686..93b881f9a 100644 --- a/tests/Denmark/SummerTimeTest.php +++ b/tests/Denmark/SummerTimeTest.php @@ -35,7 +35,7 @@ class SummerTimeTest extends DenmarkBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testSummerTime() + public function testSummerTime(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1949, 1979)); diff --git a/tests/Denmark/WinterTimeTest.php b/tests/Denmark/WinterTimeTest.php index 5b3cd1283..3309e88c4 100644 --- a/tests/Denmark/WinterTimeTest.php +++ b/tests/Denmark/WinterTimeTest.php @@ -35,7 +35,7 @@ class WinterTimeTest extends DenmarkBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testWinterTime() + public function testWinterTime(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1949, 1979)); diff --git a/tests/Estonia/ChristmasDayTest.php b/tests/Estonia/ChristmasDayTest.php index 5b9054a72..31fa72058 100644 --- a/tests/Estonia/ChristmasDayTest.php +++ b/tests/Estonia/ChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/ChristmasEveDayTest.php b/tests/Estonia/ChristmasEveDayTest.php index 484312708..1705ab8ac 100644 --- a/tests/Estonia/ChristmasEveDayTest.php +++ b/tests/Estonia/ChristmasEveDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/EasterDayTest.php b/tests/Estonia/EasterDayTest.php index f7a6b8dc2..83c19176e 100644 --- a/tests/Estonia/EasterDayTest.php +++ b/tests/Estonia/EasterDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Estonia/GoodFridayDayTest.php b/tests/Estonia/GoodFridayDayTest.php index 0353a3368..0d0a7b6b3 100644 --- a/tests/Estonia/GoodFridayDayTest.php +++ b/tests/Estonia/GoodFridayDayTest.php @@ -53,7 +53,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Estonia/IndependenceDayTest.php b/tests/Estonia/IndependenceDayTest.php index dc997b461..1ad9a2764 100644 --- a/tests/Estonia/IndependenceDayTest.php +++ b/tests/Estonia/IndependenceDayTest.php @@ -37,7 +37,7 @@ class IndependenceDayTest extends EstoniaBaseTestCase implements YasumiTestCaseI * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Estonia::DECLARATION_OF_INDEPENDENCE_YEAR); diff --git a/tests/Estonia/InternationalWorkersDayTest.php b/tests/Estonia/InternationalWorkersDayTest.php index d8debaab8..cacf2b4cd 100644 --- a/tests/Estonia/InternationalWorkersDayTest.php +++ b/tests/Estonia/InternationalWorkersDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/NewYearsDayTest.php b/tests/Estonia/NewYearsDayTest.php index 9f477c912..2f8bba77f 100644 --- a/tests/Estonia/NewYearsDayTest.php +++ b/tests/Estonia/NewYearsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/PentecostTest.php b/tests/Estonia/PentecostTest.php index 313c5700f..1655b2401 100644 --- a/tests/Estonia/PentecostTest.php +++ b/tests/Estonia/PentecostTest.php @@ -53,7 +53,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Estonia/RestorationOfIndependenceDayTest.php b/tests/Estonia/RestorationOfIndependenceDayTest.php index 9ced8e369..ff66d3fac 100644 --- a/tests/Estonia/RestorationOfIndependenceDayTest.php +++ b/tests/Estonia/RestorationOfIndependenceDayTest.php @@ -37,7 +37,7 @@ class RestorationOfIndependenceDayTest extends EstoniaBaseTestCase implements Ya * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Estonia::RESTORATION_OF_INDEPENDENCE_YEAR); diff --git a/tests/Estonia/SecondChristmasDayTest.php b/tests/Estonia/SecondChristmasDayTest.php index 0dd791b37..2c6def0b2 100644 --- a/tests/Estonia/SecondChristmasDayTest.php +++ b/tests/Estonia/SecondChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/StJohnsDayTest.php b/tests/Estonia/StJohnsDayTest.php index 63dea6ce4..8caa93331 100644 --- a/tests/Estonia/StJohnsDayTest.php +++ b/tests/Estonia/StJohnsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Estonia/VictoryDayTest.php b/tests/Estonia/VictoryDayTest.php index 1fab6a99b..41f83d3e7 100644 --- a/tests/Estonia/VictoryDayTest.php +++ b/tests/Estonia/VictoryDayTest.php @@ -37,7 +37,7 @@ class VictoryDayTest extends EstoniaBaseTestCase implements YasumiTestCaseInterf * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Estonia::VICTORY_DAY_START_YEAR); diff --git a/tests/Finland/AllSaintsDayTest.php b/tests/Finland/AllSaintsDayTest.php index 76d0ce2ec..2fb7e3076 100644 --- a/tests/Finland/AllSaintsDayTest.php +++ b/tests/Finland/AllSaintsDayTest.php @@ -40,7 +40,7 @@ class AllSaintsDayTest extends FinlandBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/AscensionDayTest.php b/tests/Finland/AscensionDayTest.php index 01e0dcf8c..4ecd5321a 100644 --- a/tests/Finland/AscensionDayTest.php +++ b/tests/Finland/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends FinlandBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2005; $this->assertHoliday( diff --git a/tests/Finland/ChristmasDayTest.php b/tests/Finland/ChristmasDayTest.php index 4f2de594b..a307d415c 100644 --- a/tests/Finland/ChristmasDayTest.php +++ b/tests/Finland/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends FinlandBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/EasterMondayTest.php b/tests/Finland/EasterMondayTest.php index e9244749b..ac750b10f 100644 --- a/tests/Finland/EasterMondayTest.php +++ b/tests/Finland/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends FinlandBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1677; $this->assertHoliday( diff --git a/tests/Finland/EasterTest.php b/tests/Finland/EasterTest.php index 53fbc47a8..5b4522438 100644 --- a/tests/Finland/EasterTest.php +++ b/tests/Finland/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends FinlandBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1677; $this->assertHoliday( diff --git a/tests/Finland/EpiphanyTest.php b/tests/Finland/EpiphanyTest.php index 6460b0f60..3134a72b7 100644 --- a/tests/Finland/EpiphanyTest.php +++ b/tests/Finland/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends FinlandBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/GoodFridayTest.php b/tests/Finland/GoodFridayTest.php index 66f4ad090..c3508d22d 100644 --- a/tests/Finland/GoodFridayTest.php +++ b/tests/Finland/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends FinlandBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1788; $this->assertHoliday( diff --git a/tests/Finland/IndependenceDayTest.php b/tests/Finland/IndependenceDayTest.php index 010738de4..f25af7ea1 100644 --- a/tests/Finland/IndependenceDayTest.php +++ b/tests/Finland/IndependenceDayTest.php @@ -39,7 +39,7 @@ class IndependenceDayTest extends FinlandBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2018; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Finland/InternationalWorkersDayTest.php b/tests/Finland/InternationalWorkersDayTest.php index 6eaad7477..ebf91dcb5 100644 --- a/tests/Finland/InternationalWorkersDayTest.php +++ b/tests/Finland/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends FinlandBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/NewYearsDayTest.php b/tests/Finland/NewYearsDayTest.php index f92976b48..0f82836bf 100644 --- a/tests/Finland/NewYearsDayTest.php +++ b/tests/Finland/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends FinlandBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/PentecostTest.php b/tests/Finland/PentecostTest.php index 7b93b367d..071b631ae 100644 --- a/tests/Finland/PentecostTest.php +++ b/tests/Finland/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends FinlandBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1344; $this->assertHoliday( diff --git a/tests/Finland/SecondChristmasDayTest.php b/tests/Finland/SecondChristmasDayTest.php index 0cef0a142..d83d753dc 100644 --- a/tests/Finland/SecondChristmasDayTest.php +++ b/tests/Finland/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends FinlandBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Finland/stJohnsDayTest.php b/tests/Finland/stJohnsDayTest.php index b99feba50..9a943b0e2 100644 --- a/tests/Finland/stJohnsDayTest.php +++ b/tests/Finland/stJohnsDayTest.php @@ -44,7 +44,7 @@ class stJohnsDayTest extends FinlandBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHolidayBeforeAdjustment() + public function testHolidayBeforeAdjustment(): void { $year = 1944; $this->assertHoliday( @@ -59,7 +59,7 @@ public function testHolidayBeforeAdjustment() * Tests the holiday before it was adjusted. * @throws ReflectionException */ - public function testHolidayAfterAdjustment() + public function testHolidayAfterAdjustment(): void { $year = $this->generateRandomYear(self::ADJUSTMENT_YEAR); diff --git a/tests/France/AllSaintsDayTest.php b/tests/France/AllSaintsDayTest.php index 74a93a772..ec10c05a5 100644 --- a/tests/France/AllSaintsDayTest.php +++ b/tests/France/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends FranceBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/ArmisticeDayTest.php b/tests/France/ArmisticeDayTest.php index 9f88cc82b..8e3cab720 100644 --- a/tests/France/ArmisticeDayTest.php +++ b/tests/France/ArmisticeDayTest.php @@ -39,7 +39,7 @@ class ArmisticeDayTest extends FranceBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testArmisticeDayOnAfter1919() + public function testArmisticeDayOnAfter1919(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testArmisticeDayOnAfter1919() * Tests Armistice Day before 1919. * @throws ReflectionException */ - public function testArmisticeDayBefore1919() + public function testArmisticeDayBefore1919(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/France/AscensionDayTest.php b/tests/France/AscensionDayTest.php index cdcaad39b..1f8c522c8 100644 --- a/tests/France/AscensionDayTest.php +++ b/tests/France/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends FranceBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/France/AssumptionOfMaryTest.php b/tests/France/AssumptionOfMaryTest.php index b8b1080c2..626e7d890 100644 --- a/tests/France/AssumptionOfMaryTest.php +++ b/tests/France/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends FranceBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/BasRhin/GoodFridayTest.php b/tests/France/BasRhin/GoodFridayTest.php index a342e8607..3bd94af4d 100644 --- a/tests/France/BasRhin/GoodFridayTest.php +++ b/tests/France/BasRhin/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends BasRhinBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/France/BasRhin/stStephensDayTest.php b/tests/France/BasRhin/stStephensDayTest.php index 7237fb781..b4813b717 100644 --- a/tests/France/BasRhin/stStephensDayTest.php +++ b/tests/France/BasRhin/stStephensDayTest.php @@ -38,7 +38,7 @@ class stStephensDayTest extends BasRhinBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/BastilleDayTest.php b/tests/France/BastilleDayTest.php index 84666aeba..d64fd4f71 100644 --- a/tests/France/BastilleDayTest.php +++ b/tests/France/BastilleDayTest.php @@ -39,7 +39,7 @@ class BastilleDayTest extends FranceBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testBastilleDayOnAfter1790() + public function testBastilleDayOnAfter1790(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testBastilleDayOnAfter1790() * Tests Bastille Day before 1790. * @throws ReflectionException */ - public function testBastilleDayBefore1790() + public function testBastilleDayBefore1790(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/France/ChristmasDayTest.php b/tests/France/ChristmasDayTest.php index 9fd1349de..c6801d578 100644 --- a/tests/France/ChristmasDayTest.php +++ b/tests/France/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends FranceBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/EasterMondayTest.php b/tests/France/EasterMondayTest.php index a9d44d164..9b58b06dd 100644 --- a/tests/France/EasterMondayTest.php +++ b/tests/France/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends FranceBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/France/HautRhin/GoodFridayTest.php b/tests/France/HautRhin/GoodFridayTest.php index f69829dfd..e492c72c9 100644 --- a/tests/France/HautRhin/GoodFridayTest.php +++ b/tests/France/HautRhin/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends HautRhinBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/France/HautRhin/stStephensDayTest.php b/tests/France/HautRhin/stStephensDayTest.php index 78a2af06b..6d21b370b 100644 --- a/tests/France/HautRhin/stStephensDayTest.php +++ b/tests/France/HautRhin/stStephensDayTest.php @@ -38,7 +38,7 @@ class stStephensDayTest extends HautRhinBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/InternationalWorkersDayTest.php b/tests/France/InternationalWorkersDayTest.php index 4438c42c4..d39721249 100644 --- a/tests/France/InternationalWorkersDayTest.php +++ b/tests/France/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends FranceBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/Moselle/GoodFridayTest.php b/tests/France/Moselle/GoodFridayTest.php index a4d29af08..6929c7198 100644 --- a/tests/France/Moselle/GoodFridayTest.php +++ b/tests/France/Moselle/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends MoselleBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2008; $this->assertHoliday( diff --git a/tests/France/Moselle/stStephensDayTest.php b/tests/France/Moselle/stStephensDayTest.php index 8a2ccd15d..7ba34cf6e 100644 --- a/tests/France/Moselle/stStephensDayTest.php +++ b/tests/France/Moselle/stStephensDayTest.php @@ -38,7 +38,7 @@ class stStephensDayTest extends MoselleBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/NewYearsDayTest.php b/tests/France/NewYearsDayTest.php index dc9f267ca..e7c76d48e 100644 --- a/tests/France/NewYearsDayTest.php +++ b/tests/France/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends FranceBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/France/PentecostMondayTest.php b/tests/France/PentecostMondayTest.php index 271bff083..36337c501 100644 --- a/tests/France/PentecostMondayTest.php +++ b/tests/France/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends FranceBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/France/VictoryInEuropeDayTest.php b/tests/France/VictoryInEuropeDayTest.php index 1353b1c22..a8bd081e8 100644 --- a/tests/France/VictoryInEuropeDayTest.php +++ b/tests/France/VictoryInEuropeDayTest.php @@ -39,7 +39,7 @@ class VictoryInEuropeDayTest extends FranceBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testVictoryInEuropeDayOnAfter1945() + public function testVictoryInEuropeDayOnAfter1945(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testVictoryInEuropeDayOnAfter1945() * Tests Victory In Europe Day before 1945. * @throws ReflectionException */ - public function testVictoryInEuropeDayBefore1945() + public function testVictoryInEuropeDayBefore1945(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/AscensionDayTest.php b/tests/Germany/AscensionDayTest.php index b2a39aaa7..57b5115d9 100644 --- a/tests/Germany/AscensionDayTest.php +++ b/tests/Germany/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends GermanyBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1754; $this->assertHoliday( diff --git a/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php b/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php index 72aacae24..57cd0e052 100644 --- a/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php +++ b/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends BadenWurttembergBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/BadenWurttemberg/CorpusChristiTest.php b/tests/Germany/BadenWurttemberg/CorpusChristiTest.php index f664386b7..f95af4df6 100644 --- a/tests/Germany/BadenWurttemberg/CorpusChristiTest.php +++ b/tests/Germany/BadenWurttemberg/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends BadenWurttembergBaseTestCase implements YasumiTe * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/BadenWurttemberg/EpiphanyTest.php b/tests/Germany/BadenWurttemberg/EpiphanyTest.php index 37980946b..f84b11b14 100644 --- a/tests/Germany/BadenWurttemberg/EpiphanyTest.php +++ b/tests/Germany/BadenWurttemberg/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends BadenWurttembergBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Bavaria/AllSaintsDayTest.php b/tests/Germany/Bavaria/AllSaintsDayTest.php index 5e25b4c3a..83ec98a96 100644 --- a/tests/Germany/Bavaria/AllSaintsDayTest.php +++ b/tests/Germany/Bavaria/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends BavariaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Bavaria/CorpusChristiTest.php b/tests/Germany/Bavaria/CorpusChristiTest.php index 74f05a6ea..804734054 100644 --- a/tests/Germany/Bavaria/CorpusChristiTest.php +++ b/tests/Germany/Bavaria/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends BavariaBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/Bavaria/EpiphanyTest.php b/tests/Germany/Bavaria/EpiphanyTest.php index 51b8aaa61..60821c075 100644 --- a/tests/Germany/Bavaria/EpiphanyTest.php +++ b/tests/Germany/Bavaria/EpiphanyTest.php @@ -39,7 +39,7 @@ class EpiphanyTest extends BavariaBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Berlin/DayOfLiberation2020Test.php b/tests/Germany/Berlin/DayOfLiberation2020Test.php index 84842284e..1b651c059 100644 --- a/tests/Germany/Berlin/DayOfLiberation2020Test.php +++ b/tests/Germany/Berlin/DayOfLiberation2020Test.php @@ -39,7 +39,7 @@ class DayOfLiberation2020Test extends BerlinBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHolidayInYear() + public function testHolidayInYear(): void { $this->assertHoliday( self::REGION, @@ -53,7 +53,7 @@ public function testHolidayInYear() * Test the holiday defined in this test in the years before * @throws ReflectionException */ - public function testHolidayBeforeYear() + public function testHolidayBeforeYear(): void { $this->assertNotHoliday( self::REGION, @@ -66,7 +66,7 @@ public function testHolidayBeforeYear() * Test the holiday defined in this test in the years after * @throws ReflectionException */ - public function testHolidayAfterYear() + public function testHolidayAfterYear(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/Berlin/InternationalWomensDay2019Test.php b/tests/Germany/Berlin/InternationalWomensDay2019Test.php index 30dc950d1..8a3b106e5 100644 --- a/tests/Germany/Berlin/InternationalWomensDay2019Test.php +++ b/tests/Germany/Berlin/InternationalWomensDay2019Test.php @@ -39,7 +39,7 @@ class InternationalWomensDay2019Test extends BerlinBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testHolidayOnEstablishment() + public function testHolidayOnEstablishment(): void { $this->assertHoliday( self::REGION, @@ -53,7 +53,7 @@ public function testHolidayOnEstablishment() * Test the holiday defined in this test before establishment * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -66,7 +66,7 @@ public function testHolidayBeforeEstablishment() * Test the holiday defined in this test after completion * @throws ReflectionException */ - public function testHolidayAfterCompletion() + public function testHolidayAfterCompletion(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1900, self::ESTABLISHMENT_YEAR - 1)); } diff --git a/tests/Germany/Brandenburg/ReformationDayTest.php b/tests/Germany/Brandenburg/ReformationDayTest.php index 5c6e53122..253a03ac5 100644 --- a/tests/Germany/Brandenburg/ReformationDayTest.php +++ b/tests/Germany/Brandenburg/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends BrandenburgBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/Bremen/ReformationDayTest.php b/tests/Germany/Bremen/ReformationDayTest.php index 7079c367d..060951cd3 100644 --- a/tests/Germany/Bremen/ReformationDayTest.php +++ b/tests/Germany/Bremen/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends BremenBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/ChristmasTest.php b/tests/Germany/ChristmasTest.php index e324877ca..6d3b42e63 100644 --- a/tests/Germany/ChristmasTest.php +++ b/tests/Germany/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends GermanyBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/EasterMondayTest.php b/tests/Germany/EasterMondayTest.php index 0a0648672..61ec54947 100644 --- a/tests/Germany/EasterMondayTest.php +++ b/tests/Germany/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends GermanyBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2000; $this->assertHoliday( diff --git a/tests/Germany/GermanUnityDayTest.php b/tests/Germany/GermanUnityDayTest.php index 77834ac27..454452b11 100644 --- a/tests/Germany/GermanUnityDayTest.php +++ b/tests/Germany/GermanUnityDayTest.php @@ -39,7 +39,7 @@ class GermanUnityDayTest extends GermanyBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2022; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/GoodFridayTest.php b/tests/Germany/GoodFridayTest.php index 3a97559f0..fea89c2f0 100644 --- a/tests/Germany/GoodFridayTest.php +++ b/tests/Germany/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends GermanyBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testGoodFriday() + public function testGoodFriday(): void { $year = 1876; $this->assertHoliday( diff --git a/tests/Germany/Hamburg/DayOfReformationTest.php b/tests/Germany/Hamburg/DayOfReformationTest.php index 7fb12468a..d66aca17f 100644 --- a/tests/Germany/Hamburg/DayOfReformationTest.php +++ b/tests/Germany/Hamburg/DayOfReformationTest.php @@ -44,7 +44,7 @@ class DayOfReformationTest extends HamburgBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/Hesse/CorpusChristiTest.php b/tests/Germany/Hesse/CorpusChristiTest.php index 5f3da8a6a..8f850e67f 100644 --- a/tests/Germany/Hesse/CorpusChristiTest.php +++ b/tests/Germany/Hesse/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends HesseBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/InternationalWorkersDayTest.php b/tests/Germany/InternationalWorkersDayTest.php index cced81b8f..9734882e2 100644 --- a/tests/Germany/InternationalWorkersDayTest.php +++ b/tests/Germany/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends GermanyBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/LowerSaxony/ReformationDayTest.php b/tests/Germany/LowerSaxony/ReformationDayTest.php index 956e6daec..80d66476e 100644 --- a/tests/Germany/LowerSaxony/ReformationDayTest.php +++ b/tests/Germany/LowerSaxony/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends LowerSaxonyBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php b/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php index 77db10c7e..081323e20 100644 --- a/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php +++ b/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php @@ -56,7 +56,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/NewYearsDayTest.php b/tests/Germany/NewYearsDayTest.php index 2b2a98fe1..a97217a01 100644 --- a/tests/Germany/NewYearsDayTest.php +++ b/tests/Germany/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends GermanyBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php b/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php index c1247e08c..6cbcf84c3 100644 --- a/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php +++ b/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends NorthRhineWestphaliaBaseTestCase implements Yasum * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php b/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php index 089f7c75f..572deea18 100644 --- a/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php +++ b/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends NorthRhineWestphaliaBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/PentecostMondayTest.php b/tests/Germany/PentecostMondayTest.php index 6a1b1e95e..9961520e0 100644 --- a/tests/Germany/PentecostMondayTest.php +++ b/tests/Germany/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends GermanyBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Germany/ReformationDay2017Test.php b/tests/Germany/ReformationDay2017Test.php index dc7262843..ac2ce4505 100644 --- a/tests/Germany/ReformationDay2017Test.php +++ b/tests/Germany/ReformationDay2017Test.php @@ -39,7 +39,7 @@ class ReformationDay2017Test extends GermanyBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHolidayOnEstablishment() + public function testHolidayOnEstablishment(): void { $this->assertHoliday( self::REGION, @@ -53,7 +53,7 @@ public function testHolidayOnEstablishment() * Test the holiday defined in this test before establishment * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -66,7 +66,7 @@ public function testHolidayBeforeEstablishment() * Test the holiday defined in this test after completion * @throws ReflectionException */ - public function testHolidayAfterCompletion() + public function testHolidayAfterCompletion(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR + 1)); } diff --git a/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php b/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php index ad2e5e44f..1fde91f3f 100644 --- a/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php +++ b/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends RhinelandPalatinateBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php b/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php index 58e53faba..1eafd5990 100644 --- a/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php +++ b/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends RhinelandPalatinateBaseTestCase implements Yasum * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/Saarland/AllSaintsDayTest.php b/tests/Germany/Saarland/AllSaintsDayTest.php index b3e44923b..f38e5b9f8 100644 --- a/tests/Germany/Saarland/AllSaintsDayTest.php +++ b/tests/Germany/Saarland/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends SaarlandBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Saarland/AssumptionOfMaryTest.php b/tests/Germany/Saarland/AssumptionOfMaryTest.php index 49d10e607..93b2c451b 100644 --- a/tests/Germany/Saarland/AssumptionOfMaryTest.php +++ b/tests/Germany/Saarland/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends SaarlandBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Saarland/CorpusChristiTest.php b/tests/Germany/Saarland/CorpusChristiTest.php index 509681466..79ded6cd7 100644 --- a/tests/Germany/Saarland/CorpusChristiTest.php +++ b/tests/Germany/Saarland/CorpusChristiTest.php @@ -37,7 +37,7 @@ class CorpusChristiTest extends SaarlandBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testCorpusChristi() + public function testCorpusChristi(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Germany/Saxony/ReformationDayTest.php b/tests/Germany/Saxony/ReformationDayTest.php index 362e91582..a8cdef935 100644 --- a/tests/Germany/Saxony/ReformationDayTest.php +++ b/tests/Germany/Saxony/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends SaxonyBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php b/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php index 9ddab993f..2180faef0 100644 --- a/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php +++ b/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php @@ -44,7 +44,7 @@ class RepentanceAndPrayerDayTest extends SaxonyBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { // Check between the 16th and 22nd day the one that is a Wednesday $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); @@ -62,7 +62,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/SaxonyAnhalt/EpiphanyTest.php b/tests/Germany/SaxonyAnhalt/EpiphanyTest.php index 67adc9b72..eab278ea7 100644 --- a/tests/Germany/SaxonyAnhalt/EpiphanyTest.php +++ b/tests/Germany/SaxonyAnhalt/EpiphanyTest.php @@ -39,7 +39,7 @@ class EpiphanyTest extends SaxonyAnhaltBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/SaxonyAnhalt/ReformationDayTest.php b/tests/Germany/SaxonyAnhalt/ReformationDayTest.php index cde4e3b29..5390d2093 100644 --- a/tests/Germany/SaxonyAnhalt/ReformationDayTest.php +++ b/tests/Germany/SaxonyAnhalt/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends SaxonyAnhaltBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/SchleswigHolstein/ReformationDayTest.php b/tests/Germany/SchleswigHolstein/ReformationDayTest.php index 02444a4fa..50bced15a 100644 --- a/tests/Germany/SchleswigHolstein/ReformationDayTest.php +++ b/tests/Germany/SchleswigHolstein/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends SchleswigHolsteinBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Germany/SecondChristmasDayTest.php b/tests/Germany/SecondChristmasDayTest.php index 37f8c7245..d30428858 100644 --- a/tests/Germany/SecondChristmasDayTest.php +++ b/tests/Germany/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends GermanyBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Germany/Thuringia/ReformationDayTest.php b/tests/Germany/Thuringia/ReformationDayTest.php index 1361a558c..d6d11aaaf 100644 --- a/tests/Germany/Thuringia/ReformationDayTest.php +++ b/tests/Germany/Thuringia/ReformationDayTest.php @@ -44,7 +44,7 @@ class ReformationDayTest extends ThuringiaBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -71,7 +71,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Greece/AnnunciationTest.php b/tests/Greece/AnnunciationTest.php index 28bd2d713..85957e901 100644 --- a/tests/Greece/AnnunciationTest.php +++ b/tests/Greece/AnnunciationTest.php @@ -38,7 +38,7 @@ class AnnunciationTest extends GreeceBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/AscensionDayTest.php b/tests/Greece/AscensionDayTest.php index ba6b1c709..db2bdc4ca 100644 --- a/tests/Greece/AscensionDayTest.php +++ b/tests/Greece/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends GreeceBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/AssumptionOfMaryTest.php b/tests/Greece/AssumptionOfMaryTest.php index 5fb5ee76d..e84af598d 100644 --- a/tests/Greece/AssumptionOfMaryTest.php +++ b/tests/Greece/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends GreeceBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/ChristmasDayTest.php b/tests/Greece/ChristmasDayTest.php index c14cc8283..6b7ba067d 100644 --- a/tests/Greece/ChristmasDayTest.php +++ b/tests/Greece/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends GreeceBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/CleanMondayTest.php b/tests/Greece/CleanMondayTest.php index eaed94b14..89a1f0500 100644 --- a/tests/Greece/CleanMondayTest.php +++ b/tests/Greece/CleanMondayTest.php @@ -34,7 +34,7 @@ class CleanMondayTest extends GreeceBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/EasterMondayTest.php b/tests/Greece/EasterMondayTest.php index 8bc949d01..acbc628aa 100644 --- a/tests/Greece/EasterMondayTest.php +++ b/tests/Greece/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends GreeceBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/EasterTest.php b/tests/Greece/EasterTest.php index 41f7b112f..07eb84fb8 100644 --- a/tests/Greece/EasterTest.php +++ b/tests/Greece/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends GreeceBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/EpiphanyTest.php b/tests/Greece/EpiphanyTest.php index b23b8cda5..fb46fe99d 100644 --- a/tests/Greece/EpiphanyTest.php +++ b/tests/Greece/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends GreeceBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/IndepencenceDayTest.php b/tests/Greece/IndepencenceDayTest.php index 1768bfa97..a44e54ae8 100644 --- a/tests/Greece/IndepencenceDayTest.php +++ b/tests/Greece/IndepencenceDayTest.php @@ -39,7 +39,7 @@ class IndepencenceDayTest extends GreeceBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2018; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Greece/InternationalWorkersDayTest.php b/tests/Greece/InternationalWorkersDayTest.php index 0017d4d2a..406561f4c 100644 --- a/tests/Greece/InternationalWorkersDayTest.php +++ b/tests/Greece/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends GreeceBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/NewYearsDayTest.php b/tests/Greece/NewYearsDayTest.php index 66bb2287f..b09a0d041 100644 --- a/tests/Greece/NewYearsDayTest.php +++ b/tests/Greece/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends GreeceBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/OhiDayTest.php b/tests/Greece/OhiDayTest.php index 291bba19d..ae5f91192 100644 --- a/tests/Greece/OhiDayTest.php +++ b/tests/Greece/OhiDayTest.php @@ -39,7 +39,7 @@ class OhiDayTest extends GreeceBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2018; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Greece/PentecostMondayTest.php b/tests/Greece/PentecostMondayTest.php index 00a7a494e..a7c9e2672 100644 --- a/tests/Greece/PentecostMondayTest.php +++ b/tests/Greece/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends GreeceBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/PentecostTest.php b/tests/Greece/PentecostTest.php index 8e65df9d0..911bc7a3c 100644 --- a/tests/Greece/PentecostTest.php +++ b/tests/Greece/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends GreeceBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Greece/PolytechnioTest.php b/tests/Greece/PolytechnioTest.php index ffaee7e6d..5c1b0089b 100644 --- a/tests/Greece/PolytechnioTest.php +++ b/tests/Greece/PolytechnioTest.php @@ -39,7 +39,7 @@ class PolytechnioTest extends GreeceBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2018; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Greece/ThreeHolyHierarchsTest.php b/tests/Greece/ThreeHolyHierarchsTest.php index 8e556d567..e9ee6ba80 100644 --- a/tests/Greece/ThreeHolyHierarchsTest.php +++ b/tests/Greece/ThreeHolyHierarchsTest.php @@ -38,7 +38,7 @@ class ThreeHolyHierarchsTest extends GreeceBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Greece/goodFridayTest.php b/tests/Greece/goodFridayTest.php index f45a3e514..ea5f5c8b8 100644 --- a/tests/Greece/goodFridayTest.php +++ b/tests/Greece/goodFridayTest.php @@ -34,7 +34,7 @@ class goodFridayTest extends GreeceBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Hungary/AllSaintsDayTest.php b/tests/Hungary/AllSaintsDayTest.php index 958921a1d..be4a52224 100644 --- a/tests/Hungary/AllSaintsDayTest.php +++ b/tests/Hungary/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends HungaryBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Hungary/ChristmasTest.php b/tests/Hungary/ChristmasTest.php index 80e74adfa..3655763d0 100644 --- a/tests/Hungary/ChristmasTest.php +++ b/tests/Hungary/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends HungaryBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Hungary/EasterMondayTest.php b/tests/Hungary/EasterMondayTest.php index 03d7b1c94..f329fb8e5 100644 --- a/tests/Hungary/EasterMondayTest.php +++ b/tests/Hungary/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends HungaryBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Hungary/EasterTest.php b/tests/Hungary/EasterTest.php index 90c4c2948..caced26cb 100644 --- a/tests/Hungary/EasterTest.php +++ b/tests/Hungary/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends HungaryBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2009; $this->assertHoliday( diff --git a/tests/Hungary/InternationalWorkersDayTest.php b/tests/Hungary/InternationalWorkersDayTest.php index 7098fbd1d..d8a696899 100644 --- a/tests/Hungary/InternationalWorkersDayTest.php +++ b/tests/Hungary/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends HungaryBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Hungary/MemorialDay1848Test.php b/tests/Hungary/MemorialDay1848Test.php index 6d816e1bd..d2ed08338 100644 --- a/tests/Hungary/MemorialDay1848Test.php +++ b/tests/Hungary/MemorialDay1848Test.php @@ -39,7 +39,7 @@ class MemorialDay1848Test extends HungaryBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Hungary/MemorialDay1956Test.php b/tests/Hungary/MemorialDay1956Test.php index 344a44959..f800db0b4 100644 --- a/tests/Hungary/MemorialDay1956Test.php +++ b/tests/Hungary/MemorialDay1956Test.php @@ -39,7 +39,7 @@ class MemorialDay1956Test extends HungaryBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Hungary/NewYearsDayTest.php b/tests/Hungary/NewYearsDayTest.php index 617810bcf..603167e9b 100644 --- a/tests/Hungary/NewYearsDayTest.php +++ b/tests/Hungary/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends HungaryBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Hungary/PentecostMondayTest.php b/tests/Hungary/PentecostMondayTest.php index 66dfb673c..297b2965a 100644 --- a/tests/Hungary/PentecostMondayTest.php +++ b/tests/Hungary/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends HungaryBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Hungary/PentecostTest.php b/tests/Hungary/PentecostTest.php index bb2e00b87..dfe1ed90c 100644 --- a/tests/Hungary/PentecostTest.php +++ b/tests/Hungary/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends HungaryBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1344; $this->assertHoliday( diff --git a/tests/Hungary/SecondChristmasDayTest.php b/tests/Hungary/SecondChristmasDayTest.php index 23cfd4658..b88e8d935 100644 --- a/tests/Hungary/SecondChristmasDayTest.php +++ b/tests/Hungary/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends HungaryBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Hungary/StateFoundationDayTest.php b/tests/Hungary/StateFoundationDayTest.php index 0cf6a656b..b89f0cd4f 100644 --- a/tests/Hungary/StateFoundationDayTest.php +++ b/tests/Hungary/StateFoundationDayTest.php @@ -39,7 +39,7 @@ class StateFoundationDayTest extends HungaryBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/AugustHolidayTest.php b/tests/Ireland/AugustHolidayTest.php index 80d3c633b..40c6ddc0b 100644 --- a/tests/Ireland/AugustHolidayTest.php +++ b/tests/Ireland/AugustHolidayTest.php @@ -40,7 +40,7 @@ class AugustHolidayTest extends IrelandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Ireland/ChristmasDayTest.php b/tests/Ireland/ChristmasDayTest.php index a82ef5688..b0463dae6 100644 --- a/tests/Ireland/ChristmasDayTest.php +++ b/tests/Ireland/ChristmasDayTest.php @@ -40,7 +40,7 @@ class ChristmasDayTest extends IrelandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Ireland/EasterMondayTest.php b/tests/Ireland/EasterMondayTest.php index 93f71b6fb..c39b84cd2 100644 --- a/tests/Ireland/EasterMondayTest.php +++ b/tests/Ireland/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends IrelandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Ireland/EasterTest.php b/tests/Ireland/EasterTest.php index c72f94762..b2d949d45 100644 --- a/tests/Ireland/EasterTest.php +++ b/tests/Ireland/EasterTest.php @@ -40,7 +40,7 @@ class EasterTest extends IrelandBaseTestCase implements YasumiTestCaseInterface * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Ireland/GoodFridayTest.php b/tests/Ireland/GoodFridayTest.php index 8a2032017..1295307bf 100644 --- a/tests/Ireland/GoodFridayTest.php +++ b/tests/Ireland/GoodFridayTest.php @@ -41,7 +41,7 @@ class GoodFridayTest extends IrelandBaseTestCase implements YasumiTestCaseInterf * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Ireland/JuneHolidayTest.php b/tests/Ireland/JuneHolidayTest.php index 7a1459b58..600a33f17 100644 --- a/tests/Ireland/JuneHolidayTest.php +++ b/tests/Ireland/JuneHolidayTest.php @@ -45,7 +45,7 @@ class JuneHolidayTest extends IrelandBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -80,7 +80,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/MayDayTest.php b/tests/Ireland/MayDayTest.php index fc4b6946c..3011c46a0 100644 --- a/tests/Ireland/MayDayTest.php +++ b/tests/Ireland/MayDayTest.php @@ -45,7 +45,7 @@ class MayDayTest extends IrelandBaseTestCase implements YasumiTestCaseInterface * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -81,7 +81,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/NewYearsDayTest.php b/tests/Ireland/NewYearsDayTest.php index 4e3799a37..69f74536b 100644 --- a/tests/Ireland/NewYearsDayTest.php +++ b/tests/Ireland/NewYearsDayTest.php @@ -45,7 +45,7 @@ class NewYearsDayTest extends IrelandBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -79,7 +79,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/OctoberHolidayTest.php b/tests/Ireland/OctoberHolidayTest.php index 438cdb1f8..78547a72c 100644 --- a/tests/Ireland/OctoberHolidayTest.php +++ b/tests/Ireland/OctoberHolidayTest.php @@ -45,7 +45,7 @@ class OctoberHolidayTest extends IrelandBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -81,7 +81,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/PentecostTest.php b/tests/Ireland/PentecostTest.php index 6f58258a3..2dfe67fbf 100644 --- a/tests/Ireland/PentecostTest.php +++ b/tests/Ireland/PentecostTest.php @@ -41,7 +41,7 @@ class PentecostTest extends IrelandBaseTestCase implements YasumiTestCaseInterfa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Ireland/StPatricksDayTest.php b/tests/Ireland/StPatricksDayTest.php index fa6723959..1b89ec018 100644 --- a/tests/Ireland/StPatricksDayTest.php +++ b/tests/Ireland/StPatricksDayTest.php @@ -45,7 +45,7 @@ class StPatricksDayTest extends IrelandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -79,7 +79,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Ireland/StStephensDayTest.php b/tests/Ireland/StStephensDayTest.php index 05c956c1d..a60b134f8 100644 --- a/tests/Ireland/StStephensDayTest.php +++ b/tests/Ireland/StStephensDayTest.php @@ -40,7 +40,7 @@ class StStephensDayTest extends IrelandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); diff --git a/tests/Ireland/pentecostMondayTest.php b/tests/Ireland/pentecostMondayTest.php index 82e0074aa..e3a4892ec 100644 --- a/tests/Ireland/pentecostMondayTest.php +++ b/tests/Ireland/pentecostMondayTest.php @@ -46,7 +46,7 @@ class pentecostMondayTest extends IrelandBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -80,7 +80,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test after abolishment. * @throws ReflectionException */ - public function testHolidayDayAfterAbolishment() + public function testHolidayDayAfterAbolishment(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ABOLISHMENT_YEAR + 1)); } diff --git a/tests/Italy/AllSaintsDayTest.php b/tests/Italy/AllSaintsDayTest.php index a357dc1b8..a358ba5db 100644 --- a/tests/Italy/AllSaintsDayTest.php +++ b/tests/Italy/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends ItalyBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/AssumptionOfMaryTest.php b/tests/Italy/AssumptionOfMaryTest.php index bb57525c7..8fd8e841a 100644 --- a/tests/Italy/AssumptionOfMaryTest.php +++ b/tests/Italy/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends ItalyBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testAssumptionOfMary($year, $expected) + public function testAssumptionOfMary($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/ChristmasTest.php b/tests/Italy/ChristmasTest.php index ca28e5936..c76f5bf15 100644 --- a/tests/Italy/ChristmasTest.php +++ b/tests/Italy/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends ItalyBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/EasterMondayTest.php b/tests/Italy/EasterMondayTest.php index 7542ac0ab..782be72a7 100644 --- a/tests/Italy/EasterMondayTest.php +++ b/tests/Italy/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends ItalyBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Italy/EasterTest.php b/tests/Italy/EasterTest.php index 11523e0b7..466a9fa45 100644 --- a/tests/Italy/EasterTest.php +++ b/tests/Italy/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends ItalyBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testEaster() + public function testEaster(): void { $year = 2009; $this->assertHoliday( diff --git a/tests/Italy/EpiphanyTest.php b/tests/Italy/EpiphanyTest.php index 0f0558b21..5912830b5 100644 --- a/tests/Italy/EpiphanyTest.php +++ b/tests/Italy/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends ItalyBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testEpiphany($year, $expected) + public function testEpiphany($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/ImmaculateConceptionTest.php b/tests/Italy/ImmaculateConceptionTest.php index f2a6636f7..18c057dc1 100644 --- a/tests/Italy/ImmaculateConceptionTest.php +++ b/tests/Italy/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends ItalyBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testImmaculateConception($year, $expected) + public function testImmaculateConception($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/InternationalWorkersDayTest.php b/tests/Italy/InternationalWorkersDayTest.php index 32aa43794..bdb18e9d7 100644 --- a/tests/Italy/InternationalWorkersDayTest.php +++ b/tests/Italy/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends ItalyBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/LiberationDayTest.php b/tests/Italy/LiberationDayTest.php index 27ed0e2d0..93572a6dd 100644 --- a/tests/Italy/LiberationDayTest.php +++ b/tests/Italy/LiberationDayTest.php @@ -46,7 +46,7 @@ class LiberationDayTest extends ItalyBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testLiberationDayOnAfter1949() + public function testLiberationDayOnAfter1949(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -61,7 +61,7 @@ public function testLiberationDayOnAfter1949() * Tests Liberation Day before 1949. * @throws ReflectionException */ - public function testLiberationDayBefore1949() + public function testLiberationDayBefore1949(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Italy/NewYearsDayTest.php b/tests/Italy/NewYearsDayTest.php index eef08c753..42a4246ec 100644 --- a/tests/Italy/NewYearsDayTest.php +++ b/tests/Italy/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends ItalyBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Italy/RepublicDayTest.php b/tests/Italy/RepublicDayTest.php index d5db86519..463f50b65 100644 --- a/tests/Italy/RepublicDayTest.php +++ b/tests/Italy/RepublicDayTest.php @@ -46,7 +46,7 @@ class RepublicDayTest extends ItalyBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testRepublicDayOnAfter1946() + public function testRepublicDayOnAfter1946(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -61,7 +61,7 @@ public function testRepublicDayOnAfter1946() * Tests Republic Day before 1946. * @throws ReflectionException */ - public function testRepublicDayBefore1946() + public function testRepublicDayBefore1946(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Italy/stStephensDayTest.php b/tests/Italy/stStephensDayTest.php index 9d6a99014..03aaceaff 100644 --- a/tests/Italy/stStephensDayTest.php +++ b/tests/Italy/stStephensDayTest.php @@ -38,7 +38,7 @@ class stStephensDayTest extends ItalyBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function teststStephensDay($year, $expected) + public function teststStephensDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Japan/AutumnalEquinoxDayTest.php b/tests/Japan/AutumnalEquinoxDayTest.php index 21d7c1c50..bf2b5da6a 100644 --- a/tests/Japan/AutumnalEquinoxDayTest.php +++ b/tests/Japan/AutumnalEquinoxDayTest.php @@ -42,7 +42,7 @@ class AutumnalEquinoxDayTest extends JapanBaseTestCase implements YasumiTestCase * After 2150 no calculations are available yet. * @throws ReflectionException */ - public function testAutumnalEquinoxDayOnAfter2150() + public function testAutumnalEquinoxDayOnAfter2150(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(2151)); } @@ -63,7 +63,7 @@ public function testAutumnalEquinoxDayOnAfter2150() * @throws ReflectionException * @throws Exception */ - public function testAutumnalEquinoxDayBetween1948And2150($year, $month, $day) + public function testAutumnalEquinoxDayBetween1948And2150($year, $month, $day): void { $this->assertHoliday( self::REGION, @@ -95,7 +95,7 @@ public function autumnalEquinoxHolidaysProvider(): array * festival called Shūki kōrei-sai (秋季皇霊祭). * @throws ReflectionException */ - public function testAutumnalEquinoxDayBefore1948() + public function testAutumnalEquinoxDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/ChildrensDayTest.php b/tests/Japan/ChildrensDayTest.php index e89d64f3f..627ce3a84 100644 --- a/tests/Japan/ChildrensDayTest.php +++ b/tests/Japan/ChildrensDayTest.php @@ -39,7 +39,7 @@ class ChildrensDayTest extends JapanBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testChildrensDayOnAfter1948() + public function testChildrensDayOnAfter1948(): void { $year = 1955; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testChildrensDayOnAfter1948() * @throws Exception * @throws ReflectionException */ - public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay() + public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay(): void { $year = 2120; $this->assertHoliday( @@ -72,7 +72,7 @@ public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay() * * @throws ReflectionException */ - public function testChildrensDayBefore1948() + public function testChildrensDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/ComingOfAgeDayTest.php b/tests/Japan/ComingOfAgeDayTest.php index 3fcd5a3d0..ef9054f7b 100644 --- a/tests/Japan/ComingOfAgeDayTest.php +++ b/tests/Japan/ComingOfAgeDayTest.php @@ -40,7 +40,7 @@ class ComingOfAgeDayTest extends JapanBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testComingOfAgeDayOnAfter2000() + public function testComingOfAgeDayOnAfter2000(): void { $year = $this->generateRandomYear(2001); $this->assertHoliday( @@ -58,7 +58,7 @@ public function testComingOfAgeDayOnAfter2000() * @throws Exception * @throws ReflectionException */ - public function testComingOfAgeDayBetween1948And2000() + public function testComingOfAgeDayBetween1948And2000(): void { $year = 1991; $this->assertHoliday( @@ -74,7 +74,7 @@ public function testComingOfAgeDayBetween1948And2000() * was changed to be the second monday of January. * @throws ReflectionException */ - public function testConstitutionMemorialDayBefore1948() + public function testConstitutionMemorialDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/ConstitutionMemorialDayTest.php b/tests/Japan/ConstitutionMemorialDayTest.php index 7f17e929a..37bab5b78 100644 --- a/tests/Japan/ConstitutionMemorialDayTest.php +++ b/tests/Japan/ConstitutionMemorialDayTest.php @@ -39,7 +39,7 @@ class ConstitutionMemorialDayTest extends JapanBaseTestCase implements YasumiTes * @throws Exception * @throws ReflectionException */ - public function testConstitutionMemorialDayOnAfter1948() + public function testConstitutionMemorialDayOnAfter1948(): void { $year = 1967; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testConstitutionMemorialDayOnAfter1948() * @throws Exception * @throws ReflectionException */ - public function testConstitutionMemorialDayOnAfter1948SubstitutedNextWorkingDay() + public function testConstitutionMemorialDayOnAfter1948SubstitutedNextWorkingDay(): void { $year = 2009; $this->assertHoliday( @@ -71,7 +71,7 @@ public function testConstitutionMemorialDayOnAfter1948SubstitutedNextWorkingDay( * Tests Constitution Memorial Day before 1948. Constitution Memorial Day was established after 1948 * @throws ReflectionException */ - public function testConstitutionMemorialDayBefore1948() + public function testConstitutionMemorialDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/CoronationDayTest.php b/tests/Japan/CoronationDayTest.php index 58ca94344..fb5ba2dfe 100644 --- a/tests/Japan/CoronationDayTest.php +++ b/tests/Japan/CoronationDayTest.php @@ -41,7 +41,7 @@ class CoronationDayTest extends JapanBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testEmperorsCoronationDay() + public function testEmperorsCoronationDay(): void { $this->assertHoliday( self::REGION, @@ -55,7 +55,7 @@ public function testEmperorsCoronationDay() /** * @throws ReflectionException */ - public function testEmperorsBirthdayBefore2019() + public function testEmperorsBirthdayBefore2019(): void { $this->assertNotHoliday( self::REGION, @@ -67,7 +67,7 @@ public function testEmperorsBirthdayBefore2019() /** * @throws ReflectionException */ - public function testEmperorsBirthdayAfter2020() + public function testEmperorsBirthdayAfter2020(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/CultureDayTest.php b/tests/Japan/CultureDayTest.php index 412059fba..f3e41e98b 100644 --- a/tests/Japan/CultureDayTest.php +++ b/tests/Japan/CultureDayTest.php @@ -39,7 +39,7 @@ class CultureDayTest extends JapanBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testCultureDayOnAfter1948() + public function testCultureDayOnAfter1948(): void { $year = 1973; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testCultureDayOnAfter1948() * @throws Exception * @throws ReflectionException */ - public function testCultureDayOnAfter1948SubstitutedNextWorkingDay() + public function testCultureDayOnAfter1948SubstitutedNextWorkingDay(): void { $year = 2661; $this->assertHoliday( @@ -70,7 +70,7 @@ public function testCultureDayOnAfter1948SubstitutedNextWorkingDay() * Tests Culture Day before 1948. Culture Day was established after 1948 * @throws ReflectionException */ - public function testCultureDayBefore1948() + public function testCultureDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/EmperorsBirthdayTest.php b/tests/Japan/EmperorsBirthdayTest.php index 58793a2f1..9865a3bf7 100644 --- a/tests/Japan/EmperorsBirthdayTest.php +++ b/tests/Japan/EmperorsBirthdayTest.php @@ -41,7 +41,7 @@ class EmperorsBirthdayTest extends JapanBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testEmperorsBirthdayOnAfter1949() + public function testEmperorsBirthdayOnAfter1949(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1987); $this->assertHoliday( @@ -59,7 +59,7 @@ public function testEmperorsBirthdayOnAfter1949() * @throws Exception * @throws ReflectionException */ - public function testEmperorsBirthdayOnAfter1989() + public function testEmperorsBirthdayOnAfter1989(): void { $year = $this->generateRandomYear(1989, 2018); $this->assertHoliday( @@ -76,7 +76,7 @@ public function testEmperorsBirthdayOnAfter1989() * @throws Exception * @throws ReflectionException */ - public function testEmperorsBirthdayOnAfter2020() + public function testEmperorsBirthdayOnAfter2020(): void { $year = $this->generateRandomYear(2020); $this->assertHoliday( @@ -93,7 +93,7 @@ public function testEmperorsBirthdayOnAfter2020() * @throws Exception * @throws ReflectionException */ - public function testEmperorsBirthdayOnAfter1989SubstitutedNextWorkingDay() + public function testEmperorsBirthdayOnAfter1989SubstitutedNextWorkingDay(): void { $year = 2001; $this->assertHoliday( @@ -110,7 +110,7 @@ public function testEmperorsBirthdayOnAfter1989SubstitutedNextWorkingDay() * Day"/"Greenery Day" * @throws ReflectionException */ - public function testEmperorsBirthdayBefore1989() + public function testEmperorsBirthdayBefore1989(): void { $this->assertNotHoliday( self::REGION, @@ -124,7 +124,7 @@ public function testEmperorsBirthdayBefore1989() * * @throws ReflectionException */ - public function testEmperorsBirthdayAt2019() + public function testEmperorsBirthdayAt2019(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/EnthronementProclamationCeremonyTest.php b/tests/Japan/EnthronementProclamationCeremonyTest.php index 44d52529f..cd6790175 100644 --- a/tests/Japan/EnthronementProclamationCeremonyTest.php +++ b/tests/Japan/EnthronementProclamationCeremonyTest.php @@ -41,7 +41,7 @@ class EnthronementProclamationCeremonyTest extends JapanBaseTestCase implements * @throws Exception * @throws ReflectionException */ - public function testEmperorsCoronationDay() + public function testEmperorsCoronationDay(): void { $this->assertHoliday( self::REGION, @@ -55,7 +55,7 @@ public function testEmperorsCoronationDay() /** * @throws ReflectionException */ - public function testEmperorsBirthdayBefore2019() + public function testEmperorsBirthdayBefore2019(): void { $this->assertNotHoliday( self::REGION, @@ -67,7 +67,7 @@ public function testEmperorsBirthdayBefore2019() /** * @throws ReflectionException */ - public function testEmperorsBirthdayAfter2020() + public function testEmperorsBirthdayAfter2020(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/GreeneryDayTest.php b/tests/Japan/GreeneryDayTest.php index 59dfe0f6c..e6c840f5e 100644 --- a/tests/Japan/GreeneryDayTest.php +++ b/tests/Japan/GreeneryDayTest.php @@ -40,7 +40,7 @@ class GreeneryDayTest extends JapanBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfter2007() + public function testHolidayOnAfter2007(): void { $year = 2112; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testHolidayOnAfter2007() * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfter2007SubstitutedNextWorkingDay() + public function testHolidayOnAfter2007SubstitutedNextWorkingDay(): void { $year = 2014; $this->assertHoliday( @@ -73,7 +73,7 @@ public function testHolidayOnAfter2007SubstitutedNextWorkingDay() * @throws Exception * @throws ReflectionException */ - public function testHolidayBetween1989And2007() + public function testHolidayBetween1989And2007(): void { $year = 1997; $this->assertHoliday( @@ -89,7 +89,7 @@ public function testHolidayBetween1989And2007() * @throws Exception * @throws ReflectionException */ - public function testHolidayBetween1989And2007SubstitutedNextWorkingDay() + public function testHolidayBetween1989And2007SubstitutedNextWorkingDay(): void { $year = 2001; $this->assertHoliday( @@ -105,7 +105,7 @@ public function testHolidayBetween1989And2007SubstitutedNextWorkingDay() * it was changed to be May 4th. * @throws ReflectionException */ - public function testHolidayBefore1989() + public function testHolidayBefore1989(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/LabourThanksgivingDayTest.php b/tests/Japan/LabourThanksgivingDayTest.php index 989e1563e..cc75a903b 100644 --- a/tests/Japan/LabourThanksgivingDayTest.php +++ b/tests/Japan/LabourThanksgivingDayTest.php @@ -40,7 +40,7 @@ class LabourThanksgivingDayTest extends JapanBaseTestCase implements YasumiTestC * @throws Exception * @throws ReflectionException */ - public function testLabourThanksgivingDayOnAfter1948() + public function testLabourThanksgivingDayOnAfter1948(): void { $year = 4884; $this->assertHoliday( @@ -57,7 +57,7 @@ public function testLabourThanksgivingDayOnAfter1948() * @throws Exception * @throws ReflectionException */ - public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay() + public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay(): void { $year = 1986; $this->assertHoliday( @@ -73,7 +73,7 @@ public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay() * 1948. * @throws ReflectionException */ - public function testLabourThanksgivingDayBefore1948() + public function testLabourThanksgivingDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/MarineDayTest.php b/tests/Japan/MarineDayTest.php index db25cecbd..2ab8fc334 100644 --- a/tests/Japan/MarineDayTest.php +++ b/tests/Japan/MarineDayTest.php @@ -39,7 +39,7 @@ class MarineDayTest extends JapanBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testMarineDayIn2020() + public function testMarineDayIn2020(): void { $year = 2020; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testMarineDayIn2020() * @throws Exception * @throws ReflectionException */ - public function testMarineDayOnAfter2003() + public function testMarineDayOnAfter2003(): void { $year = $this->generateRandomYear(2004); $this->assertHoliday( @@ -73,7 +73,7 @@ public function testMarineDayOnAfter2003() * @throws Exception * @throws ReflectionException */ - public function testMarineDayBetween1996And2003() + public function testMarineDayBetween1996And2003(): void { $year = 2001; $this->assertHoliday( @@ -89,7 +89,7 @@ public function testMarineDayBetween1996And2003() * @throws Exception * @throws ReflectionException */ - public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay() + public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay(): void { $year = 1997; $this->assertHoliday( @@ -105,7 +105,7 @@ public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay() * to be the third monday of July. * @throws ReflectionException */ - public function testMarineDayBefore1996() + public function testMarineDayBefore1996(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/MountainDayTest.php b/tests/Japan/MountainDayTest.php index 159ec8704..ceb74d490 100644 --- a/tests/Japan/MountainDayTest.php +++ b/tests/Japan/MountainDayTest.php @@ -39,7 +39,7 @@ class MountainDayTest extends JapanBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testMountainDayIn2020() + public function testMountainDayIn2020(): void { $year = 2020; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testMountainDayIn2020() * @throws Exception * @throws ReflectionException */ - public function testMountainDayOnAfter2016() + public function testMountainDayOnAfter2016(): void { $year = 2016; $this->assertHoliday( @@ -71,7 +71,7 @@ public function testMountainDayOnAfter2016() * @throws Exception * @throws ReflectionException */ - public function testMountainDayOnAfter2016SubstitutedNextWorkingDay() + public function testMountainDayOnAfter2016SubstitutedNextWorkingDay(): void { $year = 2019; $this->assertHoliday( @@ -86,7 +86,7 @@ public function testMountainDayOnAfter2016SubstitutedNextWorkingDay() * Tests Mountain Day before 2016. Mountain Day was established in 2014 and is held from 2016 on August 11th. * @throws ReflectionException */ - public function testMountainDayBefore2016() + public function testMountainDayBefore2016(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/NationalFoundationDayTest.php b/tests/Japan/NationalFoundationDayTest.php index 2a4c35444..052caacc6 100644 --- a/tests/Japan/NationalFoundationDayTest.php +++ b/tests/Japan/NationalFoundationDayTest.php @@ -39,7 +39,7 @@ class NationalFoundationDayTest extends JapanBaseTestCase implements YasumiTestC * @throws Exception * @throws ReflectionException */ - public function testNationalFoundationDayOnAfter1966() + public function testNationalFoundationDayOnAfter1966(): void { $year = 1972; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testNationalFoundationDayOnAfter1966() * @throws Exception * @throws ReflectionException */ - public function testNationalFoundationDayOnAfter1966SubstitutedNextWorkingDay() + public function testNationalFoundationDayOnAfter1966SubstitutedNextWorkingDay(): void { $year = 2046; $this->assertHoliday( @@ -71,7 +71,7 @@ public function testNationalFoundationDayOnAfter1966SubstitutedNextWorkingDay() * Tests National Foundation Day before 1966. National Foundation day was established after 1966 * @throws ReflectionException */ - public function testNationalFoundationDayBefore1966() + public function testNationalFoundationDayBefore1966(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/NewYearsDayTest.php b/tests/Japan/NewYearsDayTest.php index 245aac99f..260563346 100644 --- a/tests/Japan/NewYearsDayTest.php +++ b/tests/Japan/NewYearsDayTest.php @@ -39,7 +39,7 @@ class NewYearsDayTest extends JapanBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testNewYearsDayOnAfter1948() + public function testNewYearsDayOnAfter1948(): void { $year = 1997; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testNewYearsDayOnAfter1948() * @throws Exception * @throws ReflectionException */ - public function testNewYearsDayOnAfter1948SubstitutedNextWorkingDay() + public function testNewYearsDayOnAfter1948SubstitutedNextWorkingDay(): void { $year = 4473; $this->assertHoliday( @@ -70,7 +70,7 @@ public function testNewYearsDayOnAfter1948SubstitutedNextWorkingDay() * Tests New Years Day before 1948. New Years Day was established after 1948 * @throws ReflectionException */ - public function testNewYearsDayBefore1948() + public function testNewYearsDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/PublicBridgeDayTest.php b/tests/Japan/PublicBridgeDayTest.php index ddc00f647..4b52f71ff 100644 --- a/tests/Japan/PublicBridgeDayTest.php +++ b/tests/Japan/PublicBridgeDayTest.php @@ -38,7 +38,7 @@ class PublicBridgeDayTest extends JapanBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testPublicBridgeDay() + public function testPublicBridgeDay(): void { $this->assertHoliday( self::REGION, diff --git a/tests/Japan/RespectForTheAgedDayTest.php b/tests/Japan/RespectForTheAgedDayTest.php index 26c0258ba..806bbaa85 100644 --- a/tests/Japan/RespectForTheAgedDayTest.php +++ b/tests/Japan/RespectForTheAgedDayTest.php @@ -40,7 +40,7 @@ class RespectForTheAgedDayTest extends JapanBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testRespectForTheAgedDayOnAfter2003() + public function testRespectForTheAgedDayOnAfter2003(): void { $year = $this->generateRandomYear(2004); $this->assertHoliday( @@ -57,7 +57,7 @@ public function testRespectForTheAgedDayOnAfter2003() * @throws Exception * @throws ReflectionException */ - public function testRespectForTheAgedDayBetween1996And2003() + public function testRespectForTheAgedDayBetween1996And2003(): void { $year = 1998; $this->assertHoliday( @@ -74,7 +74,7 @@ public function testRespectForTheAgedDayBetween1996And2003() * @throws Exception * @throws ReflectionException */ - public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorkingDay() + public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorkingDay(): void { $year = 2002; $this->assertHoliday( @@ -90,7 +90,7 @@ public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorking * 15th. After 2003 it was changed to be the third monday of September. * @throws ReflectionException */ - public function testRespectForTheAgedDayBefore1996() + public function testRespectForTheAgedDayBefore1996(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/ShowaDayTest.php b/tests/Japan/ShowaDayTest.php index 4c160b277..42ab42e33 100644 --- a/tests/Japan/ShowaDayTest.php +++ b/tests/Japan/ShowaDayTest.php @@ -39,7 +39,7 @@ class ShowaDayTest extends JapanBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfter2007() + public function testHolidayOnAfter2007(): void { $year = 2110; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHolidayOnAfter2007() * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishmentSubstitutedNextWorkingDay() + public function testHolidayOnAfterEstablishmentSubstitutedNextWorkingDay(): void { $year = 2210; $this->assertHoliday( @@ -70,7 +70,7 @@ public function testHolidayOnAfterEstablishmentSubstitutedNextWorkingDay() * Tests the holiday defined in the test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/SportsDayTest.php b/tests/Japan/SportsDayTest.php index ba48a5504..6448df9c4 100644 --- a/tests/Japan/SportsDayTest.php +++ b/tests/Japan/SportsDayTest.php @@ -39,7 +39,7 @@ class SportsDayTest extends JapanBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testSportsDayIn2020() + public function testSportsDayIn2020(): void { $year = 2020; $this->assertHoliday( @@ -56,7 +56,7 @@ public function testSportsDayIn2020() * @throws Exception * @throws ReflectionException */ - public function testSportsDayOnAfter2000() + public function testSportsDayOnAfter2000(): void { $year = $this->generateRandomYear(2001); $this->assertHoliday( @@ -73,7 +73,7 @@ public function testSportsDayOnAfter2000() * @throws Exception * @throws ReflectionException */ - public function testSportsDayBetween1996And2000() + public function testSportsDayBetween1996And2000(): void { $year = 1997; $this->assertHoliday( @@ -90,7 +90,7 @@ public function testSportsDayBetween1996And2000() * @throws Exception * @throws ReflectionException */ - public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay() + public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay(): void { $year = 1999; $this->assertHoliday( @@ -106,7 +106,7 @@ public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay() * 2000 it was changed to be the second monday of October. * @throws ReflectionException */ - public function testSportsDayBefore1996() + public function testSportsDayBefore1996(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Japan/VernalEquinoxDayTest.php b/tests/Japan/VernalEquinoxDayTest.php index bc6d20402..c27476fe3 100644 --- a/tests/Japan/VernalEquinoxDayTest.php +++ b/tests/Japan/VernalEquinoxDayTest.php @@ -42,7 +42,7 @@ class VernalEquinoxDayTest extends JapanBaseTestCase implements YasumiTestCaseIn * After 2150 no calculations are available yet. * @throws ReflectionException */ - public function testVernalEquinoxDayOnAfter2150() + public function testVernalEquinoxDayOnAfter2150(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(2151)); } @@ -63,7 +63,7 @@ public function testVernalEquinoxDayOnAfter2150() * @throws ReflectionException * @throws Exception */ - public function testVernalEquinoxDayBetween1948And2150($year, $month, $day) + public function testVernalEquinoxDayBetween1948And2150($year, $month, $day): void { $this->assertHoliday( self::REGION, @@ -96,7 +96,7 @@ public function vernalEquinoxHolidaysProvider(): array * festival called Shunki kōrei-sai (春季皇霊祭). * @throws ReflectionException */ - public function testVernalEquinoxDayBefore1948() + public function testVernalEquinoxDayBefore1948(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Latvia/ChristmasDayTest.php b/tests/Latvia/ChristmasDayTest.php index 3a2a349f0..32595fca3 100644 --- a/tests/Latvia/ChristmasDayTest.php +++ b/tests/Latvia/ChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/ChristmasEveDayTest.php b/tests/Latvia/ChristmasEveDayTest.php index a85eb171a..403cfb17a 100644 --- a/tests/Latvia/ChristmasEveDayTest.php +++ b/tests/Latvia/ChristmasEveDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/EasterDayTest.php b/tests/Latvia/EasterDayTest.php index f7b564a44..e2f6281d3 100644 --- a/tests/Latvia/EasterDayTest.php +++ b/tests/Latvia/EasterDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Latvia/EasterMondayDayTest.php b/tests/Latvia/EasterMondayDayTest.php index 4c341856b..09afe3de7 100644 --- a/tests/Latvia/EasterMondayDayTest.php +++ b/tests/Latvia/EasterMondayDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Latvia/GoodFridayDayTest.php b/tests/Latvia/GoodFridayDayTest.php index a062db731..16e55d84b 100644 --- a/tests/Latvia/GoodFridayDayTest.php +++ b/tests/Latvia/GoodFridayDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Latvia/InternationalWorkersDayTest.php b/tests/Latvia/InternationalWorkersDayTest.php index 8cc2baf35..0ecf91007 100644 --- a/tests/Latvia/InternationalWorkersDayTest.php +++ b/tests/Latvia/InternationalWorkersDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/MidsummerEveDayTest.php b/tests/Latvia/MidsummerEveDayTest.php index 547813fcc..4c109df85 100644 --- a/tests/Latvia/MidsummerEveDayTest.php +++ b/tests/Latvia/MidsummerEveDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/NewYearsDayTest.php b/tests/Latvia/NewYearsDayTest.php index fbe371bd4..18ea3dc9d 100644 --- a/tests/Latvia/NewYearsDayTest.php +++ b/tests/Latvia/NewYearsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/NewYearsEveDayTest.php b/tests/Latvia/NewYearsEveDayTest.php index 3d51fb1b4..ee5f5790d 100644 --- a/tests/Latvia/NewYearsEveDayTest.php +++ b/tests/Latvia/NewYearsEveDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php b/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php index 1e275c4f3..8c831cd3f 100644 --- a/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php +++ b/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php @@ -37,7 +37,7 @@ class ProclamationOfTheRepublicOfLatviaDayTest extends LatviaBaseTestCase implem * Test if holiday is not defined before proclamation * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday( self::REGION, @@ -72,7 +72,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Latvia/RestorationOfIndependenceDayTest.php b/tests/Latvia/RestorationOfIndependenceDayTest.php index a2116bee8..c832b8550 100644 --- a/tests/Latvia/RestorationOfIndependenceDayTest.php +++ b/tests/Latvia/RestorationOfIndependenceDayTest.php @@ -37,7 +37,7 @@ class RestorationOfIndependenceDayTest extends LatviaBaseTestCase implements Yas * Test if holiday is not defined before restoration * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday( self::REGION, @@ -72,7 +72,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Latvia/SecondChristmasDayTest.php b/tests/Latvia/SecondChristmasDayTest.php index b23afebf0..68472f76f 100644 --- a/tests/Latvia/SecondChristmasDayTest.php +++ b/tests/Latvia/SecondChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Latvia/StJohnsDayTest.php b/tests/Latvia/StJohnsDayTest.php index 2b197d75c..390e4e8b0 100644 --- a/tests/Latvia/StJohnsDayTest.php +++ b/tests/Latvia/StJohnsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/AllSaintsDayTest.php b/tests/Lithuania/AllSaintsDayTest.php index 6be787d01..fcce02e2e 100644 --- a/tests/Lithuania/AllSaintsDayTest.php +++ b/tests/Lithuania/AllSaintsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/AssumptionOfMaryDayTest.php b/tests/Lithuania/AssumptionOfMaryDayTest.php index a80e02b2d..0502a155b 100644 --- a/tests/Lithuania/AssumptionOfMaryDayTest.php +++ b/tests/Lithuania/AssumptionOfMaryDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/ChristmasDayTest.php b/tests/Lithuania/ChristmasDayTest.php index cd58f9b38..7b351e127 100644 --- a/tests/Lithuania/ChristmasDayTest.php +++ b/tests/Lithuania/ChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/ChristmasEveDayTest.php b/tests/Lithuania/ChristmasEveDayTest.php index 101716bb7..7bbcc3867 100644 --- a/tests/Lithuania/ChristmasEveDayTest.php +++ b/tests/Lithuania/ChristmasEveDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/EasterDayTest.php b/tests/Lithuania/EasterDayTest.php index 2c05723fc..b3d03cfcf 100644 --- a/tests/Lithuania/EasterDayTest.php +++ b/tests/Lithuania/EasterDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Lithuania/EasterMondayDayTest.php b/tests/Lithuania/EasterMondayDayTest.php index bb69c75db..dc5114710 100644 --- a/tests/Lithuania/EasterMondayDayTest.php +++ b/tests/Lithuania/EasterMondayDayTest.php @@ -52,7 +52,7 @@ public function holidayDataProvider(): array * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/Lithuania/InternationalWorkersDayTest.php b/tests/Lithuania/InternationalWorkersDayTest.php index ebd32d758..6bd53d4e2 100644 --- a/tests/Lithuania/InternationalWorkersDayTest.php +++ b/tests/Lithuania/InternationalWorkersDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/NewYearsDayTest.php b/tests/Lithuania/NewYearsDayTest.php index 19289c48f..02f32da91 100644 --- a/tests/Lithuania/NewYearsDayTest.php +++ b/tests/Lithuania/NewYearsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php b/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php index 7d738f2c6..3b47fa6b6 100644 --- a/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php +++ b/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php @@ -37,7 +37,7 @@ class RestorationOfIndependenceOfLithuaniaDayTest extends LithuaniaBaseTestCase * Test if holiday is not defined before restoration * @throws ReflectionException */ - public function testHolidayBeforeRestoration() + public function testHolidayBeforeRestoration(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBeforeRestoration() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfterRestoration() + public function testHolidayAfterRestoration(): void { $year = $this->generateRandomYear(Lithuania::RESTORATION_OF_INDEPENDENCE_YEAR); diff --git a/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php b/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php index 3e6d8f226..93eb5540c 100644 --- a/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php +++ b/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php @@ -37,7 +37,7 @@ class RestorationOfTheStateOfLithuaniaDayTest extends LithuaniaBaseTestCase impl * Test if holiday is not defined before restoration * @throws ReflectionException */ - public function testHolidayBeforeRestoration() + public function testHolidayBeforeRestoration(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBeforeRestoration() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfterRestoration() + public function testHolidayAfterRestoration(): void { $year = $this->generateRandomYear(Lithuania::RESTORATION_OF_THE_STATE_YEAR); diff --git a/tests/Lithuania/SecondChristmasDayTest.php b/tests/Lithuania/SecondChristmasDayTest.php index 63584bfbd..db62ec914 100644 --- a/tests/Lithuania/SecondChristmasDayTest.php +++ b/tests/Lithuania/SecondChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/StJohnsDayTest.php b/tests/Lithuania/StJohnsDayTest.php index fc174c8a0..0e0f99700 100644 --- a/tests/Lithuania/StJohnsDayTest.php +++ b/tests/Lithuania/StJohnsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Lithuania/StatehoodDayTest.php b/tests/Lithuania/StatehoodDayTest.php index bf084d00f..8c9a52ff7 100644 --- a/tests/Lithuania/StatehoodDayTest.php +++ b/tests/Lithuania/StatehoodDayTest.php @@ -37,7 +37,7 @@ class StatehoodDayTest extends LithuaniaBaseTestCase implements YasumiTestCaseIn * Test if holiday is not defined before restoration * @throws ReflectionException */ - public function testHolidayBeforeRestoration() + public function testHolidayBeforeRestoration(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBeforeRestoration() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfterRestoration() + public function testHolidayAfterRestoration(): void { $year = $this->generateRandomYear(Lithuania::STATEHOOD_YEAR); diff --git a/tests/Luxembourg/AllSaintsDayTest.php b/tests/Luxembourg/AllSaintsDayTest.php index 719868284..31729d6c5 100644 --- a/tests/Luxembourg/AllSaintsDayTest.php +++ b/tests/Luxembourg/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testAllSaintsDay($year, $expected) + public function testAllSaintsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/AscensionDayTest.php b/tests/Luxembourg/AscensionDayTest.php index 8fdbf386e..01e6cae39 100644 --- a/tests/Luxembourg/AscensionDayTest.php +++ b/tests/Luxembourg/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1901; $this->assertHoliday( diff --git a/tests/Luxembourg/AssumptionOfMaryTest.php b/tests/Luxembourg/AssumptionOfMaryTest.php index 277483f6e..92ebf4c09 100644 --- a/tests/Luxembourg/AssumptionOfMaryTest.php +++ b/tests/Luxembourg/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends LuxembourgBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/ChristmasDayTest.php b/tests/Luxembourg/ChristmasDayTest.php index 1b242dca9..a9bece00c 100644 --- a/tests/Luxembourg/ChristmasDayTest.php +++ b/tests/Luxembourg/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/EasterMondayTest.php b/tests/Luxembourg/EasterMondayTest.php index a9e5b3bb8..4c8cb7f9e 100644 --- a/tests/Luxembourg/EasterMondayTest.php +++ b/tests/Luxembourg/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends LuxembourgBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testEasterMonday() + public function testEasterMonday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Luxembourg/EuropeDayTest.php b/tests/Luxembourg/EuropeDayTest.php index 0a3fdfe83..5518da0d2 100644 --- a/tests/Luxembourg/EuropeDayTest.php +++ b/tests/Luxembourg/EuropeDayTest.php @@ -39,7 +39,7 @@ class EuropeDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testEuropeDayOnAfter2019() + public function testEuropeDayOnAfter2019(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testEuropeDayOnAfter2019() * Tests Europe Day before 2019. * @throws ReflectionException */ - public function testEuropeDayBefore2019() + public function testEuropeDayBefore2019(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Luxembourg/InternationalWorkersDayTest.php b/tests/Luxembourg/InternationalWorkersDayTest.php index 735de22c2..ca919d983 100644 --- a/tests/Luxembourg/InternationalWorkersDayTest.php +++ b/tests/Luxembourg/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends LuxembourgBaseTestCase implements Yasu * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/NationalDayTest.php b/tests/Luxembourg/NationalDayTest.php index 4103f8787..e2321ebc7 100644 --- a/tests/Luxembourg/NationalDayTest.php +++ b/tests/Luxembourg/NationalDayTest.php @@ -38,7 +38,7 @@ class NationalDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/NewYearsDayTest.php b/tests/Luxembourg/NewYearsDayTest.php index 1ecbf48de..20ff49197 100644 --- a/tests/Luxembourg/NewYearsDayTest.php +++ b/tests/Luxembourg/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends LuxembourgBaseTestCase implements YasumiTestCaseIn * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Luxembourg/PentecostMondayTest.php b/tests/Luxembourg/PentecostMondayTest.php index 7a86a32a2..bef9a653e 100644 --- a/tests/Luxembourg/PentecostMondayTest.php +++ b/tests/Luxembourg/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends LuxembourgBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 1977; $this->assertHoliday( diff --git a/tests/Luxembourg/SecondChristmasDayTest.php b/tests/Luxembourg/SecondChristmasDayTest.php index 5981a4549..318daa15c 100644 --- a/tests/Luxembourg/SecondChristmasDayTest.php +++ b/tests/Luxembourg/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends LuxembourgBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/AscensionDayTest.php b/tests/Netherlands/AscensionDayTest.php index 2f5c5cbba..5a24849dc 100644 --- a/tests/Netherlands/AscensionDayTest.php +++ b/tests/Netherlands/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends NetherlandsBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1754; $this->assertHoliday( diff --git a/tests/Netherlands/AshWednesdayTest.php b/tests/Netherlands/AshWednesdayTest.php index 14ac02cc8..45e97cfdd 100644 --- a/tests/Netherlands/AshWednesdayTest.php +++ b/tests/Netherlands/AshWednesdayTest.php @@ -34,7 +34,7 @@ class AshWednesdayTest extends NetherlandsBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1999; $this->assertHoliday( diff --git a/tests/Netherlands/ChristmasDayTest.php b/tests/Netherlands/ChristmasDayTest.php index 5c53753c5..52d9a0098 100644 --- a/tests/Netherlands/ChristmasDayTest.php +++ b/tests/Netherlands/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends NetherlandsBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/CommemorationDayTest.php b/tests/Netherlands/CommemorationDayTest.php index fb6cf28bf..d28b33001 100644 --- a/tests/Netherlands/CommemorationDayTest.php +++ b/tests/Netherlands/CommemorationDayTest.php @@ -38,7 +38,7 @@ class CommemorationDayTest extends NetherlandsBaseTestCase implements YasumiTest * Tests Commemoration Day before 1947. Commemoration Day was established after WWII in 1947. * @throws ReflectionException */ - public function testCommemorationDayBefore1947() + public function testCommemorationDayBefore1947(): void { $this->assertNotHoliday( self::REGION, @@ -52,7 +52,7 @@ public function testCommemorationDayBefore1947() * @throws Exception * @throws ReflectionException */ - public function testCommemorationDayOnAfter1947() + public function testCommemorationDayOnAfter1947(): void { $year = 2105; $this->assertHoliday( diff --git a/tests/Netherlands/EasterMondayTest.php b/tests/Netherlands/EasterMondayTest.php index 096859df8..58bb5fed3 100644 --- a/tests/Netherlands/EasterMondayTest.php +++ b/tests/Netherlands/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends NetherlandsBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Netherlands/EasterTest.php b/tests/Netherlands/EasterTest.php index 014fd0645..2220de67a 100644 --- a/tests/Netherlands/EasterTest.php +++ b/tests/Netherlands/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends NetherlandsBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testEaster() + public function testEaster(): void { $year = 2010; $this->assertHoliday( diff --git a/tests/Netherlands/EpiphanyTest.php b/tests/Netherlands/EpiphanyTest.php index 3d8c2c759..7840bad8d 100644 --- a/tests/Netherlands/EpiphanyTest.php +++ b/tests/Netherlands/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends NetherlandsBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testEpiphany($year, $expected) + public function testEpiphany($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/FathersDayTest.php b/tests/Netherlands/FathersDayTest.php index 4b86f17d2..07731c263 100644 --- a/tests/Netherlands/FathersDayTest.php +++ b/tests/Netherlands/FathersDayTest.php @@ -34,7 +34,7 @@ class FathersDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(); $this->assertHoliday( diff --git a/tests/Netherlands/GoodFridayTest.php b/tests/Netherlands/GoodFridayTest.php index 3d0906350..f9fde89d5 100644 --- a/tests/Netherlands/GoodFridayTest.php +++ b/tests/Netherlands/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testGoodFriday() + public function testGoodFriday(): void { $year = 1876; $this->assertHoliday( diff --git a/tests/Netherlands/HalloweenTest.php b/tests/Netherlands/HalloweenTest.php index 6e1d29b53..757138959 100644 --- a/tests/Netherlands/HalloweenTest.php +++ b/tests/Netherlands/HalloweenTest.php @@ -38,7 +38,7 @@ class HalloweenTest extends NetherlandsBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/InternationalWorkersDayTest.php b/tests/Netherlands/InternationalWorkersDayTest.php index cbc836496..fbcf33ecf 100644 --- a/tests/Netherlands/InternationalWorkersDayTest.php +++ b/tests/Netherlands/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends NetherlandsBaseTestCase implements Yas * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/KingsDayTest.php b/tests/Netherlands/KingsDayTest.php index c2a9f7f05..7c962b7cc 100644 --- a/tests/Netherlands/KingsDayTest.php +++ b/tests/Netherlands/KingsDayTest.php @@ -39,7 +39,7 @@ class KingsDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testKingsDayOnAfter2014() + public function testKingsDayOnAfter2014(): void { $year = 2015; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testKingsDayOnAfter2014() * @throws Exception * @throws ReflectionException */ - public function testKingsDayOnAfter2014SubstitutedDay() + public function testKingsDayOnAfter2014SubstitutedDay(): void { $year = 2188; $this->assertHoliday( @@ -70,7 +70,7 @@ public function testKingsDayOnAfter2014SubstitutedDay() * Tests Kings Day before 2014. King's Day is celebrated from 2014 onwards on April 27th. * @throws ReflectionException */ - public function testKingsDayBefore2014() + public function testKingsDayBefore2014(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Netherlands/LiberationDayTest.php b/tests/Netherlands/LiberationDayTest.php index 7ea4b564d..494057827 100644 --- a/tests/Netherlands/LiberationDayTest.php +++ b/tests/Netherlands/LiberationDayTest.php @@ -38,7 +38,7 @@ class LiberationDayTest extends NetherlandsBaseTestCase implements YasumiTestCas * Tests Liberation Day before 1947. Liberation Day was established after WWII in 1947. * @throws ReflectionException */ - public function testLiberationDayBefore1947() + public function testLiberationDayBefore1947(): void { $this->assertNotHoliday( self::REGION, @@ -52,7 +52,7 @@ public function testLiberationDayBefore1947() * @throws Exception * @throws ReflectionException */ - public function testLiberationDayOnAfter1947() + public function testLiberationDayOnAfter1947(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( diff --git a/tests/Netherlands/MothersDayTest.php b/tests/Netherlands/MothersDayTest.php index 823743ce2..9aec75313 100644 --- a/tests/Netherlands/MothersDayTest.php +++ b/tests/Netherlands/MothersDayTest.php @@ -34,7 +34,7 @@ class MothersDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testMothersDay() + public function testMothersDay(): void { $year = $this->generateRandomYear(); $this->assertHoliday( diff --git a/tests/Netherlands/NewYearsDayTest.php b/tests/Netherlands/NewYearsDayTest.php index 960ed7b41..0459efdc4 100644 --- a/tests/Netherlands/NewYearsDayTest.php +++ b/tests/Netherlands/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testNewYearsDay($year, $expected) + public function testNewYearsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/PentecostTest.php b/tests/Netherlands/PentecostTest.php index 3c76c9bf2..ce8ce86d4 100644 --- a/tests/Netherlands/PentecostTest.php +++ b/tests/Netherlands/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends NetherlandsBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Netherlands/QueensDayTest.php b/tests/Netherlands/QueensDayTest.php index 48d8ac19c..c8c10d8ef 100644 --- a/tests/Netherlands/QueensDayTest.php +++ b/tests/Netherlands/QueensDayTest.php @@ -34,7 +34,7 @@ class QueensDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testQueensBetween1891and1948() + public function testQueensBetween1891and1948(): void { $year = 1901; $this->assertHoliday( @@ -50,7 +50,7 @@ public function testQueensBetween1891and1948() * @throws Exception * @throws ReflectionException */ - public function testQueensBetween1891and1948SubstitutedLater() + public function testQueensBetween1891and1948SubstitutedLater(): void { $year = 1947; $this->assertHoliday( @@ -66,7 +66,7 @@ public function testQueensBetween1891and1948SubstitutedLater() * @throws Exception * @throws ReflectionException */ - public function testQueensBetween1949and2013() + public function testQueensBetween1949and2013(): void { $year = 1965; $this->assertHoliday( @@ -82,7 +82,7 @@ public function testQueensBetween1949and2013() * @throws Exception * @throws ReflectionException */ - public function testQueensBetween1949and2013SubstitutedLater() + public function testQueensBetween1949and2013SubstitutedLater(): void { $year = 1967; $this->assertHoliday( @@ -98,7 +98,7 @@ public function testQueensBetween1949and2013SubstitutedLater() * @throws Exception * @throws ReflectionException */ - public function testQueensBetween1949and2013SubstitutedEarlier() + public function testQueensBetween1949and2013SubstitutedEarlier(): void { $year = 2006; $this->assertHoliday( @@ -113,7 +113,7 @@ public function testQueensBetween1949and2013SubstitutedEarlier() * Tests Queen's Day before 1891. * @throws ReflectionException */ - public function testQueensDayBefore1891() + public function testQueensDayBefore1891(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1000, 1890)); } @@ -122,7 +122,7 @@ public function testQueensDayBefore1891() * Tests Queen's Day after 2013. * @throws ReflectionException */ - public function testQueensDayAfter2013() + public function testQueensDayAfter2013(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(2014)); } diff --git a/tests/Netherlands/SummertimeTest.php b/tests/Netherlands/SummertimeTest.php index f0d4df135..d78b212c6 100644 --- a/tests/Netherlands/SummertimeTest.php +++ b/tests/Netherlands/SummertimeTest.php @@ -35,7 +35,7 @@ class SummertimeTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testSummertime() + public function testSummertime(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1946, 1976)); diff --git a/tests/Netherlands/ValentinesDayTest.php b/tests/Netherlands/ValentinesDayTest.php index fc6cf824f..da7ff30c4 100644 --- a/tests/Netherlands/ValentinesDayTest.php +++ b/tests/Netherlands/ValentinesDayTest.php @@ -38,7 +38,7 @@ class ValentinesDayTest extends NetherlandsBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testValentinesDay($year, $expected) + public function testValentinesDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/WintertimeTest.php b/tests/Netherlands/WintertimeTest.php index 6c3c702cc..472f7f29b 100644 --- a/tests/Netherlands/WintertimeTest.php +++ b/tests/Netherlands/WintertimeTest.php @@ -34,7 +34,7 @@ class WintertimeTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testWintertime() + public function testWintertime(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1946, 1976)); diff --git a/tests/Netherlands/WorldAnimalDayTest.php b/tests/Netherlands/WorldAnimalDayTest.php index 983282631..352eac226 100644 --- a/tests/Netherlands/WorldAnimalDayTest.php +++ b/tests/Netherlands/WorldAnimalDayTest.php @@ -39,7 +39,7 @@ class WorldAnimalDayTest extends NetherlandsBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testWorldAnimalDayOnAfter1931() + public function testWorldAnimalDayOnAfter1931(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testWorldAnimalDayOnAfter1931() * Tests World Animal Day before 1931. * @throws ReflectionException */ - public function testWorldAnimalBefore1931() + public function testWorldAnimalBefore1931(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Netherlands/carnivalDayTest.php b/tests/Netherlands/carnivalDayTest.php index 2ad71fec8..a38c6a1f8 100644 --- a/tests/Netherlands/carnivalDayTest.php +++ b/tests/Netherlands/carnivalDayTest.php @@ -35,7 +35,7 @@ class carnivalDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2015; $this->assertHoliday( diff --git a/tests/Netherlands/pentecostMondayTest.php b/tests/Netherlands/pentecostMondayTest.php index 424543120..c6b9c9602 100644 --- a/tests/Netherlands/pentecostMondayTest.php +++ b/tests/Netherlands/pentecostMondayTest.php @@ -34,7 +34,7 @@ class pentecostMondayTest extends NetherlandsBaseTestCase implements YasumiTestC * @throws Exception * @throws ReflectionException */ - public function testPentecostMonday() + public function testPentecostMonday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Netherlands/princesDayTest.php b/tests/Netherlands/princesDayTest.php index 22e850a50..276384225 100644 --- a/tests/Netherlands/princesDayTest.php +++ b/tests/Netherlands/princesDayTest.php @@ -34,7 +34,7 @@ class princesDayTest extends NetherlandsBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testPrincesDay() + public function testPrincesDay(): void { $year = $this->generateRandomYear(); $this->assertHoliday( diff --git a/tests/Netherlands/secondCarnivalDay.php b/tests/Netherlands/secondCarnivalDay.php index 17beb7808..225a81e83 100644 --- a/tests/Netherlands/secondCarnivalDay.php +++ b/tests/Netherlands/secondCarnivalDay.php @@ -44,7 +44,7 @@ class secondCarnivalDay extends NetherlandsBaseTestCase implements YasumiTestCas * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2015; $this->assertHoliday( diff --git a/tests/Netherlands/secondChristmasdayTest.php b/tests/Netherlands/secondChristmasdayTest.php index d9b950968..badb0caac 100644 --- a/tests/Netherlands/secondChristmasdayTest.php +++ b/tests/Netherlands/secondChristmasdayTest.php @@ -38,7 +38,7 @@ class secondChristmasdayTest extends NetherlandsBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/stMartinsDayTest.php b/tests/Netherlands/stMartinsDayTest.php index 0f7d16c41..d30fe68f9 100644 --- a/tests/Netherlands/stMartinsDayTest.php +++ b/tests/Netherlands/stMartinsDayTest.php @@ -38,7 +38,7 @@ class stMartinsDayTest extends NetherlandsBaseTestCase implements YasumiTestCase * * @throws ReflectionException */ - public function teststMartinsDay($year, $expected) + public function teststMartinsDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/stNicholasDayTest.php b/tests/Netherlands/stNicholasDayTest.php index 7d52d4dea..8dd31379a 100644 --- a/tests/Netherlands/stNicholasDayTest.php +++ b/tests/Netherlands/stNicholasDayTest.php @@ -39,7 +39,7 @@ class stNicholasDayTest extends NetherlandsBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function teststNicholasDay($year, $expected) + public function teststNicholasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Netherlands/thirdCarnivalDay.php b/tests/Netherlands/thirdCarnivalDay.php index b15a6a043..46f919a5a 100644 --- a/tests/Netherlands/thirdCarnivalDay.php +++ b/tests/Netherlands/thirdCarnivalDay.php @@ -44,7 +44,7 @@ class thirdCarnivalDay extends NetherlandsBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2015; $this->assertHoliday( diff --git a/tests/NewZealand/AnzacDayTest.php b/tests/NewZealand/AnzacDayTest.php index eaf065fa7..b55eda54a 100644 --- a/tests/NewZealand/AnzacDayTest.php +++ b/tests/NewZealand/AnzacDayTest.php @@ -45,7 +45,7 @@ class AnzacDayTest extends NewZealandBaseTestCase implements YasumiTestCaseInter * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -59,7 +59,7 @@ public function testHoliday($year, $expected) * Tests that Labour Day is not present before 1921 * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/NewZealand/BoxingDayTest.php b/tests/NewZealand/BoxingDayTest.php index 186b1cc82..7686c6aa0 100644 --- a/tests/NewZealand/BoxingDayTest.php +++ b/tests/NewZealand/BoxingDayTest.php @@ -41,7 +41,7 @@ class BoxingDayTest extends NewZealandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/ChristmasDayTest.php b/tests/NewZealand/ChristmasDayTest.php index 200f1b7e6..2bfe04668 100644 --- a/tests/NewZealand/ChristmasDayTest.php +++ b/tests/NewZealand/ChristmasDayTest.php @@ -41,7 +41,7 @@ class ChristmasDayTest extends NewZealandBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/DayAfterNewYearsDayTest.php b/tests/NewZealand/DayAfterNewYearsDayTest.php index 7cbe3334e..504440ab0 100644 --- a/tests/NewZealand/DayAfterNewYearsDayTest.php +++ b/tests/NewZealand/DayAfterNewYearsDayTest.php @@ -41,7 +41,7 @@ class DayAfterNewYearsDayTest extends NewZealandBaseTestCase implements YasumiTe * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/EasterMondayTest.php b/tests/NewZealand/EasterMondayTest.php index 3b7fcf48d..e3fa8d2b7 100644 --- a/tests/NewZealand/EasterMondayTest.php +++ b/tests/NewZealand/EasterMondayTest.php @@ -41,7 +41,7 @@ class EasterMondayTest extends NewZealandBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/GoodFridayTest.php b/tests/NewZealand/GoodFridayTest.php index ca328ea44..594a1edfd 100644 --- a/tests/NewZealand/GoodFridayTest.php +++ b/tests/NewZealand/GoodFridayTest.php @@ -41,7 +41,7 @@ class GoodFridayTest extends NewZealandBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/LabourDayTest.php b/tests/NewZealand/LabourDayTest.php index 00c9102ee..793ee53fc 100644 --- a/tests/NewZealand/LabourDayTest.php +++ b/tests/NewZealand/LabourDayTest.php @@ -45,7 +45,7 @@ class LabourDayTest extends NewZealandBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -59,7 +59,7 @@ public function testHoliday($year, $expected) * Tests that Labour Day is not present before 1900 * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/NewZealand/NewYearsDayTest.php b/tests/NewZealand/NewYearsDayTest.php index 7145a1883..21b265161 100644 --- a/tests/NewZealand/NewYearsDayTest.php +++ b/tests/NewZealand/NewYearsDayTest.php @@ -41,7 +41,7 @@ class NewYearsDayTest extends NewZealandBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, diff --git a/tests/NewZealand/QueensBirthdayTest.php b/tests/NewZealand/QueensBirthdayTest.php index fa09a5895..b6d633179 100644 --- a/tests/NewZealand/QueensBirthdayTest.php +++ b/tests/NewZealand/QueensBirthdayTest.php @@ -44,7 +44,7 @@ class QueensBirthdayTest extends NewZealandBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -53,7 +53,7 @@ public function testHoliday($year, $expected) * Tests that Holiday is not present before 1952 * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/NewZealand/WaitangiDayTest.php b/tests/NewZealand/WaitangiDayTest.php index 8a3bbec74..f9f0c3b39 100644 --- a/tests/NewZealand/WaitangiDayTest.php +++ b/tests/NewZealand/WaitangiDayTest.php @@ -45,7 +45,7 @@ class WaitangiDayTest extends NewZealandBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -59,7 +59,7 @@ public function testHoliday($year, $expected) * Tests that Holiday is not present before 1974 * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); } diff --git a/tests/Norway/AscensionDayTest.php b/tests/Norway/AscensionDayTest.php index ddb8010b6..c0ee5cacf 100644 --- a/tests/Norway/AscensionDayTest.php +++ b/tests/Norway/AscensionDayTest.php @@ -34,7 +34,7 @@ class AscensionDayTest extends NorwayBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testAscensionDay() + public function testAscensionDay(): void { $year = 1877; $this->assertHoliday( diff --git a/tests/Norway/ChristmasDayTest.php b/tests/Norway/ChristmasDayTest.php index 19653e5e9..73b0cbe89 100644 --- a/tests/Norway/ChristmasDayTest.php +++ b/tests/Norway/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends NorwayBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Norway/ConstitutionDayTest.php b/tests/Norway/ConstitutionDayTest.php index 2319eb44c..0214c6485 100644 --- a/tests/Norway/ConstitutionDayTest.php +++ b/tests/Norway/ConstitutionDayTest.php @@ -39,7 +39,7 @@ class ConstitutionDayTest extends NorwayBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2077; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Norway/EasterMondayTest.php b/tests/Norway/EasterMondayTest.php index 4040703dc..3b98def37 100644 --- a/tests/Norway/EasterMondayTest.php +++ b/tests/Norway/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends NorwayBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2355; $this->assertHoliday( diff --git a/tests/Norway/EasterTest.php b/tests/Norway/EasterTest.php index dd6631990..f97c2e8c5 100644 --- a/tests/Norway/EasterTest.php +++ b/tests/Norway/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends NorwayBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2355; $this->assertHoliday( diff --git a/tests/Norway/GoodFridayTest.php b/tests/Norway/GoodFridayTest.php index c587c3812..1bd74c6b5 100644 --- a/tests/Norway/GoodFridayTest.php +++ b/tests/Norway/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends NorwayBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1908; $this->assertHoliday( diff --git a/tests/Norway/InternationalWorkersDayTest.php b/tests/Norway/InternationalWorkersDayTest.php index 4d29de7d1..e93200c3b 100644 --- a/tests/Norway/InternationalWorkersDayTest.php +++ b/tests/Norway/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends NorwayBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Norway/MaundyThursdayTest.php b/tests/Norway/MaundyThursdayTest.php index d340960a2..513efef37 100644 --- a/tests/Norway/MaundyThursdayTest.php +++ b/tests/Norway/MaundyThursdayTest.php @@ -34,7 +34,7 @@ class MaundyThursdayTest extends NorwayBaseTestCase implements YasumiTestCaseInt * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 1655; $this->assertHoliday( diff --git a/tests/Norway/NewYearsDayTest.php b/tests/Norway/NewYearsDayTest.php index 75a187e3e..da89b327b 100644 --- a/tests/Norway/NewYearsDayTest.php +++ b/tests/Norway/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends NorwayBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Norway/PentecostMondayTest.php b/tests/Norway/PentecostMondayTest.php index 9c6b5991f..daa3cbabb 100644 --- a/tests/Norway/PentecostMondayTest.php +++ b/tests/Norway/PentecostMondayTest.php @@ -34,7 +34,7 @@ class PentecostMondayTest extends NorwayBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Norway/PentecostTest.php b/tests/Norway/PentecostTest.php index f3f0dcc1f..3c5da8922 100644 --- a/tests/Norway/PentecostTest.php +++ b/tests/Norway/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends NorwayBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Norway/SecondChristmasDayTest.php b/tests/Norway/SecondChristmasDayTest.php index 9b52a44ef..d7e72bfa4 100644 --- a/tests/Norway/SecondChristmasDayTest.php +++ b/tests/Norway/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends NorwayBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/AllSaintsDayTest.php b/tests/Poland/AllSaintsDayTest.php index cfd5f8eb6..bb82fa47f 100644 --- a/tests/Poland/AllSaintsDayTest.php +++ b/tests/Poland/AllSaintsDayTest.php @@ -38,7 +38,7 @@ class AllSaintsDayTest extends PolandBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/AssumptionOfMaryTest.php b/tests/Poland/AssumptionOfMaryTest.php index 0d800e64a..d3a09d5d8 100644 --- a/tests/Poland/AssumptionOfMaryTest.php +++ b/tests/Poland/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends PolandBaseTestCase implements YasumiTestCaseI * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/ChristmasTest.php b/tests/Poland/ChristmasTest.php index 40a20c1cb..769450f1b 100644 --- a/tests/Poland/ChristmasTest.php +++ b/tests/Poland/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends PolandBaseTestCase implements YasumiTestCaseInterfac * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/ConstitutionDayTest.php b/tests/Poland/ConstitutionDayTest.php index 6245edfd7..4c2a44e58 100644 --- a/tests/Poland/ConstitutionDayTest.php +++ b/tests/Poland/ConstitutionDayTest.php @@ -39,7 +39,7 @@ class ConstitutionDayTest extends PolandBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2077; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Poland/CorpusChristiTest.php b/tests/Poland/CorpusChristiTest.php index 90fecef8b..3785381d8 100644 --- a/tests/Poland/CorpusChristiTest.php +++ b/tests/Poland/CorpusChristiTest.php @@ -34,7 +34,7 @@ class CorpusChristiTest extends PolandBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2017; $this->assertHoliday( diff --git a/tests/Poland/EasterMondayTest.php b/tests/Poland/EasterMondayTest.php index 3b6277075..c2663eca0 100644 --- a/tests/Poland/EasterMondayTest.php +++ b/tests/Poland/EasterMondayTest.php @@ -34,7 +34,7 @@ class EasterMondayTest extends PolandBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2017; $this->assertHoliday( diff --git a/tests/Poland/EasterTest.php b/tests/Poland/EasterTest.php index 2352df04e..cd1b59723 100644 --- a/tests/Poland/EasterTest.php +++ b/tests/Poland/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends PolandBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Poland/EpiphanyTest.php b/tests/Poland/EpiphanyTest.php index 9ebea89c2..5f82c94b1 100644 --- a/tests/Poland/EpiphanyTest.php +++ b/tests/Poland/EpiphanyTest.php @@ -38,7 +38,7 @@ class EpiphanyTest extends PolandBaseTestCase implements YasumiTestCaseInterface * * @throws ReflectionException */ - public function testEpiphany($year, $expected) + public function testEpiphany($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/IndependenceDayTest.php b/tests/Poland/IndependenceDayTest.php index e12f288bd..5687f57a8 100644 --- a/tests/Poland/IndependenceDayTest.php +++ b/tests/Poland/IndependenceDayTest.php @@ -39,7 +39,7 @@ class IndependenceDayTest extends PolandBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = 2018; $this->assertHoliday( @@ -54,7 +54,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Poland/InternationalWorkersDayTest.php b/tests/Poland/InternationalWorkersDayTest.php index b47bc39ec..5d43d49c0 100644 --- a/tests/Poland/InternationalWorkersDayTest.php +++ b/tests/Poland/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends PolandBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/NewYearsDayTest.php b/tests/Poland/NewYearsDayTest.php index 0f941771a..970ac7bb9 100644 --- a/tests/Poland/NewYearsDayTest.php +++ b/tests/Poland/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends PolandBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Poland/PentecostTest.php b/tests/Poland/PentecostTest.php index 8422539d2..c98f9f49a 100644 --- a/tests/Poland/PentecostTest.php +++ b/tests/Poland/PentecostTest.php @@ -34,7 +34,7 @@ class PentecostTest extends PolandBaseTestCase implements YasumiTestCaseInterfac * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2019; $this->assertHoliday( diff --git a/tests/Poland/SecondChristmasDayTest.php b/tests/Poland/SecondChristmasDayTest.php index 4b513e616..b44dd6f69 100644 --- a/tests/Poland/SecondChristmasDayTest.php +++ b/tests/Poland/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends PolandBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/AllSaintsDayTest.php b/tests/Portugal/AllSaintsDayTest.php index 03485692b..ca8507a2c 100644 --- a/tests/Portugal/AllSaintsDayTest.php +++ b/tests/Portugal/AllSaintsDayTest.php @@ -46,7 +46,7 @@ class AllSaintsDayTest extends PortugalBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $expected = new DateTime("$year-11-01", new DateTimeZone(self::TIMEZONE)); @@ -61,7 +61,7 @@ public function testHoliday() * Test that the holiday did not happen in 2013-2015. * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $year = $this->generateRandomYear(2013, 2015); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Portugal/AssumptionOfMaryTest.php b/tests/Portugal/AssumptionOfMaryTest.php index e9b6be368..c4559e14a 100644 --- a/tests/Portugal/AssumptionOfMaryTest.php +++ b/tests/Portugal/AssumptionOfMaryTest.php @@ -38,7 +38,7 @@ class AssumptionOfMaryTest extends PortugalBaseTestCase implements YasumiTestCas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/CarnationRevolutionDayTest.php b/tests/Portugal/CarnationRevolutionDayTest.php index 326f008c7..a8477dbf6 100644 --- a/tests/Portugal/CarnationRevolutionDayTest.php +++ b/tests/Portugal/CarnationRevolutionDayTest.php @@ -39,7 +39,7 @@ class CarnationRevolutionDayTest extends PortugalBaseTestCase implements YasumiT * @throws ReflectionException * @throws Exception */ - public function testHolidayAfterEstablishment() + public function testHolidayAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $expected = new DateTime("$year-04-25", new DateTimeZone(self::TIMEZONE)); @@ -50,7 +50,7 @@ public function testHolidayAfterEstablishment() * Tests that the holiday is not a holiday before the year of establishment * @throws ReflectionException */ - public function testNotHolidayBeforeEstablishment() + public function testNotHolidayBeforeEstablishment(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Portugal/ChristmasTest.php b/tests/Portugal/ChristmasTest.php index e3fbac378..edaddaf7f 100644 --- a/tests/Portugal/ChristmasTest.php +++ b/tests/Portugal/ChristmasTest.php @@ -38,7 +38,7 @@ class ChristmasTest extends PortugalBaseTestCase implements YasumiTestCaseInterf * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/CorpusChristiTest.php b/tests/Portugal/CorpusChristiTest.php index e62596085..28db97c28 100644 --- a/tests/Portugal/CorpusChristiTest.php +++ b/tests/Portugal/CorpusChristiTest.php @@ -44,7 +44,7 @@ class CorpusChristiTest extends PortugalBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $expected = new DateTime("$year-5-26", new DateTimeZone(self::TIMEZONE)); @@ -55,7 +55,7 @@ public function testHoliday() * Test that the holiday did not happen in 2013-2015. * @throws ReflectionException */ - public function testNotHoliday() + public function testNotHoliday(): void { $year = $this->generateRandomYear(2013, 2015); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Portugal/EasterTest.php b/tests/Portugal/EasterTest.php index 69acda6ad..ea0a4847d 100644 --- a/tests/Portugal/EasterTest.php +++ b/tests/Portugal/EasterTest.php @@ -34,7 +34,7 @@ class EasterTest extends PortugalBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Portugal/GoodFridayTest.php b/tests/Portugal/GoodFridayTest.php index 316290284..012a91b08 100644 --- a/tests/Portugal/GoodFridayTest.php +++ b/tests/Portugal/GoodFridayTest.php @@ -34,7 +34,7 @@ class GoodFridayTest extends PortugalBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2016; $this->assertHoliday( diff --git a/tests/Portugal/ImmaculateConceptionTest.php b/tests/Portugal/ImmaculateConceptionTest.php index fde9ffc31..3e50b2f9c 100644 --- a/tests/Portugal/ImmaculateConceptionTest.php +++ b/tests/Portugal/ImmaculateConceptionTest.php @@ -38,7 +38,7 @@ class ImmaculateConceptionTest extends PortugalBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/InternationalWorkersDayTest.php b/tests/Portugal/InternationalWorkersDayTest.php index 35607256a..5136a512a 100644 --- a/tests/Portugal/InternationalWorkersDayTest.php +++ b/tests/Portugal/InternationalWorkersDayTest.php @@ -38,7 +38,7 @@ class InternationalWorkersDayTest extends PortugalBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/NewYearsDayTest.php b/tests/Portugal/NewYearsDayTest.php index 8da3ffa2e..d7f5db8b7 100644 --- a/tests/Portugal/NewYearsDayTest.php +++ b/tests/Portugal/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends PortugalBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Portugal/PortugalDayTest.php b/tests/Portugal/PortugalDayTest.php index 967ad76a7..d9aa03341 100644 --- a/tests/Portugal/PortugalDayTest.php +++ b/tests/Portugal/PortugalDayTest.php @@ -46,7 +46,7 @@ class PortugalDayTest extends PortugalBaseTestCase implements YasumiTestCaseInte * @throws Exception * @see Portugal::calculatePortugalDay() */ - public function testHolidayBeforeAbolishment() + public function testHolidayBeforeAbolishment(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR_BEFORE); $expected = new DateTime("$year-06-10", new DateTimeZone(self::TIMEZONE)); @@ -59,7 +59,7 @@ public function testHolidayBeforeAbolishment() * @throws Exception * @see Portugal::calculatePortugalDay() */ - public function testHolidayAfterRestoration() + public function testHolidayAfterRestoration(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR_AFTER); $expected = new DateTime("$year-06-10", new DateTimeZone(self::TIMEZONE)); @@ -72,7 +72,7 @@ public function testHolidayAfterRestoration() * @see Portugal::calculatePortugalDay() * */ - public function testNotHolidayDuringAbolishment() + public function testNotHolidayDuringAbolishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR_BEFORE + 1, self::ESTABLISHMENT_YEAR_AFTER - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Portugal/PortugueseRepublicDayTest.php b/tests/Portugal/PortugueseRepublicDayTest.php index 62b572091..6b736a246 100644 --- a/tests/Portugal/PortugueseRepublicDayTest.php +++ b/tests/Portugal/PortugueseRepublicDayTest.php @@ -46,7 +46,7 @@ class PortugueseRepublicDayTest extends PortugalBaseTestCase implements YasumiTe * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterRestoration() + public function testHolidayOnAfterRestoration(): void { $year = self::HOLIDAY_YEAR_RESTORED; @@ -63,7 +63,7 @@ public function testHolidayOnAfterRestoration() * Test that the holiday did not happen in 2013-2015. * @throws ReflectionException */ - public function testNotHolidayDuringAbolishment() + public function testNotHolidayDuringAbolishment(): void { $year = $this->generateRandomYear(2013, 2015); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); @@ -76,7 +76,7 @@ public function testNotHolidayDuringAbolishment() * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); @@ -93,7 +93,7 @@ public function testHolidayOnAfterEstablishment() * * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Portugal/RestorationOfIndependenceTest.php b/tests/Portugal/RestorationOfIndependenceTest.php index 6e8a64e2c..ccb86a21d 100644 --- a/tests/Portugal/RestorationOfIndependenceTest.php +++ b/tests/Portugal/RestorationOfIndependenceTest.php @@ -51,7 +51,7 @@ class RestorationOfIndependenceTest extends PortugalBaseTestCase implements Yasu * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::HOLIDAY_YEAR_ABOLISHED - 1); @@ -70,7 +70,7 @@ public function testHolidayOnAfterEstablishment() * @throws ReflectionException * @throws Exception */ - public function testHolidayOnAfterRestoration() + public function testHolidayOnAfterRestoration(): void { $year = 2016; @@ -87,7 +87,7 @@ public function testHolidayOnAfterRestoration() * Test that the holiday did not happen in 2013-2015. * @throws ReflectionException */ - public function testNotHolidayDuringAbolishment() + public function testNotHolidayDuringAbolishment(): void { $year = $this->generateRandomYear(2013, 2015); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); @@ -98,7 +98,7 @@ public function testNotHolidayDuringAbolishment() * * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); diff --git a/tests/Romania/AssumptionOfMaryTest.php b/tests/Romania/AssumptionOfMaryTest.php index f45e0ee3f..e8292578f 100644 --- a/tests/Romania/AssumptionOfMaryTest.php +++ b/tests/Romania/AssumptionOfMaryTest.php @@ -39,7 +39,7 @@ class AssumptionOfMaryTest extends RomaniaBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testAssumptionOfMaryDayOnAfter2008() + public function testAssumptionOfMaryDayOnAfter2008(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testAssumptionOfMaryDayOnAfter2008() * Tests Assumption of Mary Day before 2008. * @throws ReflectionException */ - public function testAssumptionOfMaryDayBefore2008() + public function testAssumptionOfMaryDayBefore2008(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/ChildrensDayTest.php b/tests/Romania/ChildrensDayTest.php index 2c02635ee..0681446aa 100644 --- a/tests/Romania/ChildrensDayTest.php +++ b/tests/Romania/ChildrensDayTest.php @@ -39,7 +39,7 @@ class ChildrensDayTest extends RomaniaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testChildrensDayOnAfter1950() + public function testChildrensDayOnAfter1950(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testChildrensDayOnAfter1950() * Tests Children's Day before 1950. * @throws ReflectionException */ - public function testChildrensDayBefore1950() + public function testChildrensDayBefore1950(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/ChristmasDayTest.php b/tests/Romania/ChristmasDayTest.php index 6cf4eeeda..680c17012 100644 --- a/tests/Romania/ChristmasDayTest.php +++ b/tests/Romania/ChristmasDayTest.php @@ -38,7 +38,7 @@ class ChristmasDayTest extends RomaniaBaseTestCase implements YasumiTestCaseInte * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Romania/ConstantinBrancusiDayTest.php b/tests/Romania/ConstantinBrancusiDayTest.php index 5ba2d2aac..c2857d96a 100644 --- a/tests/Romania/ConstantinBrancusiDayTest.php +++ b/tests/Romania/ConstantinBrancusiDayTest.php @@ -39,7 +39,7 @@ class ConstantinBrancusiDayTest extends RomaniaBaseTestCase implements YasumiTes * @throws Exception * @throws ReflectionException */ - public function testConstantinBrancusiDayOnAfter2016() + public function testConstantinBrancusiDayOnAfter2016(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testConstantinBrancusiDayOnAfter2016() * Tests Constantin Brancusi Day before 2016. * @throws ReflectionException */ - public function testConstantinBrancusiDayBefore2016() + public function testConstantinBrancusiDayBefore2016(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/DayAfterNewYearsDayTest.php b/tests/Romania/DayAfterNewYearsDayTest.php index e271815a0..cfaf05a9e 100644 --- a/tests/Romania/DayAfterNewYearsDayTest.php +++ b/tests/Romania/DayAfterNewYearsDayTest.php @@ -38,7 +38,7 @@ class DayAfterNewYearsDayTest extends RomaniaBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Romania/EasterMondayTest.php b/tests/Romania/EasterMondayTest.php index 441c0b157..fd4f5b047 100755 --- a/tests/Romania/EasterMondayTest.php +++ b/tests/Romania/EasterMondayTest.php @@ -35,7 +35,7 @@ class EasterMondayTest extends RomaniaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Romania/EasterTest.php b/tests/Romania/EasterTest.php index bc32f7fb3..cce04f4f0 100755 --- a/tests/Romania/EasterTest.php +++ b/tests/Romania/EasterTest.php @@ -35,7 +35,7 @@ class EasterTest extends RomaniaBaseTestCase implements YasumiTestCaseInterface * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = 2020; $this->assertHoliday( diff --git a/tests/Romania/InternationalWorkersDayTest.php b/tests/Romania/InternationalWorkersDayTest.php index 17d53e2ad..d2039854a 100755 --- a/tests/Romania/InternationalWorkersDayTest.php +++ b/tests/Romania/InternationalWorkersDayTest.php @@ -39,7 +39,7 @@ class InternationalWorkersDayTest extends RomaniaBaseTestCase implements YasumiT * * @throws ReflectionException */ - public function testInternationalWorkersDay($year, $expected) + public function testInternationalWorkersDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Romania/NationalDayTest.php b/tests/Romania/NationalDayTest.php index 4bd5e017e..3c060c901 100644 --- a/tests/Romania/NationalDayTest.php +++ b/tests/Romania/NationalDayTest.php @@ -39,7 +39,7 @@ class NationalDayTest extends RomaniaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testNationalDayOnAfter1990() + public function testNationalDayOnAfter1990(): void { $year = $this->generateRandomYear(1990); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testNationalDayOnAfter1990() * @throws Exception * @throws ReflectionException */ - public function testNationalDayBetween1948_1989() + public function testNationalDayBetween1948_1989(): void { $year = $this->generateRandomYear(1948, 1989); $this->assertHoliday( @@ -71,7 +71,7 @@ public function testNationalDayBetween1948_1989() * @throws Exception * @throws ReflectionException */ - public function testNationalDayBetween1866_1947() + public function testNationalDayBetween1866_1947(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1947); $this->assertHoliday( @@ -86,7 +86,7 @@ public function testNationalDayBetween1866_1947() * Tests National Day before 1865. * @throws ReflectionException */ - public function testNationalDayBefore1865() + public function testNationalDayBefore1865(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/NewYearsDayTest.php b/tests/Romania/NewYearsDayTest.php index 841e3a7b3..7accc8741 100644 --- a/tests/Romania/NewYearsDayTest.php +++ b/tests/Romania/NewYearsDayTest.php @@ -38,7 +38,7 @@ class NewYearsDayTest extends RomaniaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Romania/PentecostMondayTest.php b/tests/Romania/PentecostMondayTest.php index c0fef5290..4a626434d 100644 --- a/tests/Romania/PentecostMondayTest.php +++ b/tests/Romania/PentecostMondayTest.php @@ -40,7 +40,7 @@ class PentecostMondayTest extends RomaniaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testPentecostMondayOnAfter2008() + public function testPentecostMondayOnAfter2008(): void { $year = 2020; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testPentecostMondayOnAfter2008() * Tests the Pentecost Day before 2008. * @throws ReflectionException */ - public function testPentecostMondayBefore2008() + public function testPentecostMondayBefore2008(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/PentecostTest.php b/tests/Romania/PentecostTest.php index eaf84c3b5..9768e7bf6 100644 --- a/tests/Romania/PentecostTest.php +++ b/tests/Romania/PentecostTest.php @@ -40,7 +40,7 @@ class PentecostTest extends RomaniaBaseTestCase implements YasumiTestCaseInterfa * @throws Exception * @throws ReflectionException */ - public function testPentecostDayOnAfter2008() + public function testPentecostDayOnAfter2008(): void { $year = 2020; $this->assertHoliday( @@ -55,7 +55,7 @@ public function testPentecostDayOnAfter2008() * Tests the Pentecost Day before 2008. * @throws ReflectionException */ - public function testPentecostDayBefore2008() + public function testPentecostDayBefore2008(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/SecondChristmasDayTest.php b/tests/Romania/SecondChristmasDayTest.php index b4251b1b0..fe62a4578 100644 --- a/tests/Romania/SecondChristmasDayTest.php +++ b/tests/Romania/SecondChristmasDayTest.php @@ -38,7 +38,7 @@ class SecondChristmasDayTest extends RomaniaBaseTestCase implements YasumiTestCa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Romania/StAndrewsDayTest.php b/tests/Romania/StAndrewsDayTest.php index d51f6406c..8f3d5dfab 100644 --- a/tests/Romania/StAndrewsDayTest.php +++ b/tests/Romania/StAndrewsDayTest.php @@ -39,7 +39,7 @@ class StAndrewsDayTest extends RomaniaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testStAndrewDayOnAfter2012() + public function testStAndrewDayOnAfter2012(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testStAndrewDayOnAfter2012() * Tests Saint Andrew before 2012. * @throws ReflectionException */ - public function testStAndrewDayBefore2012() + public function testStAndrewDayBefore2012(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Romania/UnitedPrincipalitiesDayTest.php b/tests/Romania/UnitedPrincipalitiesDayTest.php index 293093836..d809af878 100644 --- a/tests/Romania/UnitedPrincipalitiesDayTest.php +++ b/tests/Romania/UnitedPrincipalitiesDayTest.php @@ -39,7 +39,7 @@ class UnitedPrincipalitiesDayTest extends RomaniaBaseTestCase implements YasumiT * @throws Exception * @throws ReflectionException */ - public function testUnitedPrincipalitiesDayOnAfter2015() + public function testUnitedPrincipalitiesDayOnAfter2015(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -54,7 +54,7 @@ public function testUnitedPrincipalitiesDayOnAfter2015() * Tests unitedPrincipalitiesDay before 2015. * @throws ReflectionException */ - public function testUnitedPrincipalitiesDayBefore2015() + public function testUnitedPrincipalitiesDayBefore2015(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/Russia/DefenceOfTheFatherlandDayTest.php b/tests/Russia/DefenceOfTheFatherlandDayTest.php index 02172c14c..03cab06dc 100644 --- a/tests/Russia/DefenceOfTheFatherlandDayTest.php +++ b/tests/Russia/DefenceOfTheFatherlandDayTest.php @@ -36,7 +36,7 @@ class DefenceOfTheFatherlandDayTest extends RussiaBaseTestCase implements Yasumi * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -50,7 +50,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Russia::DEFENCE_OF_THE_FATHERLAND_START_YEAR); diff --git a/tests/Russia/InternationalWomensDayTest.php b/tests/Russia/InternationalWomensDayTest.php index d7bb93ace..4b08cda98 100644 --- a/tests/Russia/InternationalWomensDayTest.php +++ b/tests/Russia/InternationalWomensDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay2Test.php b/tests/Russia/NewYearHolidaysDay2Test.php index 6acc833ee..dfd81d236 100644 --- a/tests/Russia/NewYearHolidaysDay2Test.php +++ b/tests/Russia/NewYearHolidaysDay2Test.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay3Test.php b/tests/Russia/NewYearHolidaysDay3Test.php index 7297424cd..47e8ee43f 100644 --- a/tests/Russia/NewYearHolidaysDay3Test.php +++ b/tests/Russia/NewYearHolidaysDay3Test.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay4Test.php b/tests/Russia/NewYearHolidaysDay4Test.php index 37a6621b1..05219a6bc 100644 --- a/tests/Russia/NewYearHolidaysDay4Test.php +++ b/tests/Russia/NewYearHolidaysDay4Test.php @@ -47,7 +47,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay5Test.php b/tests/Russia/NewYearHolidaysDay5Test.php index 464097db3..98ca363cd 100644 --- a/tests/Russia/NewYearHolidaysDay5Test.php +++ b/tests/Russia/NewYearHolidaysDay5Test.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay6Test.php b/tests/Russia/NewYearHolidaysDay6Test.php index c9397311e..35aa13c47 100644 --- a/tests/Russia/NewYearHolidaysDay6Test.php +++ b/tests/Russia/NewYearHolidaysDay6Test.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearHolidaysDay8Test.php b/tests/Russia/NewYearHolidaysDay8Test.php index 2bacd0e66..e09cc5c6b 100644 --- a/tests/Russia/NewYearHolidaysDay8Test.php +++ b/tests/Russia/NewYearHolidaysDay8Test.php @@ -47,7 +47,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/NewYearsDayTest.php b/tests/Russia/NewYearsDayTest.php index 62f3e3604..224106b19 100644 --- a/tests/Russia/NewYearsDayTest.php +++ b/tests/Russia/NewYearsDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/OrthodoxChristmasDayTest.php b/tests/Russia/OrthodoxChristmasDayTest.php index db67d4b63..661b9b421 100644 --- a/tests/Russia/OrthodoxChristmasDayTest.php +++ b/tests/Russia/OrthodoxChristmasDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/RussiaDayTest.php b/tests/Russia/RussiaDayTest.php index 7c9604e56..0517e32d2 100644 --- a/tests/Russia/RussiaDayTest.php +++ b/tests/Russia/RussiaDayTest.php @@ -37,7 +37,7 @@ class RussiaDayTest extends RussiaBaseTestCase implements YasumiTestCaseInterfac * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Russia::RUSSIA_DAY_START_YEAR); diff --git a/tests/Russia/SpringAndLabourDayTest.php b/tests/Russia/SpringAndLabourDayTest.php index 6ee100efa..b0c2aa9ed 100644 --- a/tests/Russia/SpringAndLabourDayTest.php +++ b/tests/Russia/SpringAndLabourDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Russia/UnityDayTest.php b/tests/Russia/UnityDayTest.php index 2c3095b12..9f9be645d 100644 --- a/tests/Russia/UnityDayTest.php +++ b/tests/Russia/UnityDayTest.php @@ -37,7 +37,7 @@ class UnityDayTest extends RussiaBaseTestCase implements YasumiTestCaseInterface * Test if holiday is not defined before * @throws ReflectionException */ - public function testHolidayBefore() + public function testHolidayBefore(): void { $this->assertNotHoliday( self::REGION, @@ -51,7 +51,7 @@ public function testHolidayBefore() * @throws Exception * @throws ReflectionException */ - public function testHolidayAfter() + public function testHolidayAfter(): void { $year = $this->generateRandomYear(Russia::UNITY_DAY_START_YEAR); diff --git a/tests/Russia/VictoryDayTest.php b/tests/Russia/VictoryDayTest.php index 771cde438..f88623eb9 100644 --- a/tests/Russia/VictoryDayTest.php +++ b/tests/Russia/VictoryDayTest.php @@ -48,7 +48,7 @@ public function holidayDataProvider(): array * * @throws ReflectionException */ - public function testHoliday($year, DateTime $expected) + public function testHoliday($year, DateTime $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/AllSaintsDayTest.php b/tests/Slovakia/AllSaintsDayTest.php index bcce081e6..73f784d7a 100644 --- a/tests/Slovakia/AllSaintsDayTest.php +++ b/tests/Slovakia/AllSaintsDayTest.php @@ -45,7 +45,7 @@ class AllSaintsDayTest extends SlovakiaBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/ChristmasDayTest.php b/tests/Slovakia/ChristmasDayTest.php index d79c35dc3..d9c45b0b6 100644 --- a/tests/Slovakia/ChristmasDayTest.php +++ b/tests/Slovakia/ChristmasDayTest.php @@ -45,7 +45,7 @@ class ChristmasDayTest extends SlovakiaBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testChristmasDay($year, $expected) + public function testChristmasDay($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/ChristmasEveTest.php b/tests/Slovakia/ChristmasEveTest.php index 0b2ffc99c..f4ab60083 100644 --- a/tests/Slovakia/ChristmasEveTest.php +++ b/tests/Slovakia/ChristmasEveTest.php @@ -45,7 +45,7 @@ class ChristmasEveTest extends SlovakiaBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testChristmasEve($year, $expected) + public function testChristmasEve($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/EasterMondayTest.php b/tests/Slovakia/EasterMondayTest.php index 96fb366e2..30ac9ffb4 100644 --- a/tests/Slovakia/EasterMondayTest.php +++ b/tests/Slovakia/EasterMondayTest.php @@ -46,7 +46,7 @@ class EasterMondayTest extends SlovakiaBaseTestCase implements YasumiTestCaseInt * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/EpiphanyTest.php b/tests/Slovakia/EpiphanyTest.php index 73a20fee0..050471c47 100644 --- a/tests/Slovakia/EpiphanyTest.php +++ b/tests/Slovakia/EpiphanyTest.php @@ -45,7 +45,7 @@ class EpiphanyTest extends SlovakiaBaseTestCase implements YasumiTestCaseInterfa * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/GoodFridayTest.php b/tests/Slovakia/GoodFridayTest.php index b6e4754a2..67623b0ee 100644 --- a/tests/Slovakia/GoodFridayTest.php +++ b/tests/Slovakia/GoodFridayTest.php @@ -46,7 +46,7 @@ class GoodFridayTest extends SlovakiaBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/InternationalWorkersDayTest.php b/tests/Slovakia/InternationalWorkersDayTest.php index b382a11d5..bcebe53e5 100644 --- a/tests/Slovakia/InternationalWorkersDayTest.php +++ b/tests/Slovakia/InternationalWorkersDayTest.php @@ -45,7 +45,7 @@ class InternationalWorkersDayTest extends SlovakiaBaseTestCase implements Yasumi * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/OurLadyOfSorrowsDayTest.php b/tests/Slovakia/OurLadyOfSorrowsDayTest.php index 2503772a2..6603b9e68 100644 --- a/tests/Slovakia/OurLadyOfSorrowsDayTest.php +++ b/tests/Slovakia/OurLadyOfSorrowsDayTest.php @@ -45,7 +45,7 @@ class OurLadyOfSorrowsDayTest extends SlovakiaBaseTestCase implements YasumiTest * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php b/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php index 242f644cb..82dad0992 100644 --- a/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php +++ b/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php @@ -45,7 +45,7 @@ class SaintsCyrilAndMethodiusDayTest extends SlovakiaBaseTestCase implements Yas * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/SecondChristmasDayTest.php b/tests/Slovakia/SecondChristmasDayTest.php index ba938bf3e..5942009e1 100644 --- a/tests/Slovakia/SecondChristmasDayTest.php +++ b/tests/Slovakia/SecondChristmasDayTest.php @@ -45,7 +45,7 @@ class SecondChristmasDayTest extends SlovakiaBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/SlovakConstitutionDayTest.php b/tests/Slovakia/SlovakConstitutionDayTest.php index 52721efcd..0aac83907 100644 --- a/tests/Slovakia/SlovakConstitutionDayTest.php +++ b/tests/Slovakia/SlovakConstitutionDayTest.php @@ -44,7 +44,7 @@ class SlovakConstitutionDayTest extends SlovakiaBaseTestCase implements YasumiTe * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/SlovakIndependeceDayTest.php b/tests/Slovakia/SlovakIndependeceDayTest.php index b59001eae..fd4ad8ccd 100644 --- a/tests/Slovakia/SlovakIndependeceDayTest.php +++ b/tests/Slovakia/SlovakIndependeceDayTest.php @@ -46,7 +46,7 @@ class SlovakIndependeceDayTest extends SlovakiaBaseTestCase implements YasumiTes * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/SlovakNationalUprisingDayTest.php b/tests/Slovakia/SlovakNationalUprisingDayTest.php index b25247b50..7b5144e00 100644 --- a/tests/Slovakia/SlovakNationalUprisingDayTest.php +++ b/tests/Slovakia/SlovakNationalUprisingDayTest.php @@ -45,7 +45,7 @@ class SlovakNationalUprisingDayTest extends SlovakiaBaseTestCase implements Yasu * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php b/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php index 322297eca..403727f4a 100644 --- a/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php +++ b/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php @@ -45,7 +45,7 @@ class StruggleForFreedomAndDemocracyDayTest extends SlovakiaBaseTestCase impleme * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/Slovakia/VictoryInEuropeDayTest.php b/tests/Slovakia/VictoryInEuropeDayTest.php index 2b1169aaf..645d7412e 100644 --- a/tests/Slovakia/VictoryInEuropeDayTest.php +++ b/tests/Slovakia/VictoryInEuropeDayTest.php @@ -45,7 +45,7 @@ class VictoryInEuropeDayTest extends SlovakiaBaseTestCase implements YasumiTestC * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } diff --git a/tests/SouthAfrica/ChristmasDayTest.php b/tests/SouthAfrica/ChristmasDayTest.php index 970c072cf..4efdf9040 100644 --- a/tests/SouthAfrica/ChristmasDayTest.php +++ b/tests/SouthAfrica/ChristmasDayTest.php @@ -50,7 +50,7 @@ class ChristmasDayTest extends SouthAfricaBaseTestCase implements YasumiTestCase * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/FamilyDayTest.php b/tests/SouthAfrica/FamilyDayTest.php index df08c9a29..aaa9c11e8 100644 --- a/tests/SouthAfrica/FamilyDayTest.php +++ b/tests/SouthAfrica/FamilyDayTest.php @@ -50,7 +50,7 @@ class FamilyDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseInt * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -84,7 +84,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/FreedomDayTest.php b/tests/SouthAfrica/FreedomDayTest.php index f8f0c3914..60723f57b 100644 --- a/tests/SouthAfrica/FreedomDayTest.php +++ b/tests/SouthAfrica/FreedomDayTest.php @@ -50,7 +50,7 @@ class FreedomDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/GoodFridayTest.php b/tests/SouthAfrica/GoodFridayTest.php index c5da6b058..a3d1ad71d 100644 --- a/tests/SouthAfrica/GoodFridayTest.php +++ b/tests/SouthAfrica/GoodFridayTest.php @@ -50,7 +50,7 @@ class GoodFridayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday( self::REGION, @@ -84,7 +84,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/HeritageDayTest.php b/tests/SouthAfrica/HeritageDayTest.php index 955048873..1cfbd76a8 100644 --- a/tests/SouthAfrica/HeritageDayTest.php +++ b/tests/SouthAfrica/HeritageDayTest.php @@ -50,7 +50,7 @@ class HeritageDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/HumanRightsDayTest.php b/tests/SouthAfrica/HumanRightsDayTest.php index ba8cd550e..c579ed9cb 100644 --- a/tests/SouthAfrica/HumanRightsDayTest.php +++ b/tests/SouthAfrica/HumanRightsDayTest.php @@ -50,7 +50,7 @@ class HumanRightsDayTest extends SouthAfricaBaseTestCase implements YasumiTestCa * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/MunicipalElections2016DayTest.php b/tests/SouthAfrica/MunicipalElections2016DayTest.php index 2bf417aaa..823436a9a 100644 --- a/tests/SouthAfrica/MunicipalElections2016DayTest.php +++ b/tests/SouthAfrica/MunicipalElections2016DayTest.php @@ -43,7 +43,7 @@ class MunicipalElections2016DayTest extends SouthAfricaBaseTestCase implements Y * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $this->assertHoliday( self::REGION, @@ -57,7 +57,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -70,7 +70,7 @@ public function testHolidayBeforeEstablishment() * Tests the holiday defined in this test after completion. * @throws ReflectionException */ - public function testHolidayDayAfterCompletion() + public function testHolidayDayAfterCompletion(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR + 1)); } diff --git a/tests/SouthAfrica/NationalWomensDayTest.php b/tests/SouthAfrica/NationalWomensDayTest.php index 1950ed25f..e676944a9 100644 --- a/tests/SouthAfrica/NationalWomensDayTest.php +++ b/tests/SouthAfrica/NationalWomensDayTest.php @@ -50,7 +50,7 @@ class NationalWomensDayTest extends SouthAfricaBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/NewYearsDayTest.php b/tests/SouthAfrica/NewYearsDayTest.php index ec51c43e2..f94c7eeba 100644 --- a/tests/SouthAfrica/NewYearsDayTest.php +++ b/tests/SouthAfrica/NewYearsDayTest.php @@ -50,7 +50,7 @@ class NewYearsDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseI * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/ReconciliationDayTest.php b/tests/SouthAfrica/ReconciliationDayTest.php index 8cd155391..83d877aab 100644 --- a/tests/SouthAfrica/ReconciliationDayTest.php +++ b/tests/SouthAfrica/ReconciliationDayTest.php @@ -50,7 +50,7 @@ class ReconciliationDayTest extends SouthAfricaBaseTestCase implements YasumiTes * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/SecondChristmasDayTest.php b/tests/SouthAfrica/SecondChristmasDayTest.php index d2c64689b..4cfa6cc21 100644 --- a/tests/SouthAfrica/SecondChristmasDayTest.php +++ b/tests/SouthAfrica/SecondChristmasDayTest.php @@ -50,7 +50,7 @@ class SecondChristmasDayTest extends SouthAfricaBaseTestCase implements YasumiTe * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php b/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php index f9facaa1b..5aa75ca0a 100644 --- a/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php +++ b/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php @@ -43,7 +43,7 @@ class SubstituteDayOfGoodwillTest extends SouthAfricaBaseTestCase implements Yas * @throws Exception * @throws ReflectionException */ - public function testHolidayOnAfterEstablishment() + public function testHolidayOnAfterEstablishment(): void { $this->assertHoliday( self::REGION, @@ -57,7 +57,7 @@ public function testHolidayOnAfterEstablishment() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, @@ -70,7 +70,7 @@ public function testHolidayBeforeEstablishment() * Tests the holiday defined in this test after completion. * @throws ReflectionException */ - public function testHolidayDayAfterCompletion() + public function testHolidayDayAfterCompletion(): void { $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR + 1)); } diff --git a/tests/SouthAfrica/WorkersDayTest.php b/tests/SouthAfrica/WorkersDayTest.php index d1799d08e..87ec8ea27 100644 --- a/tests/SouthAfrica/WorkersDayTest.php +++ b/tests/SouthAfrica/WorkersDayTest.php @@ -50,7 +50,7 @@ class WorkersDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseIn * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthAfrica/YouthDayTest.php b/tests/SouthAfrica/YouthDayTest.php index 2ef4b5c3c..48e602479 100644 --- a/tests/SouthAfrica/YouthDayTest.php +++ b/tests/SouthAfrica/YouthDayTest.php @@ -50,7 +50,7 @@ class YouthDayTest extends SouthAfricaBaseTestCase implements YasumiTestCaseInte * @throws ReflectionException * @throws Exception */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -85,7 +85,7 @@ public function HolidayDataProvider(): array * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ArborDayTest.php b/tests/SouthKorea/ArborDayTest.php index 830fe2938..62643280a 100644 --- a/tests/SouthKorea/ArborDayTest.php +++ b/tests/SouthKorea/ArborDayTest.php @@ -51,7 +51,7 @@ class ArborDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseInter * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::REMOVED_YEAR); if (self::YEAR_NOT_CELEBRATED === $year) { @@ -75,7 +75,7 @@ public function testHoliday() * * @throws ReflectionException */ - public function testHolidayAfterRemoval() + public function testHolidayAfterRemoval(): void { $this->assertNotHoliday( self::REGION, @@ -89,7 +89,7 @@ public function testHolidayAfterRemoval() * * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ArmedForcesDayTest.php b/tests/SouthKorea/ArmedForcesDayTest.php index eaf95fa4b..1713bcadd 100644 --- a/tests/SouthKorea/ArmedForcesDayTest.php +++ b/tests/SouthKorea/ArmedForcesDayTest.php @@ -45,7 +45,7 @@ class ArmedForcesDayTest extends SouthKoreaBaseTestCase implements YasumiTestCas * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::REMOVED_YEAR); $this->assertHoliday( @@ -60,7 +60,7 @@ public function testHoliday() * Tests the holiday defined in this test after removal. * @throws ReflectionException */ - public function testHolidayAfterRemoval() + public function testHolidayAfterRemoval(): void { $this->assertNotHoliday( self::REGION, @@ -73,7 +73,7 @@ public function testHolidayAfterRemoval() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/BuddhasBirthdayTest.php b/tests/SouthKorea/BuddhasBirthdayTest.php index c211d0429..f5a15199f 100644 --- a/tests/SouthKorea/BuddhasBirthdayTest.php +++ b/tests/SouthKorea/BuddhasBirthdayTest.php @@ -41,7 +41,7 @@ class BuddhasBirthdayTest extends SouthKoreaBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 2050); if (isset(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year])) { @@ -58,7 +58,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ChildrensDayTest.php b/tests/SouthKorea/ChildrensDayTest.php index b973e35f4..57b82e8e5 100644 --- a/tests/SouthKorea/ChildrensDayTest.php +++ b/tests/SouthKorea/ChildrensDayTest.php @@ -40,7 +40,7 @@ class ChildrensDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testMainHoliday() + public function testMainHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -56,7 +56,7 @@ public function testMainHoliday() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayByBuddhasBirthday() + public function testSubstituteHolidayByBuddhasBirthday(): void { foreach ([2025, 2044] as $year) { $this->assertHoliday( @@ -73,7 +73,7 @@ public function testSubstituteHolidayByBuddhasBirthday() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayBySaturday() + public function testSubstituteHolidayBySaturday(): void { $year = 2029; $this->assertHoliday( @@ -89,7 +89,7 @@ public function testSubstituteHolidayBySaturday() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayBySunday() + public function testSubstituteHolidayBySunday(): void { $year = 2019; $this->assertHoliday( @@ -104,7 +104,7 @@ public function testSubstituteHolidayBySunday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ChristmasDayTest.php b/tests/SouthKorea/ChristmasDayTest.php index bd482c0b6..97d5b1bc3 100644 --- a/tests/SouthKorea/ChristmasDayTest.php +++ b/tests/SouthKorea/ChristmasDayTest.php @@ -40,7 +40,7 @@ class ChristmasDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ChuseokTest.php b/tests/SouthKorea/ChuseokTest.php index b4ec88510..4f67e7b2f 100644 --- a/tests/SouthKorea/ChuseokTest.php +++ b/tests/SouthKorea/ChuseokTest.php @@ -42,7 +42,7 @@ class ChuseokTest extends SouthKoreaBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 2050); if (isset(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year])) { @@ -78,7 +78,7 @@ public function testHoliday() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayByGaecheonjeol() + public function testSubstituteHolidayByGaecheonjeol(): void { $this->assertHoliday( self::REGION, @@ -105,7 +105,7 @@ public function testSubstituteHolidayByGaecheonjeol() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayBySunday() + public function testSubstituteHolidayBySunday(): void { $this->assertHoliday( self::REGION, @@ -132,7 +132,7 @@ public function testSubstituteHolidayBySunday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/ConstitutionDayTest.php b/tests/SouthKorea/ConstitutionDayTest.php index 6106acc8a..b4ce908b2 100644 --- a/tests/SouthKorea/ConstitutionDayTest.php +++ b/tests/SouthKorea/ConstitutionDayTest.php @@ -45,7 +45,7 @@ class ConstitutionDayTest extends SouthKoreaBaseTestCase implements YasumiTestCa * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::REMOVED_YEAR); $this->assertHoliday( @@ -60,7 +60,7 @@ public function testHoliday() * Tests the holiday defined in this test after removal. * @throws ReflectionException */ - public function testHolidayAfterRemoval() + public function testHolidayAfterRemoval(): void { $this->assertNotHoliday( self::REGION, @@ -73,7 +73,7 @@ public function testHolidayAfterRemoval() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/GaecheonjeolTest.php b/tests/SouthKorea/GaecheonjeolTest.php index a9644841c..17c2600dc 100644 --- a/tests/SouthKorea/GaecheonjeolTest.php +++ b/tests/SouthKorea/GaecheonjeolTest.php @@ -40,7 +40,7 @@ class GaecheonjeolTest extends SouthKoreaBaseTestCase implements YasumiTestCaseI * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/HangulDayTest.php b/tests/SouthKorea/HangulDayTest.php index a09c04ab1..364648341 100644 --- a/tests/SouthKorea/HangulDayTest.php +++ b/tests/SouthKorea/HangulDayTest.php @@ -40,7 +40,7 @@ class HangulDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseInte * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); if ($year > 1990 && $year <= 2012) { @@ -63,7 +63,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/IndependenceMovementDayTest.php b/tests/SouthKorea/IndependenceMovementDayTest.php index 2136bf8b0..7cfea930d 100644 --- a/tests/SouthKorea/IndependenceMovementDayTest.php +++ b/tests/SouthKorea/IndependenceMovementDayTest.php @@ -40,7 +40,7 @@ class IndependenceMovementDayTest extends SouthKoreaBaseTestCase implements Yasu * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/LiberationDayTest.php b/tests/SouthKorea/LiberationDayTest.php index 328e9c646..b7a178656 100644 --- a/tests/SouthKorea/LiberationDayTest.php +++ b/tests/SouthKorea/LiberationDayTest.php @@ -40,7 +40,7 @@ class LiberationDayTest extends SouthKoreaBaseTestCase implements YasumiTestCase * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/MemorialDayTest.php b/tests/SouthKorea/MemorialDayTest.php index 925b1928a..841df6962 100644 --- a/tests/SouthKorea/MemorialDayTest.php +++ b/tests/SouthKorea/MemorialDayTest.php @@ -40,7 +40,7 @@ class MemorialDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $this->assertHoliday( @@ -55,7 +55,7 @@ public function testHoliday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/NewYearsDayTest.php b/tests/SouthKorea/NewYearsDayTest.php index de70d6377..c750a7edf 100644 --- a/tests/SouthKorea/NewYearsDayTest.php +++ b/tests/SouthKorea/NewYearsDayTest.php @@ -41,7 +41,7 @@ class NewYearsDayTest extends SouthKoreaBaseTestCase implements YasumiTestCaseIn * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); @@ -74,7 +74,7 @@ public function testHoliday() * Tests the holiday defined in this test after removal. * @throws ReflectionException */ - public function testHolidayAfterRemoval() + public function testHolidayAfterRemoval(): void { $this->assertNotHoliday( self::REGION, @@ -92,7 +92,7 @@ public function testHolidayAfterRemoval() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, diff --git a/tests/SouthKorea/SeollalTest.php b/tests/SouthKorea/SeollalTest.php index 4cfb02007..f03e99db2 100644 --- a/tests/SouthKorea/SeollalTest.php +++ b/tests/SouthKorea/SeollalTest.php @@ -42,7 +42,7 @@ class SeollalTest extends SouthKoreaBaseTestCase implements YasumiTestCaseInterf * @throws Exception * @throws ReflectionException */ - public function testHoliday() + public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 2050); if (isset(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year])) { @@ -76,7 +76,7 @@ public function testHoliday() * @throws Exception * @throws ReflectionException */ - public function testSubstituteHolidayBySunday() + public function testSubstituteHolidayBySunday(): void { $this->assertHoliday( self::REGION, @@ -102,7 +102,7 @@ public function testSubstituteHolidayBySunday() * Tests the holiday defined in this test before establishment. * @throws ReflectionException */ - public function testHolidayBeforeEstablishment() + public function testHolidayBeforeEstablishment(): void { $this->assertNotHoliday( self::REGION, From 9ce956146495e10d09e477ef2b3456a7568785d9 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 21:58:08 +0900 Subject: [PATCH 089/115] Added throws tag for error handling. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Croatia.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index 033ff9e4d..a050e0998 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -77,6 +77,7 @@ public function initialize(): void /** * Starting from the year 2020. statehood day is celebrated at a new date * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + * @throws \Exception */ private function calculateStatehoodDay(): void { @@ -99,6 +100,7 @@ private function calculateStatehoodDay(): void /** * Starting from the year 2020. Homeland Thanksgiving Day name is slightly changed * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + * @throws \Exception */ private function calculateHomelandThanksgivingDay(): void { @@ -125,6 +127,7 @@ private function calculateHomelandThanksgivingDay(): void * Starting from the year 2020. Independence Day is no longer an official holiday, * but is still remembered under a different name as Croatian Parliament Day (Dan Hrvatskog sabora) * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + * @throws \Exception */ private function calculateIndependenceDay(): void { @@ -139,6 +142,7 @@ private function calculateIndependenceDay(): void /** * Starting from the year 2020. a new holiday was added * Source: https://narodne-novine.nn.hr/clanci/sluzbeni/2019_11_110_2212.html + * @throws \Exception */ private function calculateRemembranceDayForHomelandWarVictims(): void { From a6a1ee00fe408f5965bd3f1c2d2c7d990a39b2ed Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 21:58:50 +0900 Subject: [PATCH 090/115] Added missing return tag in docblock. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Holiday.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 1696e1284..284374a6e 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -168,6 +168,7 @@ public function jsonSerialize(): self * * @param array $locales The locales to search for translations * + * @return string * @throws MissingTranslationException * * @see Holiday::DEFAULT_LOCALE From 7a51f26dbcc8ec14f8fc55850d7a95a578ef1c29 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 22:00:44 +0900 Subject: [PATCH 091/115] Removed redundant assignment. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Holiday.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 284374a6e..af3a846f7 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -211,7 +211,6 @@ protected function getLocales(?array $locales): array { if ($locales) { $expanded = []; - $locales = $locales; } else { $locales = [$this->displayLocale]; // DEFAULT_LOCALE is 'en_US', and its parent is 'en'. From 5ce242ca6fa1ef2af59f13dcd24df3896901634c Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Fri, 5 Jun 2020 22:01:20 +0900 Subject: [PATCH 092/115] Removed unused imports. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Canada/BritishColumbia.php | 1 - src/Yasumi/Provider/Canada/NewBrunswick.php | 1 - src/Yasumi/Provider/Canada/NorthwestTerritories.php | 1 - src/Yasumi/Provider/Canada/Ontario.php | 1 - 4 files changed, 4 deletions(-) diff --git a/src/Yasumi/Provider/Canada/BritishColumbia.php b/src/Yasumi/Provider/Canada/BritishColumbia.php index 2227be6bf..a510485aa 100644 --- a/src/Yasumi/Provider/Canada/BritishColumbia.php +++ b/src/Yasumi/Provider/Canada/BritishColumbia.php @@ -14,7 +14,6 @@ use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; -use Yasumi\Holiday; use Yasumi\Provider\Canada; /** diff --git a/src/Yasumi/Provider/Canada/NewBrunswick.php b/src/Yasumi/Provider/Canada/NewBrunswick.php index 1ecbe7191..42931fc45 100644 --- a/src/Yasumi/Provider/Canada/NewBrunswick.php +++ b/src/Yasumi/Provider/Canada/NewBrunswick.php @@ -14,7 +14,6 @@ use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; -use Yasumi\Holiday; use Yasumi\Provider\Canada; /** diff --git a/src/Yasumi/Provider/Canada/NorthwestTerritories.php b/src/Yasumi/Provider/Canada/NorthwestTerritories.php index 301e8b1db..9d70d5cfd 100644 --- a/src/Yasumi/Provider/Canada/NorthwestTerritories.php +++ b/src/Yasumi/Provider/Canada/NorthwestTerritories.php @@ -14,7 +14,6 @@ use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; -use Yasumi\Holiday; use Yasumi\Provider\Canada; /** diff --git a/src/Yasumi/Provider/Canada/Ontario.php b/src/Yasumi/Provider/Canada/Ontario.php index d7bff7b50..26b21133d 100644 --- a/src/Yasumi/Provider/Canada/Ontario.php +++ b/src/Yasumi/Provider/Canada/Ontario.php @@ -14,7 +14,6 @@ use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; -use Yasumi\Holiday; use Yasumi\Provider\Canada; /** From 066e1795dd641262eed96217e81270d2276fb6e1 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Mon, 8 Jun 2020 14:26:12 +0200 Subject: [PATCH 093/115] Add accessors for shortName and substitutedHoliday (#220) --- CHANGELOG.md | 4 ++++ src/Yasumi/Filters/AbstractFilter.php | 4 ++-- src/Yasumi/Holiday.php | 12 ++++++++++++ src/Yasumi/Provider/AbstractProvider.php | 6 +++--- src/Yasumi/Provider/SouthKorea.php | 2 +- src/Yasumi/SubstituteHoliday.php | 16 ++++++++++++++-- tests/Base/SubstituteHolidayTest.php | 4 ++-- tests/Base/TypographyTest.php | 2 +- tests/Ukraine/SubstitutedHolidayTest.php | 2 +- 9 files changed, 40 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58692b633..dc76ebb99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) +- Added accessor methods Holiday::getShortName() and SubstituteHoliday::getSubstitutedHoliday() [\#220](https://github.com/azuyalabs/yasumi/pull/220) ([c960657](https://github.com/c960657)) - Added missing return (correct) and parameter types in various methods. ### Changed @@ -44,6 +45,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Fixed compound conditions that are always true by simplifying the condition steps. +### Deprecated +- Deprecated direct access to public properties Holiday::$shortName and SubstituteHoliday::$substitutedHoliday in favor of accessor methods [\#220](https://github.com/azuyalabs/yasumi/pull/220) ([c960657](https://github.com/c960657)) + ### Removed - PHP 7.1 Support, as it has reached its end of life. - Removed the assertion of the instance type in some functions as it is already defined by the return type. diff --git a/src/Yasumi/Filters/AbstractFilter.php b/src/Yasumi/Filters/AbstractFilter.php index 747913458..6d9979a49 100644 --- a/src/Yasumi/Filters/AbstractFilter.php +++ b/src/Yasumi/Filters/AbstractFilter.php @@ -35,10 +35,10 @@ public function count(): int { $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { - return $holiday->substitutedHoliday->shortName; + return $holiday->getSubstitutedHoliday()->getShortName(); } - return $holiday->shortName; + return $holiday->getShortName(); }, \iterator_to_array($this)); return \count(\array_unique($names)); diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index af3a846f7..9f082dc49 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -67,6 +67,8 @@ class Holiday extends DateTime implements JsonSerializable /** * @var string short name (internal name) of this holiday + * @deprecated public access to this property is deprecated in favor of getShortName() + * @see getShortName() */ public $shortName; @@ -138,6 +140,16 @@ public function __construct( parent::__construct($date->format('Y-m-d'), $date->getTimezone()); } + /** + * Returns the short name for this holiday. + * + * @return string the short name, e.g. "newYearsDay". + */ + public function getShortName(): string + { + return $this->shortName; + } + /** * Returns what type this holiday is. * diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 5cddd4e42..f7a57a8eb 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -158,7 +158,7 @@ public function addHoliday(Holiday $holiday): void $holiday->mergeGlobalTranslations($this->globalTranslations); } - $this->holidays[$holiday->shortName] = $holiday; + $this->holidays[$holiday->getShortName()] = $holiday; \uasort($this->holidays, [__CLASS__, 'compareDates']); } @@ -315,10 +315,10 @@ public function count(): int { $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { - return $holiday->substitutedHoliday->shortName; + return $holiday->getSubstitutedHoliday()->getShortName(); } - return $holiday->shortName; + return $holiday->getShortName(); }, $this->getHolidays()); return \count(\array_unique($names)); diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 161a6be26..e10faa33b 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -484,7 +484,7 @@ public function calculateSubstituteHolidays(): void foreach ($holidays as $shortName => $holiday) { // Get list of holiday dates except this $holidayDates = \array_map(static function ($holiday) use ($shortName) { - return $holiday->shortName === $shortName ? false : (string)$holiday; + return $holiday->getShortName() === $shortName ? false : (string)$holiday; }, $holidays); // Only process accepted holidays and conditions diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index 9321c8493..fb7427525 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -28,6 +28,8 @@ class SubstituteHoliday extends Holiday { /** * @var Holiday + * @deprecated public access to this property is deprecated in favor of getSubstitutedHoliday() + * @see getSubstitutedHoliday() */ public $substitutedHoliday; @@ -66,7 +68,7 @@ public function __construct( ) { $this->substitutedHoliday = $substitutedHoliday; - $shortName = 'substituteHoliday:' . $substitutedHoliday->shortName; + $shortName = 'substituteHoliday:' . $substitutedHoliday->getShortName(); if ($date == $substitutedHoliday) { throw new \InvalidArgumentException('Date must differ from the substituted holiday'); @@ -76,6 +78,16 @@ public function __construct( parent::__construct($shortName, $names, $date, $displayLocale, $type); } + /** + * Returns the holiday being substituted. + * + * @return Holiday the holiday being substituted. + */ + public function getSubstitutedHoliday(): Holiday + { + return $this->substitutedHoliday; + } + /** * Returns the localized name of this holiday * @@ -95,7 +107,7 @@ public function getName($locales = null): string { $name = parent::getName(); - if ($name === $this->shortName) { + if ($name === $this->getShortName()) { foreach ($this->getLocales($locales) as $locales) { $pattern = $this->substituteHolidayTranslations[$locales] ?? null; if ($pattern) { diff --git a/tests/Base/SubstituteHolidayTest.php b/tests/Base/SubstituteHolidayTest.php index a9e1f34f8..cd1003503 100644 --- a/tests/Base/SubstituteHolidayTest.php +++ b/tests/Base/SubstituteHolidayTest.php @@ -67,8 +67,8 @@ public function testConstructor(): void $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US', Holiday::TYPE_BANK); $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US', Holiday::TYPE_SEASON); - $this->assertSame($holiday, $substitute->substitutedHoliday); - $this->assertEquals('substituteHoliday:testHoliday', $substitute->shortName); + $this->assertSame($holiday, $substitute->getSubstitutedHoliday()); + $this->assertEquals('substituteHoliday:testHoliday', $substitute->getShortName()); $this->assertEquals(Holiday::TYPE_SEASON, $substitute->getType()); $this->assertEquals(new DateTime('2019-01-02'), $substitute); } diff --git a/tests/Base/TypographyTest.php b/tests/Base/TypographyTest.php index 6944fcd49..6472363f9 100644 --- a/tests/Base/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -59,7 +59,7 @@ public function translationProvider(): array foreach ($provider->getHolidays() as $holiday) { foreach ($holiday->translations as $locale => $name) { - $tests[$name] = [$name, $class, $holiday->shortName, $locale]; + $tests[$name] = [$name, $class, $holiday->getShortName(), $locale]; } } } diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index 582825e82..5fa7c5f94 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -87,7 +87,7 @@ public function assertHolidayWithSubstitution( $this->assertTrue($holidays->isHoliday($holidayOfficial)); $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); - $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->shortName); + $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->getShortName()); if ($expectedSubstitution === null) { // without substitution $this->assertNull($holidaySubstitution); From 55ffb27fc29b30c9bf2f1efc10c9240acd9d0b1e Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 8 Jun 2020 21:44:33 +0900 Subject: [PATCH 094/115] Better to use an array. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Croatia.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index a050e0998..66b047080 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -104,7 +104,7 @@ private function calculateStatehoodDay(): void */ private function calculateHomelandThanksgivingDay(): void { - $names = null; + $names = []; if ($this->year >= 1995 && $this->year < 2020) { $names['en'] = 'Homeland Thanksgiving Day'; $names['hr'] = 'Dan domovinske zahvalnosti'; @@ -113,7 +113,7 @@ private function calculateHomelandThanksgivingDay(): void $names['hr'] = 'Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja'; } - if (null !== $names) { + if (! empty($names)) { $this->addHoliday(new Holiday( 'homelandThanksgiving', $names, From 530700164f0e913d94d320caa081fb14c6cad134 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 8 Jun 2020 21:48:06 +0900 Subject: [PATCH 095/115] Better to use empty function as the $locales (array) expression is implicitly converted to a boolean. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Holiday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 9f082dc49..050eb64d5 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -221,7 +221,7 @@ public function getName(array $locales = null): string */ protected function getLocales(?array $locales): array { - if ($locales) { + if (! empty($locales)) { $expanded = []; } else { $locales = [$this->displayLocale]; From 53c1f5897b9627f896e8a708df4165759fd3add7 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 10 Jun 2020 22:26:45 +0900 Subject: [PATCH 096/115] Corrected tests as familyDay only became an official holiday since 2009. If the random generated year was before 2009, the unit test failed. Signed-off-by: Sacha Telgenhof --- tests/Canada/Alberta/AlbertaTest.php | 11 ++++++++--- tests/Canada/BritishColumbia/BritishColumbiaTest.php | 11 ++++++++--- tests/Canada/NewBrunswick/NewBrunswickTest.php | 11 ++++++++--- tests/Canada/Ontario/OntarioTest.php | 11 ++++++++--- tests/Canada/Saskatchewan/SaskatchewanTest.php | 11 ++++++++--- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/tests/Canada/Alberta/AlbertaTest.php b/tests/Canada/Alberta/AlbertaTest.php index d4a3e313d..015693648 100644 --- a/tests/Canada/Alberta/AlbertaTest.php +++ b/tests/Canada/Alberta/AlbertaTest.php @@ -31,13 +31,18 @@ class AlbertaTest extends AlbertaBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'victoriaDay', 'heritageDay', - 'familyDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2009) { + $holidays[] = 'familyDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** diff --git a/tests/Canada/BritishColumbia/BritishColumbiaTest.php b/tests/Canada/BritishColumbia/BritishColumbiaTest.php index b29541e60..a9be1ec83 100644 --- a/tests/Canada/BritishColumbia/BritishColumbiaTest.php +++ b/tests/Canada/BritishColumbia/BritishColumbiaTest.php @@ -31,13 +31,18 @@ class BritishColumbiaTest extends BritishColumbiaBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'victoriaDay', 'civicHoliday', - 'familyDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2009) { + $holidays[] = 'familyDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** diff --git a/tests/Canada/NewBrunswick/NewBrunswickTest.php b/tests/Canada/NewBrunswick/NewBrunswickTest.php index 7952bb723..88800728d 100644 --- a/tests/Canada/NewBrunswick/NewBrunswickTest.php +++ b/tests/Canada/NewBrunswick/NewBrunswickTest.php @@ -31,13 +31,18 @@ class NewBrunswickTest extends NewBrunswickBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'victoriaDay', 'civicHoliday', - 'familyDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2009) { + $holidays[] = 'familyDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** diff --git a/tests/Canada/Ontario/OntarioTest.php b/tests/Canada/Ontario/OntarioTest.php index 97d6bfb3d..79bd56480 100644 --- a/tests/Canada/Ontario/OntarioTest.php +++ b/tests/Canada/Ontario/OntarioTest.php @@ -31,13 +31,18 @@ class OntarioTest extends OntarioBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'victoriaDay', 'civicHoliday', - 'familyDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2009) { + $holidays[] = 'familyDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** diff --git a/tests/Canada/Saskatchewan/SaskatchewanTest.php b/tests/Canada/Saskatchewan/SaskatchewanTest.php index c6ca3cacd..18f2b9116 100644 --- a/tests/Canada/Saskatchewan/SaskatchewanTest.php +++ b/tests/Canada/Saskatchewan/SaskatchewanTest.php @@ -31,13 +31,18 @@ class SaskatchewanTest extends SaskatchewanBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'victoriaDay', 'saskatchewanDay', - 'familyDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2009) { + $holidays[] = 'familyDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** From 81fc0f375b12e032fc1679e9d6e64ea5b2e608df Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 10 Jun 2020 22:41:15 +0900 Subject: [PATCH 097/115] Comment cleanup; removed redundant/duplicate lines. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/ChristianHolidays.php | 2 -- src/Yasumi/Provider/Netherlands.php | 2 -- src/Yasumi/Provider/Switzerland.php | 1 - src/Yasumi/Translations.php | 1 - 4 files changed, 6 deletions(-) diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index 67897824f..05720e759 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -22,7 +22,6 @@ * Trait ChristianHolidays. * * Trait containing base Christian Western churches calendar based holidays. - * */ trait ChristianHolidays { @@ -79,7 +78,6 @@ public function easter( * @link https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/ext/calendar/easter.c * @link http://www.gmarts.org/index.php?go=415#EasterMallen * @link https://www.tondering.dk/claus/cal/easter.php - * */ protected function calculateEaster(int $year, string $timezone): DateTime { diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php index 0035d99ec..6842488b2 100755 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -139,7 +139,6 @@ private function calculateCarnival(): void * * @throws \Exception * @see \Yasumi\Provider\CommonHolidays::winterTime() - * */ private function calculateWinterTime(): void { @@ -156,7 +155,6 @@ private function calculateWinterTime(): void * * @throws \Exception * @see \Yasumi\Provider\CommonHolidays::summerTime() - * */ private function calculateSummerTime(): void { diff --git a/src/Yasumi/Provider/Switzerland.php b/src/Yasumi/Provider/Switzerland.php index 3ee6d4e3b..29c719583 100644 --- a/src/Yasumi/Provider/Switzerland.php +++ b/src/Yasumi/Provider/Switzerland.php @@ -59,7 +59,6 @@ public function initialize(): void * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateNationalDay(): void { diff --git a/src/Yasumi/Translations.php b/src/Yasumi/Translations.php index f125a1ec7..47e6aa5ed 100644 --- a/src/Yasumi/Translations.php +++ b/src/Yasumi/Translations.php @@ -92,7 +92,6 @@ public function loadTranslations(string $directoryPath): void * * @throws UnknownLocaleException An UnknownLocaleException is thrown if the given locale is not * valid/available. - * */ protected function isValidLocale(string $locale): bool { From 4a81f15b276a5e30572b3dcbb9efe90636231fb4 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 10 Jun 2020 22:54:40 +0900 Subject: [PATCH 098/115] Changed code styling to use a space after cast operator and enforcing strict types. Signed-off-by: Sacha Telgenhof --- .php_cs | 4 +++- src/Yasumi/Exception/InvalidDateException.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 8 ++++---- src/Yasumi/Provider/Australia.php | 2 +- .../Australia/AustralianCapitalTerritory.php | 2 +- .../Canada/NewfoundlandAndLabrador.php | 4 ++-- src/Yasumi/Provider/ChristianHolidays.php | 8 ++++---- src/Yasumi/Provider/Ireland.php | 8 ++++---- src/Yasumi/Provider/Japan.php | 4 ++-- src/Yasumi/Provider/Netherlands.php | 4 ++-- src/Yasumi/Provider/SouthAfrica.php | 2 +- src/Yasumi/Provider/SouthKorea.php | 10 +++++----- src/Yasumi/Provider/USA.php | 4 ++-- src/Yasumi/Provider/UnitedKingdom.php | 6 +++--- .../Provider/UnitedKingdom/NorthernIreland.php | 4 ++-- src/Yasumi/Provider/UnitedKingdom/Scotland.php | 6 +++--- src/Yasumi/Yasumi.php | 8 ++++---- tests/Base/WeekendTest.php | 4 ++-- tests/Ireland/ChristmasDayTest.php | 2 +- tests/Ireland/NewYearsDayTest.php | 2 +- tests/Ireland/StPatricksDayTest.php | 2 +- tests/Ireland/StStephensDayTest.php | 2 +- tests/NewZealand/BoxingDayTest.php | 2 +- tests/NewZealand/ChristmasDayTest.php | 2 +- tests/SouthAfrica/ChristmasDayTest.php | 2 +- tests/SouthAfrica/FreedomDayTest.php | 2 +- tests/SouthAfrica/HeritageDayTest.php | 2 +- tests/SouthAfrica/HumanRightsDayTest.php | 2 +- tests/SouthAfrica/NationalWomensDayTest.php | 2 +- tests/SouthAfrica/NewYearsDayTest.php | 2 +- tests/SouthAfrica/ReconciliationDayTest.php | 2 +- tests/SouthAfrica/SecondChristmasDayTest.php | 2 +- tests/SouthAfrica/WorkersDayTest.php | 2 +- tests/SouthAfrica/YouthDayTest.php | 2 +- tests/UnitedKingdom/BoxingDayTest.php | 2 +- tests/UnitedKingdom/ChristmasDayTest.php | 2 +- tests/UnitedKingdom/England/BoxingDayTest.php | 2 +- .../UnitedKingdom/England/ChristmasDayTest.php | 2 +- .../NorthernIreland/BattleOfTheBoyneTest.php | 2 +- .../NorthernIreland/BoxingDayTest.php | 2 +- .../NorthernIreland/ChristmasDayTest.php | 2 +- .../NorthernIreland/StPatricksDayTest.php | 2 +- tests/UnitedKingdom/Scotland/BoxingDayTest.php | 2 +- .../Scotland/ChristmasDayTest.php | 2 +- .../UnitedKingdom/Scotland/NewYearsDayTest.php | 2 +- .../Scotland/SecondNewYearsDayTest.php | 2 +- .../Scotland/StAndrewsDayTest.php | 2 +- tests/UnitedKingdom/Wales/BoxingDayTest.php | 2 +- tests/UnitedKingdom/Wales/ChristmasDayTest.php | 2 +- tests/YasumiBase.php | 18 +++++++++--------- 50 files changed, 86 insertions(+), 84 deletions(-) diff --git a/.php_cs b/.php_cs index 81169b11a..0852abcc4 100644 --- a/.php_cs +++ b/.php_cs @@ -20,5 +20,7 @@ return PhpCsFixer\Config::create()->setRiskyAllowed(true)->setRules([ 'no_unused_imports' => true, 'single_quote' => true, 'space_after_semicolon' => true, - 'trailing_comma_in_multiline_array' => true + 'trailing_comma_in_multiline_array' => true, + 'cast_spaces' => ['space' => 'single'], + 'declare_strict_types' => true, ])->setLineEnding("\n")->setFinder($finder); \ No newline at end of file diff --git a/src/Yasumi/Exception/InvalidDateException.php b/src/Yasumi/Exception/InvalidDateException.php index da09ba49c..8a08db503 100644 --- a/src/Yasumi/Exception/InvalidDateException.php +++ b/src/Yasumi/Exception/InvalidDateException.php @@ -34,7 +34,7 @@ public function __construct($argumentValue) break; case 'integer': case 'double': - $displayName = (string)$argumentValue; + $displayName = (string) $argumentValue; break; case 'string': $displayName = $argumentValue; diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index f7a57a8eb..cb5d9bde1 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -224,7 +224,7 @@ public function isHoliday(\DateTimeInterface $date): bool public function getHolidayDates(): array { return \array_map(static function ($holiday) { - return (string)$holiday; + return (string) $holiday; }, $this->holidays); } @@ -242,7 +242,7 @@ public function isWeekendDay(\DateTimeInterface $date): bool { // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. if (\in_array( - (int)$date->format('w'), + (int) $date->format('w'), self::WEEKEND_DATA[$this::ID] ?? [0, 6], true ) @@ -266,7 +266,7 @@ public function whenIs(string $shortName): string { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty - return (string)$this->holidays[$shortName]; + return (string) $this->holidays[$shortName]; } /** @@ -302,7 +302,7 @@ public function whatWeekDayIs(string $shortName): int { $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty - return (int)$this->holidays[$shortName]->format('w'); + return (int) $this->holidays[$shortName]->format('w'); } /** diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php index 2c7b0119d..bd3c0bede 100755 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -132,7 +132,7 @@ private function calculateAustraliaDay(): void ); $this->addHoliday($holiday); - $day = (int)$date->format('w'); + $day = (int) $date->format('w'); if (0 === $day || 6 === $day) { $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P2D')); diff --git a/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php index 677f15d33..f5c7dbdcd 100644 --- a/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php +++ b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php @@ -193,7 +193,7 @@ private function calculateReconciliationDay(): void } $date = new DateTime($this->year . '-05-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $day = (int)$date->format('w'); + $day = (int) $date->format('w'); if (1 !== $day) { $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P' . (8 - $day) . 'D')); } diff --git a/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php index a484827c2..fba2e276b 100644 --- a/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php +++ b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php @@ -88,7 +88,7 @@ private function calculateStPatricksDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); @@ -134,7 +134,7 @@ private function calculateOrangemensDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index 05720e759..172a4b77e 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -91,7 +91,7 @@ protected function calculateEaster(int $year, string $timezone): DateTime // 1583 AD to 4099 (A day adjustment is required in or shortly after 4100 AD). // After 1752, most western churches have adopted the current algorithm. if ($year <= 1752) { - $dom = ($year + (int)($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday + $dom = ($year + (int) ($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday if ($dom < 0) { $dom += 7; } @@ -101,13 +101,13 @@ protected function calculateEaster(int $year, string $timezone): DateTime $pfm += 30; } } else { - $dom = ($year + (int)($year / 4) - (int)($year / 100) + (int)($year / 400)) % 7; // The 'Dominical number' - finding a Sunday + $dom = ($year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400)) % 7; // The 'Dominical number' - finding a Sunday if ($dom < 0) { $dom += 7; } - $solar = (int)(($year - 1600) / 100) - (int)(($year - 1600) / 400); // The solar correction - $lunar = (int)(((int)(($year - 1400) / 100) * 8) / 25); // The lunar correction + $solar = (int) (($year - 1600) / 100) - (int) (($year - 1600) / 400); // The solar correction + $lunar = (int) (((int) (($year - 1400) / 100) * 8) / 25); // The lunar correction $pfm = (3 - (11 * $golden) + $solar - $lunar) % 30; // Uncorrected date of the Paschal full moon if ($pfm < 0) { diff --git a/src/Yasumi/Provider/Ireland.php b/src/Yasumi/Provider/Ireland.php index 74dfb009f..c5add167e 100644 --- a/src/Yasumi/Provider/Ireland.php +++ b/src/Yasumi/Provider/Ireland.php @@ -103,7 +103,7 @@ private function calculateNewYearsDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Sunday. - if (0 === (int)$holiday->format('w')) { + if (0 === (int) $holiday->format('w')) { $date = clone $holiday; $date->modify('next monday'); @@ -164,7 +164,7 @@ private function calculateChristmasDay(): void $this->addHoliday($holiday); // Whenever Christmas Day does not fall on a weekday, the Tuesday following on it shall be a public holiday. - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next tuesday'); @@ -204,7 +204,7 @@ private function calculateStStephensDay(): void $this->addHoliday($holiday); // Whenever St. Stephens Day does not fall on a weekday, the Monday following on it shall be a public holiday. - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); @@ -249,7 +249,7 @@ private function calculateStPatricksDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php index 9d65991df..026450a54 100755 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -544,7 +544,7 @@ private function calculateSubstituteHolidays(): void $date = clone $holiday; // If holidays falls on a Sunday - if (0 === (int)$holiday->format('w')) { + if (0 === (int) $holiday->format('w')) { if ($this->year >= 2007) { // Find next week day (not being another holiday) while (\in_array($date, $dates, false)) { @@ -636,7 +636,7 @@ private function calculateBridgeHolidays(): void } // Determine if gap between holidays is one day and create bridge holiday - if (2 === (int)$previous->diff($datesIterator->current())->format('%a')) { + if (2 === (int) $previous->diff($datesIterator->current())->format('%a')) { $bridgeDate = clone $previous; $bridgeDate->add(new DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php index 6842488b2..7812bcc5b 100755 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -250,7 +250,7 @@ private function calculateQueensday(): void } // Determine substitution day - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $this->year < 1980 ? $date->add(new DateInterval('P1D')) : $date->sub(new DateInterval('P1D')); } @@ -276,7 +276,7 @@ private function calculateKingsday(): void if ($this->year >= 2014) { $date = new DateTime("$this->year-4-27", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->sub(new DateInterval('P1D')); } diff --git a/src/Yasumi/Provider/SouthAfrica.php b/src/Yasumi/Provider/SouthAfrica.php index 6ffd17863..f4dcf9c4e 100644 --- a/src/Yasumi/Provider/SouthAfrica.php +++ b/src/Yasumi/Provider/SouthAfrica.php @@ -326,7 +326,7 @@ private function calculateSubstituteHolidays(): void // Loop through all defined holidays foreach ($this->getHolidays() as $holiday) { // Substitute holiday is on a Monday in case the holiday falls on a Sunday - if (0 === (int)$holiday->format('w')) { + if (0 === (int) $holiday->format('w')) { $date = clone $holiday; $date->add(new DateInterval('P1D')); diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index e10faa33b..1a1d51654 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -484,22 +484,22 @@ public function calculateSubstituteHolidays(): void foreach ($holidays as $shortName => $holiday) { // Get list of holiday dates except this $holidayDates = \array_map(static function ($holiday) use ($shortName) { - return $holiday->getShortName() === $shortName ? false : (string)$holiday; + return $holiday->getShortName() === $shortName ? false : (string) $holiday; }, $holidays); // Only process accepted holidays and conditions if (\in_array($shortName, $acceptedHolidays, true) && ( - 0 === (int)$holiday->format('w') + 0 === (int) $holiday->format('w') || \in_array($holiday, $holidayDates, false) - || (6 === (int)$holiday->format('w') && 'childrensDay' === $shortName) + || (6 === (int) $holiday->format('w') && 'childrensDay' === $shortName) ) ) { $date = clone $holiday; // Find next week day (not being another holiday) - while (0 === (int)$date->format('w') - || (6 === (int)$date->format('w') && 'childrensDay' === $shortName) + while (0 === (int) $date->format('w') + || (6 === (int) $date->format('w') && 'childrensDay' === $shortName) || \in_array($date, $holidayDates, false)) { $date->add(new DateInterval('P1D')); continue; diff --git a/src/Yasumi/Provider/USA.php b/src/Yasumi/Provider/USA.php index 3cf5d4a88..0f0ee0a35 100755 --- a/src/Yasumi/Provider/USA.php +++ b/src/Yasumi/Provider/USA.php @@ -272,13 +272,13 @@ private function calculateSubstituteHolidays(): void $date = null; // Substitute holiday is on a Monday in case the holiday falls on a Sunday - if (0 === (int)$holiday->format('w')) { + if (0 === (int) $holiday->format('w')) { $date = clone $holiday; $date->add(new DateInterval('P1D')); } // Substitute holiday is on a Friday in case the holiday falls on a Saturday - if (6 === (int)$holiday->format('w')) { + if (6 === (int) $holiday->format('w')) { $date = clone $holiday; $date->sub(new DateInterval('P1D')); } diff --git a/src/Yasumi/Provider/UnitedKingdom.php b/src/Yasumi/Provider/UnitedKingdom.php index 0c89fd675..ff7890fe3 100644 --- a/src/Yasumi/Provider/UnitedKingdom.php +++ b/src/Yasumi/Provider/UnitedKingdom.php @@ -89,7 +89,7 @@ protected function calculateNewYearsDay(): void $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); // If New Years Day falls on a Saturday or Sunday, it is observed the next Monday (January 2nd or 3rd) - if (\in_array((int)$newYearsDay->format('w'), [0, 6], true)) { + if (\in_array((int) $newYearsDay->format('w'), [0, 6], true)) { $newYearsDay->modify('next monday'); } @@ -275,7 +275,7 @@ protected function calculateChristmasHolidays(?string $type = null): void $this->addHoliday($christmasDay); $this->addHoliday($secondChristmasDay); - if (\in_array((int)$christmasDay->format('w'), [0, 6], true)) { + if (\in_array((int) $christmasDay->format('w'), [0, 6], true)) { $date = clone $christmasDay; $date->add(new DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( @@ -287,7 +287,7 @@ protected function calculateChristmasHolidays(?string $type = null): void )); } - if (\in_array((int)$secondChristmasDay->format('w'), [0, 6], true)) { + if (\in_array((int) $secondChristmasDay->format('w'), [0, 6], true)) { $date = clone $secondChristmasDay; $date->add(new DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( diff --git a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php index 43f35b7e4..c1a5fc6f3 100644 --- a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php +++ b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php @@ -87,7 +87,7 @@ private function calculateStPatricksDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); @@ -133,7 +133,7 @@ private function calculateBattleOfTheBoyne(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); diff --git a/src/Yasumi/Provider/UnitedKingdom/Scotland.php b/src/Yasumi/Provider/UnitedKingdom/Scotland.php index ebcb5435e..1b3a00944 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Scotland.php +++ b/src/Yasumi/Provider/UnitedKingdom/Scotland.php @@ -107,7 +107,7 @@ protected function calculateNewYearsHolidays(): void $this->addHoliday($newYearsDay); $this->addHoliday($secondNewYearsDay); - if (\in_array((int)$newYearsDay->format('w'), [0, 6], true)) { + if (\in_array((int) $newYearsDay->format('w'), [0, 6], true)) { $date = clone $newYearsDay; $date->add(new DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( @@ -119,7 +119,7 @@ protected function calculateNewYearsHolidays(): void )); } - if (\in_array((int)$secondNewYearsDay->format('w'), [0, 6], true)) { + if (\in_array((int) $secondNewYearsDay->format('w'), [0, 6], true)) { $date = clone $secondNewYearsDay; $date->add(new DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( @@ -188,7 +188,7 @@ private function calculateStAndrewsDay(): void $this->addHoliday($holiday); // Substitute holiday is on the next available weekday if a holiday falls on a Saturday or Sunday - if (\in_array((int)$holiday->format('w'), [0, 6], true)) { + if (\in_array((int) $holiday->format('w'), [0, 6], true)) { $date = clone $holiday; $date->modify('next monday'); diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index a6982f865..93f85feb1 100755 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -92,8 +92,8 @@ public static function nextWorkingDay( while ($workingDays > 0) { $date = $date->add(new \DateInterval('P1D')); - if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { - $provider = self::create($class, (int)$date->format('Y')); + if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int) $date->format('Y')) { + $provider = self::create($class, (int) $date->format('Y')); } if ($provider->isWorkingDay($date)) { $workingDays--; @@ -286,8 +286,8 @@ public static function prevWorkingDay( while ($workingDays > 0) { $date = $date->sub(new \DateInterval('P1D')); - if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int)$date->format('Y')) { - $provider = self::create($class, (int)$date->format('Y')); + if (!$provider instanceof ProviderInterface || $provider->getYear() !== (int) $date->format('Y')) { + $provider = self::create($class, (int) $date->format('Y')); } if ($provider->isWorkingDay($date)) { $workingDays--; diff --git a/tests/Base/WeekendTest.php b/tests/Base/WeekendTest.php index ef4c3cfbc..08ba0a03c 100644 --- a/tests/Base/WeekendTest.php +++ b/tests/Base/WeekendTest.php @@ -39,7 +39,7 @@ class WeekendTest extends TestCase */ public function testWeekendDay(\DateTimeImmutable $date): void { - $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int)$date->format('Y')); + $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int) $date->format('Y')); $isWeekendDay = $yasumiProvider->isWeekendDay($date); $this->assertIsBool($isWeekendDay); @@ -83,7 +83,7 @@ public function dataProviderWeekendDays(): array */ public function testNonWeekendDay(\DateTimeImmutable $date): void { - $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int)$date->format('Y')); + $yasumiProvider = Yasumi::create(self::HOLIDAY_PROVIDER, (int) $date->format('Y')); $isWeekendDay = $yasumiProvider->isWeekendDay($date); $this->assertIsBool($isWeekendDay); diff --git a/tests/Ireland/ChristmasDayTest.php b/tests/Ireland/ChristmasDayTest.php index b0463dae6..85cb3d878 100644 --- a/tests/Ireland/ChristmasDayTest.php +++ b/tests/Ireland/ChristmasDayTest.php @@ -45,7 +45,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next tuesday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/Ireland/NewYearsDayTest.php b/tests/Ireland/NewYearsDayTest.php index 69f74536b..263081011 100644 --- a/tests/Ireland/NewYearsDayTest.php +++ b/tests/Ireland/NewYearsDayTest.php @@ -50,7 +50,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/Ireland/StPatricksDayTest.php b/tests/Ireland/StPatricksDayTest.php index 1b89ec018..f8af5f1df 100644 --- a/tests/Ireland/StPatricksDayTest.php +++ b/tests/Ireland/StPatricksDayTest.php @@ -50,7 +50,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/Ireland/StStephensDayTest.php b/tests/Ireland/StStephensDayTest.php index a60b134f8..ea7f9c1d4 100644 --- a/tests/Ireland/StStephensDayTest.php +++ b/tests/Ireland/StStephensDayTest.php @@ -45,7 +45,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/NewZealand/BoxingDayTest.php b/tests/NewZealand/BoxingDayTest.php index 7686c6aa0..faa690169 100644 --- a/tests/NewZealand/BoxingDayTest.php +++ b/tests/NewZealand/BoxingDayTest.php @@ -65,7 +65,7 @@ public function HolidayDataProvider(): array $year = $this->generateRandomYear(); $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); } diff --git a/tests/NewZealand/ChristmasDayTest.php b/tests/NewZealand/ChristmasDayTest.php index 2bfe04668..8442b7875 100644 --- a/tests/NewZealand/ChristmasDayTest.php +++ b/tests/NewZealand/ChristmasDayTest.php @@ -65,7 +65,7 @@ public function HolidayDataProvider(): array $year = $this->generateRandomYear(); $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); } diff --git a/tests/SouthAfrica/ChristmasDayTest.php b/tests/SouthAfrica/ChristmasDayTest.php index 4efdf9040..236410560 100644 --- a/tests/SouthAfrica/ChristmasDayTest.php +++ b/tests/SouthAfrica/ChristmasDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/FreedomDayTest.php b/tests/SouthAfrica/FreedomDayTest.php index 60723f57b..2a79186b9 100644 --- a/tests/SouthAfrica/FreedomDayTest.php +++ b/tests/SouthAfrica/FreedomDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/HeritageDayTest.php b/tests/SouthAfrica/HeritageDayTest.php index 1cfbd76a8..be7da93b5 100644 --- a/tests/SouthAfrica/HeritageDayTest.php +++ b/tests/SouthAfrica/HeritageDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/HumanRightsDayTest.php b/tests/SouthAfrica/HumanRightsDayTest.php index c579ed9cb..07b271a26 100644 --- a/tests/SouthAfrica/HumanRightsDayTest.php +++ b/tests/SouthAfrica/HumanRightsDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/NationalWomensDayTest.php b/tests/SouthAfrica/NationalWomensDayTest.php index e676944a9..a1f0348a6 100644 --- a/tests/SouthAfrica/NationalWomensDayTest.php +++ b/tests/SouthAfrica/NationalWomensDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/NewYearsDayTest.php b/tests/SouthAfrica/NewYearsDayTest.php index f94c7eeba..dd36fe4ca 100644 --- a/tests/SouthAfrica/NewYearsDayTest.php +++ b/tests/SouthAfrica/NewYearsDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/ReconciliationDayTest.php b/tests/SouthAfrica/ReconciliationDayTest.php index 83d877aab..5838c02ca 100644 --- a/tests/SouthAfrica/ReconciliationDayTest.php +++ b/tests/SouthAfrica/ReconciliationDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/SecondChristmasDayTest.php b/tests/SouthAfrica/SecondChristmasDayTest.php index 4cfa6cc21..6ab873b2d 100644 --- a/tests/SouthAfrica/SecondChristmasDayTest.php +++ b/tests/SouthAfrica/SecondChristmasDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/WorkersDayTest.php b/tests/SouthAfrica/WorkersDayTest.php index 87ec8ea27..8632a4809 100644 --- a/tests/SouthAfrica/WorkersDayTest.php +++ b/tests/SouthAfrica/WorkersDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/SouthAfrica/YouthDayTest.php b/tests/SouthAfrica/YouthDayTest.php index 48e602479..5c5327fa5 100644 --- a/tests/SouthAfrica/YouthDayTest.php +++ b/tests/SouthAfrica/YouthDayTest.php @@ -56,7 +56,7 @@ public function testHoliday($year, $expected): void $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. - if (0 === (int)$date->format('w')) { + if (0 === (int) $date->format('w')) { $date->add(new DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/BoxingDayTest.php b/tests/UnitedKingdom/BoxingDayTest.php index 181b0404d..7632b9ac3 100644 --- a/tests/UnitedKingdom/BoxingDayTest.php +++ b/tests/UnitedKingdom/BoxingDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/ChristmasDayTest.php b/tests/UnitedKingdom/ChristmasDayTest.php index 9ec2e039c..1327008aa 100644 --- a/tests/UnitedKingdom/ChristmasDayTest.php +++ b/tests/UnitedKingdom/ChristmasDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/England/BoxingDayTest.php b/tests/UnitedKingdom/England/BoxingDayTest.php index 7290b330c..0bb4e0577 100644 --- a/tests/UnitedKingdom/England/BoxingDayTest.php +++ b/tests/UnitedKingdom/England/BoxingDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/England/ChristmasDayTest.php b/tests/UnitedKingdom/England/ChristmasDayTest.php index 09972d34c..f3ed044d3 100644 --- a/tests/UnitedKingdom/England/ChristmasDayTest.php +++ b/tests/UnitedKingdom/England/ChristmasDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php index 1c47c9c09..de574edb3 100644 --- a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php @@ -50,7 +50,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php index 7312e57fb..e86e3ca4d 100644 --- a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php index c9921a3e7..641ead0f8 100644 --- a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php index 7fb29f2cd..c0bb56dd8 100644 --- a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php @@ -50,7 +50,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/Scotland/BoxingDayTest.php b/tests/UnitedKingdom/Scotland/BoxingDayTest.php index 96b4fac23..ddffac419 100644 --- a/tests/UnitedKingdom/Scotland/BoxingDayTest.php +++ b/tests/UnitedKingdom/Scotland/BoxingDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php index 6e2d3b63e..cf5177982 100644 --- a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php index 3e0543df9..9693b6c73 100644 --- a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php @@ -56,7 +56,7 @@ public function testHolidayOnAfterEstablishment($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php index 61974046f..249348556 100644 --- a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php @@ -56,7 +56,7 @@ public function testHolidayOnAfterEstablishment($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php index 485238170..413407872 100644 --- a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php +++ b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php @@ -50,7 +50,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->modify('next monday'); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } diff --git a/tests/UnitedKingdom/Wales/BoxingDayTest.php b/tests/UnitedKingdom/Wales/BoxingDayTest.php index 2c5fedd22..94ee3b5f2 100644 --- a/tests/UnitedKingdom/Wales/BoxingDayTest.php +++ b/tests/UnitedKingdom/Wales/BoxingDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/UnitedKingdom/Wales/ChristmasDayTest.php b/tests/UnitedKingdom/Wales/ChristmasDayTest.php index 4204a2b5a..7ab7fbb88 100644 --- a/tests/UnitedKingdom/Wales/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Wales/ChristmasDayTest.php @@ -46,7 +46,7 @@ public function testHoliday($year, $expected): void $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); - if (\in_array((int)$date->format('w'), [0, 6], true)) { + if (\in_array((int) $date->format('w'), [0, 6], true)) { $date->add(new DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, Holiday::TYPE_BANK); diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index c4bbf4278..3ecfc9993 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -322,7 +322,7 @@ public function generateRandomDates( $data = []; $range = $range ?? 1000; for ($y = 1; $y <= ($iterations ?? 10); $y++) { - $year = (int)Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); + $year = (int) Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); $data[] = [$year, new DateTime("$year-$month-$day", new DateTimeZone($timezone ?? 'UTC'))]; } @@ -348,7 +348,7 @@ public function generateRandomEasterDates( $range = $range ?? 1000; for ($i = 1; $i <= ($iterations ?? 10); ++$i) { - $year = (int)Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); + $year = (int) Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); $date = $this->calculateEaster($year, $timezone ?? 'UTC'); $data[] = [$year, $date->format('Y-m-d')]; @@ -393,7 +393,7 @@ protected function calculateEaster(int $year, string $timezone): DateTime // 1583 AD to 4099 (A day adjustment is required in or shortly after 4100 AD). // After 1752, most western churches have adopted the current algorithm. if ($year <= 1752) { - $dom = ($year + (int)($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday + $dom = ($year + (int) ($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday if ($dom < 0) { $dom += 7; } @@ -403,13 +403,13 @@ protected function calculateEaster(int $year, string $timezone): DateTime $pfm += 30; } } else { - $dom = ($year + (int)($year / 4) - (int)($year / 100) + (int)($year / 400)) % 7; // The 'Dominical number' - finding a Sunday + $dom = ($year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400)) % 7; // The 'Dominical number' - finding a Sunday if ($dom < 0) { $dom += 7; } - $solar = (int)(($year - 1600) / 100) - (int)(($year - 1600) / 400); // The solar correction - $lunar = (int)(((int)(($year - 1400) / 100) * 8) / 25); // The lunar correction + $solar = (int) (($year - 1600) / 100) - (int) (($year - 1600) / 400); // The solar correction + $lunar = (int) (((int) (($year - 1400) / 100) * 8) / 25); // The lunar correction $pfm = (3 - (11 * $golden) + $solar - $lunar) % 30; // Uncorrected date of the Paschal full moon if ($pfm < 0) { @@ -478,7 +478,7 @@ public function generateRandomModifiedEasterDates( $data = []; $range = $range ?? 1000; for ($i = 1; $i <= ($iterations ?? 10); ++$i) { - $year = (int)Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); + $year = (int) Faker::create()->dateTimeBetween("-$range years", "+$range years")->format('Y'); $date = $this->calculateEaster($year, $timezone ?? 'UTC'); $cb($date); @@ -610,7 +610,7 @@ public function generateRandomYear( int $lowerLimit = null, int $upperLimit = null ): int { - return (int)Faker::create()->numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); + return (int) Faker::create()->numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); } /** @@ -625,6 +625,6 @@ public function isWeekend( DateTimeInterface $dateTime, array $weekendDays = [0, 6] ): bool { - return \in_array((int)$dateTime->format('w'), $weekendDays, true); + return \in_array((int) $dateTime->format('w'), $weekendDays, true); } } From 94cca6b446a1ab1952b5be458436cb6ec02cf5f7 Mon Sep 17 00:00:00 2001 From: Patrick-Root <65601273+Patrick-Root@users.noreply.github.com> Date: Wed, 10 Jun 2020 18:27:20 +0200 Subject: [PATCH 099/115] Feature/new years eve germany (#226) * add german translation * add New Years Eve to Germany.php Set it to other * add test for New Years Eve in Germany * add entry to CHANGELOG.md Co-authored-by: Patrick Kalweit --- CHANGELOG.md | 1 + src/Yasumi/Provider/Germany.php | 1 + src/Yasumi/data/translations/newYearsEve.php | 1 + tests/Germany/NewYearsEveTest.php | 79 ++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 tests/Germany/NewYearsEveTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index dc76ebb99..62d681ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added +- Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) diff --git a/src/Yasumi/Provider/Germany.php b/src/Yasumi/Provider/Germany.php index a96d9bd3d..22e0b2119 100644 --- a/src/Yasumi/Provider/Germany.php +++ b/src/Yasumi/Provider/Germany.php @@ -45,6 +45,7 @@ public function initialize(): void // Add common holidays $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale)); + $this->addHoliday($this->newYearsEve($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER)); // Add common Christian holidays (common in Germany) $this->addHoliday($this->ascensionDay($this->year, $this->timezone, $this->locale)); diff --git a/src/Yasumi/data/translations/newYearsEve.php b/src/Yasumi/data/translations/newYearsEve.php index 20433b385..f50fda9e7 100755 --- a/src/Yasumi/data/translations/newYearsEve.php +++ b/src/Yasumi/data/translations/newYearsEve.php @@ -14,6 +14,7 @@ // Translations for New Year's Eve return [ 'da' => 'nytårsaften', + 'de' => 'Silvester', 'en' => 'New Year’s Eve', 'ko' => '신년전야', 'lv' => 'Vecgada vakars', diff --git a/tests/Germany/NewYearsEveTest.php b/tests/Germany/NewYearsEveTest.php new file mode 100644 index 000000000..02806514e --- /dev/null +++ b/tests/Germany/NewYearsEveTest.php @@ -0,0 +1,79 @@ + + */ + +namespace Yasumi\tests\Germany; + +use DateTime; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class for testing New Years Eve in Germany. + */ +class NewYearsEveTest extends GermanyBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'newYearsEve'; + + /** + * Tests the holiday defined in this test. + * + * @dataProvider HolidayDataProvider + * + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param DateTime $expected the expected date + * + * @throws ReflectionException + */ + public function testHoliday($year, $expected) + { + $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); + } + + /** + * Returns a list of random test dates used for assertion of the holiday defined in this test + * + * @return array list of test dates for the holiday defined in this test + * @throws Exception + */ + public function HolidayDataProvider(): array + { + return $this->generateRandomDates(12, 31, self::TIMEZONE); + } + + /** + * Tests the translated name of the holiday defined in this test. + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Silvester'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); + } +} From 21655eb2b317bb6496b7f557b7e283c69feb118c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Nork=C5=ABnas?= Date: Tue, 16 Jun 2020 18:07:37 +0300 Subject: [PATCH 100/115] Feature/all souls day Lithuania (#227) --- CHANGELOG.md | 1 + src/Yasumi/Provider/Brazil.php | 2 +- src/Yasumi/Provider/Lithuania.php | 24 ++++++ src/Yasumi/data/translations/allSoulsDay.php | 19 +++++ tests/Lithuania/AllSoulsDayTest.php | 87 ++++++++++++++++++++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/Yasumi/data/translations/allSoulsDay.php create mode 100644 tests/Lithuania/AllSoulsDayTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d681ff9..c532cc0d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added +- Added All Souls Day to Lithuania [\#227](https://github.com/azuyalabs/yasumi/pull/227) - Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) diff --git a/src/Yasumi/Provider/Brazil.php b/src/Yasumi/Provider/Brazil.php index 849691df7..cf673bc90 100644 --- a/src/Yasumi/Provider/Brazil.php +++ b/src/Yasumi/Provider/Brazil.php @@ -149,7 +149,7 @@ public function initialize(): void if ($this->year >= 1300) { $this->addHoliday(new Holiday( 'allSoulsDay', - ['pt' => 'Dia de Finados'], + [], new DateTime("$this->year-11-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); diff --git a/src/Yasumi/Provider/Lithuania.php b/src/Yasumi/Provider/Lithuania.php index 5e22074d5..50d9ab11e 100644 --- a/src/Yasumi/Provider/Lithuania.php +++ b/src/Yasumi/Provider/Lithuania.php @@ -45,6 +45,11 @@ class Lithuania extends AbstractProvider */ public const STATEHOOD_YEAR = 1253; + /** + * The year when All Souls Day became a holiday + */ + public const ALL_SOULS_DAY = 2020; + /** * Initialize holidays for Lithuania. * @@ -66,6 +71,7 @@ public function initialize(): void $this->addStatehoodDay(); $this->addHoliday($this->assumptionOfMary($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale)); + $this->addAllSoulsDay(); $this->addHoliday($this->christmasEve($this->year, $this->timezone, $this->locale, Holiday::TYPE_OFFICIAL)); $this->addHoliday($this->christmasDay($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->secondChristmasDay($this->year, $this->timezone, $this->locale)); @@ -119,4 +125,22 @@ private function addStatehoodDay(): void ], new \DateTime("{$this->year}-07-06", new \DateTimeZone($this->timezone)), $this->locale)); } } + + /** + * All Souls Day, also known as the Commemoration of All the Faithful Departed and the Day of the Dead. + * + * @throws \InvalidArgumentException + * @throws \Exception + */ + private function addAllSoulsDay(): void + { + if ($this->year >= self::ALL_SOULS_DAY) { + $this->addHoliday(new Holiday( + 'allSoulsDay', + [], + new \DateTime("$this->year-11-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); + } + } } diff --git a/src/Yasumi/data/translations/allSoulsDay.php b/src/Yasumi/data/translations/allSoulsDay.php new file mode 100644 index 000000000..ea4d511c2 --- /dev/null +++ b/src/Yasumi/data/translations/allSoulsDay.php @@ -0,0 +1,19 @@ + + */ + +// Translations for All Souls' Day +return [ + 'en' => 'All Souls’ Day', + 'lt' => 'Vėlinės', + 'pt' => 'Dia de Finados', +]; diff --git a/tests/Lithuania/AllSoulsDayTest.php b/tests/Lithuania/AllSoulsDayTest.php new file mode 100644 index 000000000..900cec508 --- /dev/null +++ b/tests/Lithuania/AllSoulsDayTest.php @@ -0,0 +1,87 @@ + + */ + +namespace Yasumi\tests\Lithuania; + +use DateTime; +use DateTimeZone; +use Exception; +use ReflectionException; +use Yasumi\Holiday; +use Yasumi\Provider\Lithuania; +use Yasumi\tests\YasumiTestCaseInterface; + +/** + * Class containing tests for All Souls' Day in Lithuania. + * + * @author Tomas Norkūnas + */ +class AllSoulsDayTest extends LithuaniaBaseTestCase implements YasumiTestCaseInterface +{ + /** + * The name of the holiday to be tested + */ + public const HOLIDAY = 'allSoulsDay'; + + /** + * @throws ReflectionException + */ + public function testHolidayBeforeAnnounce(): void + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, Lithuania::ALL_SOULS_DAY - 1) + ); + } + + /** + * Test if holiday is defined after restoration + * @throws Exception + * @throws ReflectionException + */ + public function testHolidayAfterAnnounce(): void + { + $year = $this->generateRandomYear(Lithuania::ALL_SOULS_DAY); + + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new DateTime("{$year}-11-02", new DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * {@inheritdoc} + * @throws ReflectionException + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Vėlinės'] + ); + } + + /** + * {@inheritdoc} + * @throws ReflectionException + */ + public function testHolidayType(): void + { + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + } +} From 829abcd971290a06c97a2c5e93e3bf1091cd713d Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 17 Jun 2020 01:49:35 +0200 Subject: [PATCH 101/115] Rename "short name" to "key" (#221) --- CHANGELOG.md | 2 +- .../Exception/MissingTranslationException.php | 6 +- src/Yasumi/Filters/AbstractFilter.php | 4 +- src/Yasumi/Holiday.php | 38 ++--- src/Yasumi/Provider/AbstractProvider.php | 81 ++++++----- src/Yasumi/Provider/SouthKorea.php | 12 +- src/Yasumi/SubstituteHoliday.php | 10 +- src/Yasumi/Translations.php | 40 +++--- src/Yasumi/TranslationsInterface.php | 8 +- tests/Base/HolidayTest.php | 12 +- tests/Base/SubstituteHolidayTest.php | 2 +- tests/Base/TranslationsTest.php | 136 +++++++++--------- tests/Base/TypographyTest.php | 6 +- tests/Base/YasumiTest.php | 12 +- tests/Japan/JapanBaseTestCase.php | 2 +- tests/Ukraine/SubstitutedHolidayTest.php | 8 +- tests/YasumiBase.php | 42 +++--- 17 files changed, 221 insertions(+), 200 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c532cc0d4..b78399612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216) - Added French translation for Second Christmas Day [\#188](https://github.com/azuyalabs/yasumi/pull/188) ([Arkounay](https://github.com/Arkounay)) -- Added accessor methods Holiday::getShortName() and SubstituteHoliday::getSubstitutedHoliday() [\#220](https://github.com/azuyalabs/yasumi/pull/220) ([c960657](https://github.com/c960657)) +- Added accessor methods Holiday::getKey() and SubstituteHoliday::getSubstitutedHoliday() [\#220](https://github.com/azuyalabs/yasumi/pull/220)+[\#221](https://github.com/azuyalabs/yasumi/pull/221) ([c960657](https://github.com/c960657)) - Added missing return (correct) and parameter types in various methods. ### Changed diff --git a/src/Yasumi/Exception/MissingTranslationException.php b/src/Yasumi/Exception/MissingTranslationException.php index a967d18eb..9710f29e4 100644 --- a/src/Yasumi/Exception/MissingTranslationException.php +++ b/src/Yasumi/Exception/MissingTranslationException.php @@ -22,11 +22,11 @@ class MissingTranslationException extends BaseException implements Exception /** * Initializes the Exception instance * - * @param string $shortName The short name (internal name) of the holiday + * @param string $key The holiday key * @param array $locales The locales that was searched */ - public function __construct(string $shortName, array $locales) + public function __construct(string $key, array $locales) { - parent::__construct(\sprintf("Translation for '%s' not found for any locale: '%s'", $shortName, \implode("', '", $locales))); + parent::__construct(\sprintf("Translation for '%s' not found for any locale: '%s'", $key, \implode("', '", $locales))); } } diff --git a/src/Yasumi/Filters/AbstractFilter.php b/src/Yasumi/Filters/AbstractFilter.php index 6d9979a49..7e8ef08d5 100644 --- a/src/Yasumi/Filters/AbstractFilter.php +++ b/src/Yasumi/Filters/AbstractFilter.php @@ -35,10 +35,10 @@ public function count(): int { $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { - return $holiday->getSubstitutedHoliday()->getShortName(); + return $holiday->getSubstitutedHoliday()->getKey(); } - return $holiday->getShortName(); + return $holiday->getKey(); }, \iterator_to_array($this)); return \count(\array_unique($names)); diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 050eb64d5..5c1cd3b53 100755 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -56,9 +56,9 @@ class Holiday extends DateTime implements JsonSerializable public const DEFAULT_LOCALE = 'en_US'; /** - * Pseudo-locale representing the short name (internal name) of the holiday. + * Pseudo-locale representing the holiday key. */ - public const LOCALE_SHORT_NAME = 'shortName'; + public const LOCALE_KEY = '_key'; /** * @var array list of all defined locales @@ -66,9 +66,9 @@ class Holiday extends DateTime implements JsonSerializable private static $locales = []; /** - * @var string short name (internal name) of this holiday - * @deprecated public access to this property is deprecated in favor of getShortName() - * @see getShortName() + * @var string holiday key + * @deprecated Public access to this property is deprecated in favor of getKey() + * @see getKey() */ public $shortName; @@ -93,7 +93,7 @@ class Holiday extends DateTime implements JsonSerializable * If a holiday date needs to be defined for a specific timezone, make sure that the date instance * (DateTimeInterface) has the correct timezone set. Otherwise the default system timezone is used. * - * @param string $shortName The short name (internal name) of this holiday + * @param string $key Holiday key * @param array $names An array containing the name/description of this holiday in various * languages. Overrides global translations * @param \DateTimeInterface $date A DateTimeInterface instance representing the date of the holiday @@ -109,14 +109,14 @@ class Holiday extends DateTime implements JsonSerializable * @throws \Exception */ public function __construct( - string $shortName, + string $key, array $names, \DateTimeInterface $date, string $displayLocale = self::DEFAULT_LOCALE, string $type = self::TYPE_OFFICIAL ) { - // Validate if short name is not empty - if (empty($shortName)) { + // Validate if key is not empty + if (empty($key)) { throw new InvalidArgumentException('Holiday name can not be blank.'); } @@ -131,7 +131,7 @@ public function __construct( } // Set additional attributes - $this->shortName = $shortName; + $this->shortName = $key; $this->translations = $names; $this->displayLocale = $displayLocale; $this->type = $type; @@ -141,11 +141,11 @@ public function __construct( } /** - * Returns the short name for this holiday. + * Returns the key for this holiday. * - * @return string the short name, e.g. "newYearsDay". + * @return string the key, e.g. "newYearsDay". */ - public function getShortName(): string + public function getKey(): string { return $this->shortName; } @@ -176,7 +176,7 @@ public function jsonSerialize(): self * The provided locales are searched for a translation. The first locale containing a translation will be used. * * If no locale is provided, proceed as if an array containing the display locale, Holiday::DEFAULT_LOCALE ('en_US'), and - * Holiday::LOCALE_SHORT_NAME (the short name (internal name) of this holiday) was provided. + * Holiday::LOCALE_KEY (the holiday key) was provided. * * @param array $locales The locales to search for translations * @@ -184,13 +184,13 @@ public function jsonSerialize(): self * @throws MissingTranslationException * * @see Holiday::DEFAULT_LOCALE - * @see Holiday::LOCALE_SHORT_NAME + * @see Holiday::LOCALE_KEY */ public function getName(array $locales = null): string { $locales = $this->getLocales($locales); foreach ($locales as $locale) { - if ($locale === self::LOCALE_SHORT_NAME) { + if ($locale === self::LOCALE_KEY) { return $this->shortName; } if (isset($this->translations[$locale])) { @@ -208,7 +208,7 @@ public function getName(array $locales = null): string * ['ca_ES_VALENCIA', 'es_ES'] is expanded into ['ca_ES_VALENCIA', 'ca_ES', 'ca', 'es_ES', 'es']. * * If a string is provided, return as if this string, Holiday::DEFAULT_LOCALE, and Holiday::LOCALE_SHORT_NAM - * was provided. E.g. 'de_DE' is expanded into ['de_DE', 'de', 'en_US', 'en', Holiday::LOCALE_SHORT_NAME]. + * was provided. E.g. 'de_DE' is expanded into ['de_DE', 'de', 'en_US', 'en', Holiday::LOCALE_KEY]. * * If null is provided, return as if the display locale was provided as a string. * @@ -217,7 +217,7 @@ public function getName(array $locales = null): string * @return array * * @see Holiday::DEFAULT_LOCALE - * @see Holiday::LOCALE_SHORT_NAME + * @see Holiday::LOCALE_KEY */ protected function getLocales(?array $locales): array { @@ -226,7 +226,7 @@ protected function getLocales(?array $locales): array } else { $locales = [$this->displayLocale]; // DEFAULT_LOCALE is 'en_US', and its parent is 'en'. - $expanded = [self::LOCALE_SHORT_NAME, 'en', 'en_US']; + $expanded = [self::LOCALE_KEY, 'en', 'en_US']; } // Expand e.g. ['de_DE', 'en_GB'] into ['de_DE', 'de', 'en_GB', 'en']. diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index cb5d9bde1..462accda5 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -158,7 +158,7 @@ public function addHoliday(Holiday $holiday): void $holiday->mergeGlobalTranslations($this->globalTranslations); } - $this->holidays[$holiday->getShortName()] = $holiday; + $this->holidays[$holiday->getKey()] = $holiday; \uasort($this->holidays, [__CLASS__, 'compareDates']); } @@ -169,13 +169,13 @@ public function addHoliday(Holiday $holiday): void * This function can be helpful in cases where an existing holiday provider class can be extended but some holidays * are not part of the original (extended) provider. * - * @param string $shortName short name of the holiday + * @param string $key holiday key * * @return void */ - public function removeHoliday(string $shortName): void + public function removeHoliday(string $key): void { - unset($this->holidays[$shortName]); + unset($this->holidays[$key]); } /** @@ -256,53 +256,68 @@ public function isWeekendDay(\DateTimeInterface $date): bool /** * On what date is the given holiday? * - * @param string $shortName short name of the holiday + * @param string $key holiday key * * @return string the date of the requested holiday * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function whenIs(string $shortName): string + public function whenIs(string $key): string { - $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty + $this->isHolidayNameNotEmpty($key); // Validate if key is not empty - return (string) $this->holidays[$shortName]; + return (string) $this->holidays[$key]; } /** - * Checks whether the given holiday (short name) is not empty. + * Checks whether the given holiday is not empty. * - * @param string $shortName the name of the holiday to be checked. + * @param string $key key of the holiday to be checked. * * @return true upon success, otherwise an InvalidArgumentException is thrown * @throws InvalidArgumentException An InvalidArgumentException is thrown if the given holiday parameter is empty. */ - protected function isHolidayNameNotEmpty(string $shortName): bool + protected function isHolidayKeyNotEmpty(string $key): bool { - if (empty($shortName)) { - throw new InvalidArgumentException('Holiday name can not be blank.'); + if (empty($key)) { + throw new InvalidArgumentException('Holiday key can not be blank.'); } return true; } + /** + * Checks whether the given holiday is not empty. + * + * @param string $key key of the holiday to be checked. + * + * @return true upon success, otherwise an InvalidArgumentException is thrown + * @throws InvalidArgumentException An InvalidArgumentException is thrown if the given holiday parameter is empty. + * @deprecated deprecated in favor of isHolidayKeyNotEmpty() + * @deprecated see isHolidayKeyNotEmpty() + */ + protected function isHolidayNameNotEmpty(string $key): bool + { + return $this->isHolidayKeyNotEmpty($key); + } + /** * On what day of the week is the given holiday? * * This function returns the index number for the day of the week on which the given holiday falls. * The index number is an integer starting with 0 being Sunday, 1 = Monday, etc. * - * @param string $shortName short name of the holiday + * @param string $key key of the holiday * * @return int the index of the weekdays of the requested holiday (0 = Sunday, 1 = Monday, etc.) * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function whatWeekDayIs(string $shortName): int + public function whatWeekDayIs(string $key): int { - $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty + $this->isHolidayNameNotEmpty($key); // Validate if key is not empty - return (int) $this->holidays[$shortName]->format('w'); + return (int) $this->holidays[$key]->format('w'); } /** @@ -315,10 +330,10 @@ public function count(): int { $names = \array_map(static function ($holiday) { if ($holiday instanceof SubstituteHoliday) { - return $holiday->getSubstitutedHoliday()->getShortName(); + return $holiday->getSubstitutedHoliday()->getKey(); } - return $holiday->getShortName(); + return $holiday->getKey(); }, $this->getHolidays()); return \count(\array_unique($names)); @@ -357,7 +372,7 @@ public function getYear(): int /** * Retrieves the next date (year) the given holiday is going to take place. * - * @param string $shortName the name of the holiday for which the next occurrence need to be retrieved. + * @param string $key key of the holiday for which the next occurrence need to be retrieved. * * @return Holiday|null a Holiday instance for the given holiday * @@ -368,16 +383,16 @@ public function getYear(): int * * @covers AbstractProvider::anotherTime */ - public function next(string $shortName): ?Holiday + public function next(string $key): ?Holiday { - return $this->anotherTime($this->year + 1, $shortName); + return $this->anotherTime($this->year + 1, $key); } /** * Determines the date of the given holiday for another year. * * @param int $year the year to get the holiday date for - * @param string $shortName the name of the holiday for which the date needs to be fetched + * @param string $key key of the holiday for which the date needs to be fetched * * @return Holiday|null a Holiday instance for the given holiday and year * @@ -386,38 +401,38 @@ public function next(string $shortName): ?Holiday * @throws UnknownLocaleException * @throws \RuntimeException */ - private function anotherTime(int $year, string $shortName): ?Holiday + private function anotherTime(int $year, string $key): ?Holiday { - $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty + $this->isHolidayNameNotEmpty($key); // Validate if key is not empty // Get calling class name $hReflectionClass = new \ReflectionClass(\get_class($this)); - return Yasumi::create($hReflectionClass->getShortName(), $year, $this->locale)->getHoliday($shortName); + return Yasumi::create($hReflectionClass->getShortName(), $year, $this->locale)->getHoliday($key); } /** * Retrieves the holiday object for the given holiday. * - * @param string $shortName the name of the holiday. + * @param string $key the name of the holiday. * * @return Holiday|null a Holiday instance for the given holiday * @throws InvalidArgumentException when the given name is blank or empty. * */ - public function getHoliday(string $shortName): ?Holiday + public function getHoliday(string $key): ?Holiday { - $this->isHolidayNameNotEmpty($shortName); // Validate if short name is not empty + $this->isHolidayNameNotEmpty($key); // Validate if key is not empty $holidays = $this->getHolidays(); - return $holidays[$shortName] ?? null; + return $holidays[$key] ?? null; } /** * Retrieves the previous date (year) the given holiday took place. * - * @param string $shortName the name of the holiday for which the previous occurrence need to be retrieved. + * @param string $key key of the holiday for which the previous occurrence need to be retrieved. * * @return Holiday|null a Holiday instance for the given holiday * @@ -428,9 +443,9 @@ public function getHoliday(string $shortName): ?Holiday * * @covers AbstractProvider::anotherTime */ - public function previous(string $shortName): ?Holiday + public function previous(string $key): ?Holiday { - return $this->anotherTime($this->year - 1, $shortName); + return $this->anotherTime($this->year - 1, $key); } /** diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 1a1d51654..4362f25ba 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -481,25 +481,25 @@ public function calculateSubstituteHolidays(): void ]; // Loop through all holidays - foreach ($holidays as $shortName => $holiday) { + foreach ($holidays as $key => $holiday) { // Get list of holiday dates except this - $holidayDates = \array_map(static function ($holiday) use ($shortName) { - return $holiday->getShortName() === $shortName ? false : (string) $holiday; + $holidayDates = \array_map(static function ($holiday) use ($key) { + return $holiday->getKey() === $key ? false : (string) $holiday; }, $holidays); // Only process accepted holidays and conditions - if (\in_array($shortName, $acceptedHolidays, true) + if (\in_array($key, $acceptedHolidays, true) && ( 0 === (int) $holiday->format('w') || \in_array($holiday, $holidayDates, false) - || (6 === (int) $holiday->format('w') && 'childrensDay' === $shortName) + || (6 === (int) $holiday->format('w') && 'childrensDay' === $key) ) ) { $date = clone $holiday; // Find next week day (not being another holiday) while (0 === (int) $date->format('w') - || (6 === (int) $date->format('w') && 'childrensDay' === $shortName) + || (6 === (int) $date->format('w') && 'childrensDay' === $key) || \in_array($date, $holidayDates, false)) { $date->add(new DateInterval('P1D')); continue; diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index fb7427525..660e2fc20 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -68,14 +68,14 @@ public function __construct( ) { $this->substitutedHoliday = $substitutedHoliday; - $shortName = 'substituteHoliday:' . $substitutedHoliday->getShortName(); + $key = 'substituteHoliday:' . $substitutedHoliday->getKey(); if ($date == $substitutedHoliday) { throw new \InvalidArgumentException('Date must differ from the substituted holiday'); } // Construct instance - parent::__construct($shortName, $names, $date, $displayLocale, $type); + parent::__construct($key, $names, $date, $displayLocale, $type); } /** @@ -94,20 +94,20 @@ public function getSubstitutedHoliday(): Holiday * The provided locales are searched for a translation. The first locale containing a translation will be used. * * If no locale is provided, proceed as if an array containing the display locale, Holiday::DEFAULT_LOCALE ('en_US'), and - * Holiday::LOCALE_SHORT_NAME (the short name (internal name) of this holiday) was provided. + * Holiday::LOCALE_KEY (the holiday key) was provided. * * @param array $locales The locales to search for translations * * @throws MissingTranslationException * * @see Holiday::DEFAULT_LOCALE - * @see Holiday::LOCALE_SHORT_NAME + * @see Holiday::LOCALE_KEY */ public function getName($locales = null): string { $name = parent::getName(); - if ($name === $this->getShortName()) { + if ($name === $this->getKey()) { foreach ($this->getLocales($locales) as $locales) { $pattern = $this->substituteHolidayTranslations[$locales] ?? null; if ($pattern) { diff --git a/src/Yasumi/Translations.php b/src/Yasumi/Translations.php index 47e6aa5ed..998306e43 100644 --- a/src/Yasumi/Translations.php +++ b/src/Yasumi/Translations.php @@ -23,7 +23,7 @@ class Translations implements TranslationsInterface { /** - * @var array translations array: ['' => ['' => 'translation', ...], ... ] + * @var array translations array: ['' => ['' => 'translation', ...], ... ] */ public $translations = []; @@ -69,7 +69,7 @@ public function loadTranslations(string $directoryPath): void } $filename = $file->getFilename(); - $shortName = $file->getBasename('.' . $extension); + $key = $file->getBasename('.' . $extension); $translations = require $directoryPath . $filename; @@ -78,7 +78,7 @@ public function loadTranslations(string $directoryPath): void $this->isValidLocale($locale); // Validate the given locale } - $this->translations[$shortName] = $translations; + $this->translations[$key] = $translations; } } } @@ -105,54 +105,60 @@ protected function isValidLocale(string $locale): bool /** * Adds translation for holiday in specific locale. * - * @param string $shortName holiday short name + * @param string $key holiday key + + * @param string $locale locale * @param string $translation translation * * @throws UnknownLocaleException */ - public function addTranslation(string $shortName, string $locale, string $translation): void + public function addTranslation(string $key, string $locale, string $translation): void { $this->isValidLocale($locale); // Validate the given locale - if (!\array_key_exists($shortName, $this->translations)) { - $this->translations[$shortName] = []; + if (!\array_key_exists($key, $this->translations)) { + $this->translations[$key] = []; } - $this->translations[$shortName][$locale] = $translation; + $this->translations[$key][$locale] = $translation; } /** * Returns translation for holiday in specific locale. * - * @param string $shortName holiday short name + * @param string $key holiday key + + * @param string $locale locale * * @return string|null translated holiday name */ - public function getTranslation(string $shortName, string $locale): ?string + public function getTranslation(string $key, string $locale): ?string { - if (!\array_key_exists($shortName, $this->translations) - || !\array_key_exists($locale, $this->translations[$shortName])) { + if (!\array_key_exists($key, $this->translations) + || !\array_key_exists($locale, $this->translations[$key])) { return null; } - return $this->translations[$shortName][$locale]; + return $this->translations[$key][$locale]; } /** * Returns all available translations for holiday. * - * @param string $shortName holiday short name + * @param string $key holiday key + + * * @return array holiday name translations ['' => '', ...] */ - public function getTranslations(string $shortName): array + public function getTranslations(string $key): array { - if (!\array_key_exists($shortName, $this->translations)) { + if (!\array_key_exists($key, $this->translations)) { return []; } - return $this->translations[$shortName]; + return $this->translations[$key]; } } diff --git a/src/Yasumi/TranslationsInterface.php b/src/Yasumi/TranslationsInterface.php index 250a7cc48..9675efd84 100644 --- a/src/Yasumi/TranslationsInterface.php +++ b/src/Yasumi/TranslationsInterface.php @@ -20,19 +20,19 @@ interface TranslationsInterface /** * Returns translation for holiday in specific locale. * - * @param string $shortName holiday short name + * @param string $key holiday key * @param string $locale locale * * @return string|null translated holiday name */ - public function getTranslation(string $shortName, string $locale): ?string; + public function getTranslation(string $key, string $locale): ?string; /** * Returns all available translations for holiday. * - * @param string $shortName holiday short name + * @param string $key holiday key * * @return array holiday name translations ['' => '', ...] */ - public function getTranslations(string $shortName): array; + public function getTranslations(string $key): array; } diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index c1a4eec75..4e0953488 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -33,11 +33,11 @@ class HolidayTest extends TestCase use YasumiBase; /** - * Tests that an InvalidArgumentException is thrown in case an blank short name is given. + * Tests that an InvalidArgumentException is thrown in case a blank key is given. * * @throws Exception */ - public function testHolidayBlankNameInvalidArgumentException(): void + public function testHolidayBlankKeyInvalidArgumentException(): void { $this->expectException(InvalidArgumentException::class); @@ -99,9 +99,9 @@ public function testHolidayGetLocales(): void $method = new \ReflectionMethod(Holiday::class, 'getLocales'); $method->setAccessible(true); - $this->assertEquals(['ca_ES_VALENCIA', 'ca_ES', 'ca', 'en_US', 'en', Holiday::LOCALE_SHORT_NAME], $method->invoke($holiday, null)); + $this->assertEquals(['ca_ES_VALENCIA', 'ca_ES', 'ca', 'en_US', 'en', Holiday::LOCALE_KEY], $method->invoke($holiday, null)); $this->assertEquals(['de_DE', 'de', 'es_ES', 'es'], $method->invoke($holiday, ['de_DE', 'es_ES'])); - $this->assertEquals(['de_DE', 'de', Holiday::LOCALE_SHORT_NAME], $method->invoke($holiday, ['de_DE', Holiday::LOCALE_SHORT_NAME])); + $this->assertEquals(['de_DE', 'de', Holiday::LOCALE_KEY], $method->invoke($holiday, ['de_DE', Holiday::LOCALE_KEY])); } /** @@ -181,8 +181,8 @@ public function testHolidayGetNameWithArgument(): void $this->assertEquals('Holiday NL', $holiday->getName(['nl'])); $this->assertEquals('Holiday NL', $holiday->getName(['nl_NL'])); $this->assertEquals('Holiday IT-IT', $holiday->getName(['it_IT'])); - $this->assertEquals('Holiday IT-IT', $holiday->getName(['it_IT', Holiday::LOCALE_SHORT_NAME])); - $this->assertEquals('testHoliday', $holiday->getName([Holiday::LOCALE_SHORT_NAME])); + $this->assertEquals('Holiday IT-IT', $holiday->getName(['it_IT', Holiday::LOCALE_KEY])); + $this->assertEquals('testHoliday', $holiday->getName([Holiday::LOCALE_KEY])); $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); $this->assertEquals('Holiday EN-US', $holiday->getName()); diff --git a/tests/Base/SubstituteHolidayTest.php b/tests/Base/SubstituteHolidayTest.php index cd1003503..3cb7922bb 100644 --- a/tests/Base/SubstituteHolidayTest.php +++ b/tests/Base/SubstituteHolidayTest.php @@ -68,7 +68,7 @@ public function testConstructor(): void $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US', Holiday::TYPE_SEASON); $this->assertSame($holiday, $substitute->getSubstitutedHoliday()); - $this->assertEquals('substituteHoliday:testHoliday', $substitute->getShortName()); + $this->assertEquals('substituteHoliday:testHoliday', $substitute->getKey()); $this->assertEquals(Holiday::TYPE_SEASON, $substitute->getType()); $this->assertEquals(new DateTime('2019-01-02'), $substitute); } diff --git a/tests/Base/TranslationsTest.php b/tests/Base/TranslationsTest.php index 22715ce14..71f679230 100644 --- a/tests/Base/TranslationsTest.php +++ b/tests/Base/TranslationsTest.php @@ -39,21 +39,21 @@ public function testAddTranslation(): void $translations = new Translations(self::LOCALES); $locale = 'en_US'; - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $translation = 'New Year’s Day'; - $this->assertNull($translations->getTranslation($shortName, $locale)); - $this->assertEmpty($translations->getTranslations($shortName)); + $this->assertNull($translations->getTranslation($key, $locale)); + $this->assertEmpty($translations->getTranslations($key)); - $translations->addTranslation($shortName, $locale, $translation); + $translations->addTranslation($key, $locale, $translation); - $this->assertNotNull($translations->getTranslations($shortName)); - $this->assertNotEmpty($translations->getTranslations($shortName)); - $this->assertEquals([$locale => $translation], $translations->getTranslations($shortName)); + $this->assertNotNull($translations->getTranslations($key)); + $this->assertNotEmpty($translations->getTranslations($key)); + $this->assertEquals([$locale => $translation], $translations->getTranslations($key)); - $this->assertNotNull($translations->getTranslation($shortName, $locale)); - $this->assertIsString($translations->getTranslation($shortName, $locale)); - $this->assertEquals($translation, $translations->getTranslation($shortName, $locale)); + $this->assertNotNull($translations->getTranslation($key, $locale)); + $this->assertIsString($translations->getTranslation($key, $locale)); + $this->assertEquals($translation, $translations->getTranslation($key, $locale)); } /** @@ -64,49 +64,49 @@ public function testAddMultipleTranslations(): void $translations = new Translations(self::LOCALES); $firstLocale = 'en_US'; - $firstShortName = 'newYearsDay'; + $firstIdentifier = 'newYearsDay'; $firstTranslation = 'New Year’s Day'; - $translations->addTranslation($firstShortName, $firstLocale, $firstTranslation); + $translations->addTranslation($firstIdentifier, $firstLocale, $firstTranslation); - $this->assertNotNull($translations->getTranslations($firstShortName)); - $this->assertNotEmpty($translations->getTranslations($firstShortName)); - $this->assertEquals([$firstLocale => $firstTranslation], $translations->getTranslations($firstShortName)); + $this->assertNotNull($translations->getTranslations($firstIdentifier)); + $this->assertNotEmpty($translations->getTranslations($firstIdentifier)); + $this->assertEquals([$firstLocale => $firstTranslation], $translations->getTranslations($firstIdentifier)); - $this->assertNotNull($translations->getTranslation($firstShortName, $firstLocale)); - $this->assertIsString($translations->getTranslation($firstShortName, $firstLocale)); - $this->assertEquals($firstTranslation, $translations->getTranslation($firstShortName, $firstLocale)); + $this->assertNotNull($translations->getTranslation($firstIdentifier, $firstLocale)); + $this->assertIsString($translations->getTranslation($firstIdentifier, $firstLocale)); + $this->assertEquals($firstTranslation, $translations->getTranslation($firstIdentifier, $firstLocale)); $secondLocale = 'nl_NL'; - $secondShortName = 'easter'; + $secondIdentifier = 'easter'; $secondTranslation = 'Eerste paasdag'; - $translations->addTranslation($secondShortName, $secondLocale, $secondTranslation); + $translations->addTranslation($secondIdentifier, $secondLocale, $secondTranslation); - $this->assertNotNull($translations->getTranslations($secondShortName)); - $this->assertNotEmpty($translations->getTranslations($secondShortName)); - $this->assertEquals([$secondLocale => $secondTranslation], $translations->getTranslations($secondShortName)); + $this->assertNotNull($translations->getTranslations($secondIdentifier)); + $this->assertNotEmpty($translations->getTranslations($secondIdentifier)); + $this->assertEquals([$secondLocale => $secondTranslation], $translations->getTranslations($secondIdentifier)); - $this->assertNotNull($translations->getTranslation($secondShortName, $secondLocale)); - $this->assertIsString($translations->getTranslation($secondShortName, $secondLocale)); - $this->assertEquals($secondTranslation, $translations->getTranslation($secondShortName, $secondLocale)); + $this->assertNotNull($translations->getTranslation($secondIdentifier, $secondLocale)); + $this->assertIsString($translations->getTranslation($secondIdentifier, $secondLocale)); + $this->assertEquals($secondTranslation, $translations->getTranslation($secondIdentifier, $secondLocale)); $thirdLocale = 'en_US'; - $thirdShortName = 'easter'; + $thirdIdentifier = 'easter'; $thirdTranslation = 'Easter Sunday'; - $translations->addTranslation($thirdShortName, $thirdLocale, $thirdTranslation); + $translations->addTranslation($thirdIdentifier, $thirdLocale, $thirdTranslation); - $this->assertNotNull($translations->getTranslations($thirdShortName)); - $this->assertNotEmpty($translations->getTranslations($thirdShortName)); + $this->assertNotNull($translations->getTranslations($thirdIdentifier)); + $this->assertNotEmpty($translations->getTranslations($thirdIdentifier)); $this->assertEquals( [$thirdLocale => $thirdTranslation, $secondLocale => $secondTranslation], - $translations->getTranslations($thirdShortName) + $translations->getTranslations($thirdIdentifier) ); - $this->assertNotNull($translations->getTranslation($thirdShortName, $thirdLocale)); - $this->assertIsString($translations->getTranslation($thirdShortName, $thirdLocale)); - $this->assertEquals($thirdTranslation, $translations->getTranslation($thirdShortName, $thirdLocale)); + $this->assertNotNull($translations->getTranslation($thirdIdentifier, $thirdLocale)); + $this->assertIsString($translations->getTranslation($thirdIdentifier, $thirdLocale)); + $this->assertEquals($thirdTranslation, $translations->getTranslation($thirdIdentifier, $thirdLocale)); } /** @@ -120,10 +120,10 @@ public function testAddTranslationUnknownLocaleException(): void $translations = new Translations(self::LOCALES); $unknownLocale = 'en_XY'; - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $translation = 'New Year’s Day'; - $translations->addTranslation($shortName, $unknownLocale, $translation); + $translations->addTranslation($key, $unknownLocale, $translation); } /** @@ -134,15 +134,15 @@ public function testNoTranslationForUnknownHoliday(): void $translations = new Translations(self::LOCALES); $locale = 'en_US'; - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $translation = 'New Year’s Day'; - $unknownShortName = 'unknownHoliday'; + $unknownIdentifier = 'unknownHoliday'; - $translations->addTranslation($shortName, $locale, $translation); + $translations->addTranslation($key, $locale, $translation); - $this->assertNull($translations->getTranslation($unknownShortName, $locale)); - $this->assertEmpty($translations->getTranslations($unknownShortName)); + $this->assertNull($translations->getTranslation($unknownIdentifier, $locale)); + $this->assertEmpty($translations->getTranslations($unknownIdentifier)); } /** @@ -153,14 +153,14 @@ public function testNoTranslationForNotTranslatedLocale(): void $translations = new Translations(self::LOCALES); $locale = 'en_US'; - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $translation = 'New Year’s Day'; $unknownLocale = 'pl_PL'; - $translations->addTranslation($shortName, $locale, $translation); + $translations->addTranslation($key, $locale, $translation); - $this->assertNull($translations->getTranslation($shortName, $unknownLocale)); + $this->assertNull($translations->getTranslation($key, $unknownLocale)); } /** @@ -168,7 +168,7 @@ public function testNoTranslationForNotTranslatedLocale(): void */ public function testLoadingTranslationsFromDirectory(): void { - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $fileContents = <<<'FILE' [$shortName . '.php' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.php' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); @@ -186,10 +186,10 @@ public function testLoadingTranslationsFromDirectory(): void $locale = 'en_US'; $translation = 'New Year’s Day'; - $this->assertNotNull($translations->getTranslations($shortName)); - $this->assertNotEmpty($translations->getTranslations($shortName)); - $this->assertIsString($translations->getTranslation($shortName, $locale)); - $this->assertEquals($translation, $translations->getTranslation($shortName, $locale)); + $this->assertNotNull($translations->getTranslations($key)); + $this->assertNotEmpty($translations->getTranslations($key)); + $this->assertIsString($translations->getTranslation($key, $locale)); + $this->assertEquals($translation, $translations->getTranslation($key, $locale)); } /** @@ -197,7 +197,7 @@ public function testLoadingTranslationsFromDirectory(): void */ public function testNotLoadingTranslationsFromFileWithInvalidExtension(): void { - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $fileContents = <<<'FILE' [$shortName . '.translation' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.translation' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); - $this->assertNotNull($translations->getTranslations($shortName)); - $this->assertEmpty($translations->getTranslations($shortName)); + $this->assertNotNull($translations->getTranslations($key)); + $this->assertEmpty($translations->getTranslations($key)); } /** @@ -224,7 +224,7 @@ public function testLoadingTranslationsFromDirectoryWithUnknownLocaleException() { $this->expectException(UnknownLocaleException::class); - $shortName = 'newYearsDay'; + $key = 'newYearsDay'; $fileContents = <<<'FILE' [$shortName . '.php' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.php' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); @@ -258,7 +258,7 @@ public function testLoadingTranslationsFromInexistentDirectory(): void */ public function testLoadingMultipleTranslationsFromDirectory(): void { - $firstShortName = 'newYearsDay'; + $firstIdentifier = 'newYearsDay'; $firstFileContents = <<<'FILE' [ - $firstShortName . '.php' => $firstFileContents, - $secondShortName . '.php' => $secondFileContents, + $firstIdentifier . '.php' => $firstFileContents, + $secondIdentifier . '.php' => $secondFileContents, ], ]); @@ -291,17 +291,17 @@ public function testLoadingMultipleTranslationsFromDirectory(): void $locale = 'en_US'; $translation = 'New Year’s Day'; - $this->assertNotNull($translations->getTranslations($firstShortName)); - $this->assertNotEmpty($translations->getTranslations($firstShortName)); - $this->assertIsString($translations->getTranslation($firstShortName, $locale)); - $this->assertEquals($translation, $translations->getTranslation($firstShortName, $locale)); + $this->assertNotNull($translations->getTranslations($firstIdentifier)); + $this->assertNotEmpty($translations->getTranslations($firstIdentifier)); + $this->assertIsString($translations->getTranslation($firstIdentifier, $locale)); + $this->assertEquals($translation, $translations->getTranslation($firstIdentifier, $locale)); $locale = 'nl_NL'; $translation = 'Eerste Paasdag'; - $this->assertNotNull($translations->getTranslations($secondShortName)); - $this->assertNotEmpty($translations->getTranslations($secondShortName)); - $this->assertIsString($translations->getTranslation($secondShortName, $locale)); - $this->assertEquals($translation, $translations->getTranslation($secondShortName, $locale)); + $this->assertNotNull($translations->getTranslations($secondIdentifier)); + $this->assertNotEmpty($translations->getTranslations($secondIdentifier)); + $this->assertIsString($translations->getTranslation($secondIdentifier, $locale)); + $this->assertEquals($translation, $translations->getTranslation($secondIdentifier, $locale)); } } diff --git a/tests/Base/TypographyTest.php b/tests/Base/TypographyTest.php index 6472363f9..223901661 100644 --- a/tests/Base/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -35,10 +35,10 @@ class TypographyTest extends TestCase * * @param string $name The localized holiday name * @param string $class The provider - * @param string $shortName The short name (internal name) of the holiday + * @param string $key The holiday key * @param string $locale The locale */ - public function testTranslations($name, $class, $shortName, $locale): void + public function testTranslations($name, $class, $key, $locale): void { $this->assertStringNotContainsString("'", $name, 'Translation contains typewriter apostrophe'); $this->assertStringNotContainsString('"', $name, 'Translation contains typewriter quote'); @@ -59,7 +59,7 @@ public function translationProvider(): array foreach ($provider->getHolidays() as $holiday) { foreach ($holiday->translations as $locale => $name) { - $tests[$name] = [$name, $class, $holiday->getShortName(), $locale]; + $tests[$name] = [$name, $class, $holiday->getKey(), $locale]; } } } diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index 68225d0a0..07a340132 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -185,7 +185,7 @@ public function testNext(): void * * @throws ReflectionException */ - public function testNextWithBlankName(): void + public function testNextWithBlankKey(): void { $this->expectException(InvalidArgumentException::class); @@ -223,7 +223,7 @@ public function testPrevious(): void * * @throws ReflectionException */ - public function testPreviousWithBlankName(): void + public function testPreviousWithBlankKey(): void { $this->expectException(InvalidArgumentException::class); @@ -263,11 +263,11 @@ public function testWhenIs(): void } /** - * Tests that the WhenIs function throws an InvalidArgumentException when a blank name is given. + * Tests that the WhenIs function throws an InvalidArgumentException when a blank key is given. * * @throws ReflectionException */ - public function testWhenIsWithBlankName(): void + public function testWhenIsWithBlankKey(): void { $this->expectException(InvalidArgumentException::class); @@ -280,7 +280,7 @@ public function testWhenIsWithBlankName(): void * * @throws ReflectionException */ - public function testGetHolidayWithBlankName(): void + public function testGetHolidayWithBlankKey(): void { $this->expectException(InvalidArgumentException::class); @@ -307,7 +307,7 @@ public function testWhatWeekDayIs(): void * * @throws ReflectionException */ - public function testWhatWeekDayIsWithBlankName(): void + public function testWhatWeekDayIsWithBlankKey(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Japan/JapanBaseTestCase.php b/tests/Japan/JapanBaseTestCase.php index d3049aacf..0b444c771 100644 --- a/tests/Japan/JapanBaseTestCase.php +++ b/tests/Japan/JapanBaseTestCase.php @@ -33,7 +33,7 @@ abstract class JapanBaseTestCase extends TestCase public const TIMEZONE = 'Asia/Tokyo'; /** - * Prefix for short name used when holiday is substituted + * Prefix for holiday key used when holiday is substituted */ public const SUBSTITUTE_PREFIX = 'substituteHoliday:'; diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index 5fa7c5f94..768b7c70a 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -59,7 +59,7 @@ public function testSaturdaySubstitution(): void * Asserts that the expected date is indeed a holiday for that given year and name * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName string the short name of the holiday to be checked against + * @param string $key string the key of the holiday to be checked against * @param int $year holiday calendar year * @param DateTime $expectedOfficial the official date to be checked against * @param DateTime $expectedSubstitution the substituted date to be checked against @@ -73,21 +73,21 @@ public function testSaturdaySubstitution(): void */ public function assertHolidayWithSubstitution( string $provider, - string $shortName, + string $key, int $year, DateTime $expectedOfficial, DateTime $expectedSubstitution = null ): void { $holidays = Yasumi::create($provider, $year); - $holidayOfficial = $holidays->getHoliday($shortName); + $holidayOfficial = $holidays->getHoliday($key); $this->assertInstanceOf(Holiday::class, $holidayOfficial); $this->assertNotNull($holidayOfficial); $this->assertEquals($expectedOfficial, $holidayOfficial); $this->assertTrue($holidays->isHoliday($holidayOfficial)); $this->assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); - $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->getShortName()); + $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->getKey()); if ($expectedSubstitution === null) { // without substitution $this->assertNull($holidaySubstitution); diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index 3ecfc9993..65f5ad634 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -91,7 +91,7 @@ public function assertDefinedHolidays( * Asserts that the expected date is indeed a holiday for that given year and name * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName string the short name of the holiday to be checked against + * @param string $key string the key of the holiday to be checked against * @param int $year holiday calendar year * @param DateTime $expected the date to be checked against * @@ -104,12 +104,12 @@ public function assertDefinedHolidays( */ public function assertHoliday( string $provider, - string $shortName, + string $key, int $year, DateTime $expected ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); + $holiday = $holidays->getHoliday($key); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertEquals($expected, $holiday); @@ -120,7 +120,7 @@ public function assertHoliday( * Asserts that the expected date is indeed a substitute holiday for that given year and name * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName string the short name of the substituted holiday to be checked against + * @param string $key string the key of the substituted holiday to be checked against * @param int $year holiday calendar year * @param DateTime $expected the date to be checked against * @@ -133,12 +133,12 @@ public function assertHoliday( */ public function assertSubstituteHoliday( string $provider, - string $shortName, + string $key, int $year, DateTime $expected ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday('substituteHoliday:' . $shortName); + $holiday = $holidays->getHoliday('substituteHoliday:' . $key); $this->assertInstanceOf(SubstituteHoliday::class, $holiday); $this->assertEquals($expected, $holiday); @@ -149,7 +149,7 @@ public function assertSubstituteHoliday( * Asserts that the given substitute holiday for that given year does not exist. * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName the short name of the substituted holiday to be checked against + * @param string $key the key of the substituted holiday to be checked against * @param int $year holiday calendar year * * @throws InvalidArgumentException @@ -161,12 +161,12 @@ public function assertSubstituteHoliday( */ public function assertNotSubstituteHoliday( string $provider, - string $shortName, + string $key, int $year ): void { $this->assertNotHoliday( $provider, - 'substituteHoliday:' . $shortName, + 'substituteHoliday:' . $key, $year ); } @@ -175,7 +175,7 @@ public function assertNotSubstituteHoliday( * Asserts that the given holiday for that given year does not exist. * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName the short name of the holiday to be checked against + * @param string $key the key of the holiday to be checked against * @param int $year holiday calendar year * * @throws InvalidArgumentException @@ -187,11 +187,11 @@ public function assertNotSubstituteHoliday( */ public function assertNotHoliday( string $provider, - string $shortName, + string $key, int $year ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); + $holiday = $holidays->getHoliday($key); $this->assertNull($holiday); } @@ -200,7 +200,7 @@ public function assertNotHoliday( * Asserts that the expected name is indeed provided as a translated holiday name for that given year and name * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $shortName string the short name of the holiday to be checked against + * @param string $key string the key of the holiday to be checked against * @param int $year holiday calendar year * @param array $translations the translations to be checked against * @@ -212,12 +212,12 @@ public function assertNotHoliday( */ public function assertTranslatedHolidayName( string $provider, - string $shortName, + string $key, int $year, array $translations ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); + $holiday = $holidays->getHoliday($key); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertTrue($holidays->isHoliday($holiday)); @@ -248,7 +248,7 @@ public function assertTranslatedHolidayName( * Asserts that the expected type is indeed the associated type of the given holiday * * @param string $provider the holiday provider (i.e. country/region) for which the holiday need to be tested - * @param string $shortName string the short name of the holiday to be checked against + * @param string $key string the key of the holiday to be checked against * @param int $year holiday calendar year * @param string $type the type to be checked against * @@ -260,12 +260,12 @@ public function assertTranslatedHolidayName( */ public function assertHolidayType( string $provider, - string $shortName, + string $key, int $year, string $type ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); + $holiday = $holidays->getHoliday($key); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertEquals($type, $holiday->getType()); @@ -276,7 +276,7 @@ public function assertHolidayType( * * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be * tested - * @param string $shortName string the short name of the holiday to be checked against + * @param string $key string the key of the holiday to be checked against * @param int $year holiday calendar year * @param string $expectedDayOfWeek the expected week day (i.e. "Saturday", "Sunday", etc.) * @@ -288,12 +288,12 @@ public function assertHolidayType( */ public function assertDayOfWeek( string $provider, - string $shortName, + string $key, int $year, string $expectedDayOfWeek ): void { $holidays = Yasumi::create($provider, $year); - $holiday = $holidays->getHoliday($shortName); + $holiday = $holidays->getHoliday($key); $this->assertInstanceOf(Holiday::class, $holiday); $this->assertTrue($holidays->isHoliday($holiday)); From 5fe86cd4f97ee7175eef6a77f61fc5b3d06c7a99 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:43:39 +0900 Subject: [PATCH 102/115] Make method compatible with its super. Signed-off-by: Sacha Telgenhof --- src/Yasumi/SubstituteHoliday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index 660e2fc20..f7abfc1a1 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -103,7 +103,7 @@ public function getSubstitutedHoliday(): Holiday * @see Holiday::DEFAULT_LOCALE * @see Holiday::LOCALE_KEY */ - public function getName($locales = null): string + public function getName(array $locales = null): string { $name = parent::getName(); From 6f34594fa3744b4907e3fa056a0f714e40843685 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:44:58 +0900 Subject: [PATCH 103/115] Added missing return tag. Signed-off-by: Sacha Telgenhof --- src/Yasumi/SubstituteHoliday.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index f7abfc1a1..9646086f2 100755 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -98,6 +98,7 @@ public function getSubstitutedHoliday(): Holiday * * @param array $locales The locales to search for translations * + * @return string * @throws MissingTranslationException * * @see Holiday::DEFAULT_LOCALE From 90c92e1ba9cfaf1bec5229c2c10b67bea24935c6 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:47:39 +0900 Subject: [PATCH 104/115] Removed unnecessary method (is same as the parent). Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Canada/Nunavut.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/Yasumi/Provider/Canada/Nunavut.php b/src/Yasumi/Provider/Canada/Nunavut.php index 9c5177774..2163e4fb4 100644 --- a/src/Yasumi/Provider/Canada/Nunavut.php +++ b/src/Yasumi/Provider/Canada/Nunavut.php @@ -52,27 +52,4 @@ public function initialize(): void $this->calculateVictoriaDay(); } - /** - * Civic Holiday. - * - * @link https://en.wikipedia.org/wiki/Civic_Holiday - * - * @throws InvalidDateException - * @throws \InvalidArgumentException - * @throws UnknownLocaleException - * @throws \Exception - */ - protected function calculateCivicHoliday(): void - { - if ($this->year < 1879) { - return; - } - - $this->addHoliday(new Holiday( - 'civicHoliday', - [], - new DateTime("first monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale - )); - } } From 8d06d92086b8a11ebe77d17645e48d8eba0136b6 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:48:12 +0900 Subject: [PATCH 105/115] CS Fixes. Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Canada/Nunavut.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Yasumi/Provider/Canada/Nunavut.php b/src/Yasumi/Provider/Canada/Nunavut.php index 2163e4fb4..2ee1c70b4 100644 --- a/src/Yasumi/Provider/Canada/Nunavut.php +++ b/src/Yasumi/Provider/Canada/Nunavut.php @@ -12,12 +12,10 @@ namespace Yasumi\Provider\Canada; -use DateTime; use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; -use Yasumi\Provider\DateTimeZoneFactory; /** * Provider for all holidays in Nunavut (Canada). @@ -51,5 +49,4 @@ public function initialize(): void $this->calculateCivicHoliday(); $this->calculateVictoriaDay(); } - } From 55e220651b0127ce6dde453897acdda344fbb7cc Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:51:22 +0900 Subject: [PATCH 106/115] Fixed the test to ensure the type isn't tested before the establishment year. Signed-off-by: Sacha Telgenhof --- tests/Lithuania/AllSoulsDayTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Lithuania/AllSoulsDayTest.php b/tests/Lithuania/AllSoulsDayTest.php index 900cec508..548ff74a2 100644 --- a/tests/Lithuania/AllSoulsDayTest.php +++ b/tests/Lithuania/AllSoulsDayTest.php @@ -82,6 +82,6 @@ public function testTranslation(): void */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(Lithuania::ALL_SOULS_DAY), Holiday::TYPE_OFFICIAL); } } From 7c2839eb4af9d126569b42371269cde6e07c4329 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:54:10 +0900 Subject: [PATCH 107/115] Fixed the test to ensure National Patriots Day isn't tested before the establishment year. Signed-off-by: Sacha Telgenhof --- tests/Canada/Quebec/QuebecTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Canada/Quebec/QuebecTest.php b/tests/Canada/Quebec/QuebecTest.php index f97f3d1f0..6a616485d 100644 --- a/tests/Canada/Quebec/QuebecTest.php +++ b/tests/Canada/Quebec/QuebecTest.php @@ -31,12 +31,17 @@ class QuebecTest extends QuebecBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'saintJeanBaptisteDay', - 'nationalPatriotsDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if ($this->year >= 2003) { + $holidays[] = 'nationalPatriotsDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** From b950aab0c44f40397b6669911ed1054c6d7971da Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 20:58:36 +0900 Subject: [PATCH 108/115] Fixed the test to ensure the translation isn't tested before the establishment year. Signed-off-by: Sacha Telgenhof --- tests/Lithuania/AllSoulsDayTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Lithuania/AllSoulsDayTest.php b/tests/Lithuania/AllSoulsDayTest.php index 548ff74a2..c4bd08e86 100644 --- a/tests/Lithuania/AllSoulsDayTest.php +++ b/tests/Lithuania/AllSoulsDayTest.php @@ -71,7 +71,7 @@ public function testTranslation(): void $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(), + $this->generateRandomYear(Lithuania::ALL_SOULS_DAY), [self::LOCALE => 'Vėlinės'] ); } @@ -82,6 +82,11 @@ public function testTranslation(): void */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(Lithuania::ALL_SOULS_DAY), Holiday::TYPE_OFFICIAL); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(Lithuania::ALL_SOULS_DAY), + Holiday::TYPE_OFFICIAL + ); } } From d867c554fc4d37bc018f44361128f134b5c8de43 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 21:01:52 +0900 Subject: [PATCH 109/115] Fixed the test to ensure Yukon Heritage Day isn't tested before the establishment year. Signed-off-by: Sacha Telgenhof --- tests/Canada/Yukon/YukonTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Canada/Yukon/YukonTest.php b/tests/Canada/Yukon/YukonTest.php index c4bd2040e..86649146c 100644 --- a/tests/Canada/Yukon/YukonTest.php +++ b/tests/Canada/Yukon/YukonTest.php @@ -31,14 +31,19 @@ class YukonTest extends YukonBaseTestCase */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'goodFriday', 'christmasDay', 'discoveryDay', 'victoriaDay', - 'yukonHeritageDay', 'nationalIndigenousPeoplesDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if (2009 < $this->year) { + $holidays[] = 'yukonHeritageDay'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** From c52d5d6d4594fae0c3acbfe16a4dfb77f8636871 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 21:07:33 +0900 Subject: [PATCH 110/115] Added missing return type. Signed-off-by: Sacha Telgenhof --- tests/Germany/NewYearsEveTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Germany/NewYearsEveTest.php b/tests/Germany/NewYearsEveTest.php index 02806514e..27e12ce92 100644 --- a/tests/Germany/NewYearsEveTest.php +++ b/tests/Germany/NewYearsEveTest.php @@ -38,7 +38,7 @@ class NewYearsEveTest extends GermanyBaseTestCase implements YasumiTestCaseInter * * @throws ReflectionException */ - public function testHoliday($year, $expected) + public function testHoliday($year, $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } From 911fb1cfa34cc604564cfa12a416f37086fe0948 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Wed, 17 Jun 2020 22:27:00 +0900 Subject: [PATCH 111/115] Grouped some related changes. Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b78399612..e58fab8bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] ### Added -- Added All Souls Day to Lithuania [\#227](https://github.com/azuyalabs/yasumi/pull/227) -- Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) -- Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) +- Added All Souls Day to Lithuania [\#227](https://github.com/azuyalabs/yasumi/pull/227) +- Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) +- Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) - Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216) From 5159e096eaa3982f662a2f1e40f0f35e2f260c08 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 22 Jun 2020 21:16:21 +0900 Subject: [PATCH 112/115] Added contributor Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e58fab8bf..11b76b1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) - Holiday providers for states of Austria. [\#182](https://github.com/azuyalabs/yasumi/pull/182) ([aprog](https://github.com/aprog)) -- Added All Souls Day to Lithuania [\#227](https://github.com/azuyalabs/yasumi/pull/227) +- Added All Souls Day to Lithuania [\#227](https://github.com/azuyalabs/yasumi/pull/227) ([norkunas](https://github.com/norkunas)) - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) From 15a9fc929ad474fa07609dc41f6970d05e92ab8e Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 22 Jun 2020 21:27:52 +0900 Subject: [PATCH 113/115] Fixed the test to ensure Discovery Day, Victoria Day and National Indigenous Peoples Day aren't tested before their establishment year. Signed-off-by: Sacha Telgenhof --- tests/Canada/Yukon/YukonTest.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Canada/Yukon/YukonTest.php b/tests/Canada/Yukon/YukonTest.php index 86649146c..38087b833 100644 --- a/tests/Canada/Yukon/YukonTest.php +++ b/tests/Canada/Yukon/YukonTest.php @@ -34,15 +34,24 @@ public function testOfficialHolidays(): void $holidays = [ 'goodFriday', 'christmasDay', - 'discoveryDay', - 'victoriaDay', - 'nationalIndigenousPeoplesDay', ]; if (2009 < $this->year) { $holidays[] = 'yukonHeritageDay'; } + if (1996 >= $this->year) { + $holidays[] = 'nationalIndigenousPeoplesDay'; + } + + if (1897 >= $this->year) { + $holidays[] = 'discoveryDay'; + } + + if (1845 >= $this->year) { + $holidays[] = 'victoriaDay'; + } + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } From c65129447db7d4affb6c07d3b15aa99bf063fccb Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 22 Jun 2020 21:39:47 +0900 Subject: [PATCH 114/115] Added test suites for Canada and Luxembourg Signed-off-by: Sacha Telgenhof --- phpunit.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index aa3aca34c..32b98f5f3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -58,6 +58,11 @@ ./tests/Brazil + + + ./tests/Canada + + ./tests/Croatia @@ -128,6 +133,11 @@ ./tests/Lithuania + + + ./tests/Luxembourg + + ./tests/Netherlands From ca6bf0b022f8bbc120dd7d728c9db8f1446afe6c Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 22 Jun 2020 21:42:40 +0900 Subject: [PATCH 115/115] Updated Changelog: 2.3.0 Release Signed-off-by: Sacha Telgenhof --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b76b1ef..81669631d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ## [Unreleased] +### Added + +### Changed + +### Fixed + +### Deprecated + +### Removed + + +## [2.3.0] - 2020-06-22 + ### Added - Added Canada Provider [\#215](https://github.com/azuyalabs/yasumi/pull/215) ([lux](https://github.com/lux)) - Added Luxembourg Provider [\#205](https://github.com/azuyalabs/yasumi/pull/205) ([Arkounay](https://github.com/Arkounay)) @@ -13,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this - Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. [\#202](https://github.com/azuyalabs/yasumi/pull/202) - Additional Dates for Australia/Victoria:AFL Grand Final Friday [\#190](https://github.com/azuyalabs/yasumi/pull/190) ([brucealdridge](https://github.com/brucealdridge)) - Substituted holidays (holidays that fall in the weekend) for Australia. [\#201](https://github.com/azuyalabs/yasumi/pull/201) ([c960657](https://github.com/c960657)) -- Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) +- Added New Years Eve to Germany [\#226](https://github.com/azuyalabs/yasumi/pull/226) ([Patrick-Root](https://github.com/Patrick-Root)) - Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany). - Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon [\#189](https://github.com/azuyalabs/yasumi/pull/189) ([c960657](https://github.com/c960657)) - Added American English spelling for Labour Day [\#216](https://github.com/azuyalabs/yasumi/issues/216)