From 3effd05b818b6d3ccd8657de809f8a32e7f45c7d Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Mon, 21 Oct 2024 22:30:42 +0900 Subject: [PATCH] style: fix code styling issues Signed-off-by: Sacha Telgenhof --- src/Yasumi/Filters/BetweenFilter.php | 2 +- src/Yasumi/Filters/OnFilter.php | 2 +- src/Yasumi/Holiday.php | 2 +- src/Yasumi/Provider/AbstractProvider.php | 4 +- .../Australia/AustralianCapitalTerritory.php | 4 +- .../Provider/Australia/NewSouthWales.php | 2 +- .../Provider/Australia/NorthernTerritory.php | 2 +- .../Provider/Australia/SouthAustralia.php | 2 +- src/Yasumi/Provider/Australia/Victoria.php | 4 +- src/Yasumi/Provider/Canada/Quebec.php | 2 +- src/Yasumi/Provider/ChristianHolidays.php | 44 +++++++++---------- src/Yasumi/Provider/CommonHolidays.php | 28 ++++++------ src/Yasumi/Provider/Germany/Berlin.php | 2 +- src/Yasumi/Provider/SouthKorea.php | 38 ++++++++-------- src/Yasumi/ProviderInterface.php | 2 +- src/Yasumi/SubstituteHoliday.php | 2 +- src/Yasumi/Yasumi.php | 6 +-- tests/Randomizer.php | 20 ++++----- tests/Ukraine/SubstitutedHolidayTest.php | 2 +- tests/YasumiBase.php | 16 +++---- 20 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/Yasumi/Filters/BetweenFilter.php b/src/Yasumi/Filters/BetweenFilter.php index 48e9ba949..e2d9431bb 100644 --- a/src/Yasumi/Filters/BetweenFilter.php +++ b/src/Yasumi/Filters/BetweenFilter.php @@ -50,7 +50,7 @@ public function __construct( \Iterator $iterator, \DateTimeInterface $startDate, \DateTimeInterface $endDate, - private bool $equal = true + private bool $equal = true, ) { parent::__construct($iterator); $this->startDate = $startDate->format(self::DATE_FORMAT); diff --git a/src/Yasumi/Filters/OnFilter.php b/src/Yasumi/Filters/OnFilter.php index 6bdc258fc..3d8d182b7 100644 --- a/src/Yasumi/Filters/OnFilter.php +++ b/src/Yasumi/Filters/OnFilter.php @@ -41,7 +41,7 @@ class OnFilter extends AbstractFilter */ public function __construct( \Iterator $iterator, - \DateTimeInterface $date + \DateTimeInterface $date, ) { parent::__construct($iterator); $this->date = $date->format(self::DATE_FORMAT); diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php index 622cd82f5..a6f99c005 100644 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -99,7 +99,7 @@ public function __construct( public array $translations, \DateTimeInterface $date, string $displayLocale = self::DEFAULT_LOCALE, - protected string $type = self::TYPE_OFFICIAL + protected string $type = self::TYPE_OFFICIAL, ) { // Validate if key is not empty if ('' === $key) { diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index aec92c9fd..35cc36b47 100644 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -97,7 +97,7 @@ abstract class AbstractProvider implements \Countable, ProviderInterface, \Itera public function __construct( int $year, ?string $locale = null, - private ?TranslationsInterface $globalTranslations = null + private ?TranslationsInterface $globalTranslations = null, ) { $this->clearHolidays(); @@ -217,7 +217,7 @@ public function previous(string $key): ?Holiday public function between( \DateTimeInterface $startDate, \DateTimeInterface $endDate, - ?bool $equals = null + ?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/AustralianCapitalTerritory.php b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php index e14dabe78..a4956abfd 100644 --- a/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php +++ b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php @@ -75,7 +75,7 @@ protected function easterSunday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { return new Holiday( 'easter', @@ -107,7 +107,7 @@ protected function easterSaturday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Australia/NewSouthWales.php b/src/Yasumi/Provider/Australia/NewSouthWales.php index eb72ded0a..9e9490b88 100644 --- a/src/Yasumi/Provider/Australia/NewSouthWales.php +++ b/src/Yasumi/Provider/Australia/NewSouthWales.php @@ -74,7 +74,7 @@ protected function easterSaturday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Australia/NorthernTerritory.php b/src/Yasumi/Provider/Australia/NorthernTerritory.php index b9c88d4c0..6e01ff139 100644 --- a/src/Yasumi/Provider/Australia/NorthernTerritory.php +++ b/src/Yasumi/Provider/Australia/NorthernTerritory.php @@ -73,7 +73,7 @@ protected function easterSaturday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Australia/SouthAustralia.php b/src/Yasumi/Provider/Australia/SouthAustralia.php index d27e69f33..11266ca00 100644 --- a/src/Yasumi/Provider/Australia/SouthAustralia.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -81,7 +81,7 @@ protected function easterSaturday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Australia/Victoria.php b/src/Yasumi/Provider/Australia/Victoria.php index 1757a0a85..4c52e627c 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -75,7 +75,7 @@ protected function easterSunday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { return new Holiday( 'easter', @@ -107,7 +107,7 @@ protected function easterSaturday( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): Holiday { $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')); diff --git a/src/Yasumi/Provider/Canada/Quebec.php b/src/Yasumi/Provider/Canada/Quebec.php index 82fa8ef52..76123c05e 100644 --- a/src/Yasumi/Provider/Canada/Quebec.php +++ b/src/Yasumi/Provider/Canada/Quebec.php @@ -79,7 +79,7 @@ protected function saintJeanBaptisteDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'saintJeanBaptisteDay', diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index bf982546c..a9ef033c3 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -50,7 +50,7 @@ protected function corpusChristi( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OTHER + string $type = Holiday::TYPE_OTHER, ): Holiday { return new Holiday( 'corpusChristi', @@ -85,7 +85,7 @@ protected function allSaintsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('allSaintsDay', [], new \DateTime("{$year}-11-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -113,7 +113,7 @@ protected function assumptionOfMary( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'assumptionOfMary', @@ -145,7 +145,7 @@ protected function goodFriday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { $holiday = 'goodFriday'; $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P2D')); @@ -182,7 +182,7 @@ protected function epiphany( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('epiphany', [], new \DateTime("{$year}-1-6", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -212,7 +212,7 @@ protected function stJosephsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('stJosephsDay', [], new \DateTime("{$year}-3-19", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -241,7 +241,7 @@ protected function stGeorgesDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('stGeorgesDay', [], new \DateTime("{$year}-4-23", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -301,7 +301,7 @@ protected function reformationDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'reformationDay', @@ -412,7 +412,7 @@ protected function easter( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('easter', [], $this->calculateEaster($year, $timezone), $locale, $type); } @@ -437,7 +437,7 @@ protected function pentecost( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'pentecost', @@ -471,7 +471,7 @@ protected function easterMonday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'easterMonday', @@ -505,7 +505,7 @@ protected function ascensionDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'ascensionDay', @@ -536,7 +536,7 @@ protected function pentecostMonday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'pentecostMonday', @@ -571,7 +571,7 @@ protected function christmasEve( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OBSERVANCE + string $type = Holiday::TYPE_OBSERVANCE, ): Holiday { return new Holiday( 'christmasEve', @@ -603,7 +603,7 @@ protected function christmasDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'christmasDay', @@ -635,7 +635,7 @@ protected function secondChristmasDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'secondChristmasDay', @@ -669,7 +669,7 @@ protected function ashWednesday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { $holiday = 'ashWednesday'; $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P46D')); @@ -705,7 +705,7 @@ protected function immaculateConception( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'immaculateConception', @@ -741,7 +741,7 @@ protected function stStephensDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'stStephensDay', @@ -776,7 +776,7 @@ protected function maundyThursday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { $holiday = 'maundyThursday'; $date = $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P3D')); @@ -813,7 +813,7 @@ protected function stJohnsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('stJohnsDay', [], new \DateTime("{$year}-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -843,7 +843,7 @@ protected function annunciation( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'annunciation', diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index 762e84897..1914c4a65 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -53,7 +53,7 @@ protected function newYearsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('newYearsDay', [], new \DateTime("{$year}-1-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -83,7 +83,7 @@ protected function internationalWorkersDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'internationalWorkersDay', @@ -119,7 +119,7 @@ protected function stMartinsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'stMartinsDay', @@ -151,7 +151,7 @@ protected function internationalWomensDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'internationalWomensDay', @@ -186,7 +186,7 @@ protected function newYearsEve( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday('newYearsEve', [], new \DateTime("{$year}-12-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } @@ -216,7 +216,7 @@ protected function valentinesDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'valentinesDay', @@ -250,7 +250,7 @@ protected function worldAnimalDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'worldAnimalDay', @@ -285,7 +285,7 @@ protected function fathersDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'fathersDay', @@ -320,7 +320,7 @@ protected function mothersDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'mothersDay', @@ -355,7 +355,7 @@ protected function victoryInEuropeDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'victoryInEuropeDay', @@ -392,7 +392,7 @@ protected function armisticeDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'armisticeDay', @@ -420,7 +420,7 @@ protected function summerTime( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, true); @@ -454,7 +454,7 @@ protected function winterTime( int $year, string $timezone, string $locale, - ?string $type = null + ?string $type = null, ): ?Holiday { $date = $this->calculateSummerWinterTime($year, $timezone, false); @@ -496,7 +496,7 @@ protected function winterTime( private function calculateSummerWinterTime( int $year, string $timezone, - bool $summer + bool $summer, ): ?\DateTimeImmutable { $zone = DateTimeZoneFactory::getDateTimeZone($timezone); diff --git a/src/Yasumi/Provider/Germany/Berlin.php b/src/Yasumi/Provider/Germany/Berlin.php index 033a7e001..f3db82ae0 100644 --- a/src/Yasumi/Provider/Germany/Berlin.php +++ b/src/Yasumi/Provider/Germany/Berlin.php @@ -80,7 +80,7 @@ public function initialize(): void protected function dayOfLiberation( string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'dayOfLiberation', diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index c32ac9084..2947d5067 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -250,7 +250,7 @@ protected function dayAfterNewYearsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'dayAfterNewYearsDay', @@ -269,7 +269,7 @@ protected function twoDaysLaterNewYearsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'twoDaysLaterNewYearsDay', @@ -292,7 +292,7 @@ protected function seollal( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['seollal'][$year])) { return null; @@ -321,7 +321,7 @@ protected function dayBeforeSeollal( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['seollal'][$year])) { return null; @@ -350,7 +350,7 @@ protected function dayAfterSeollal( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['seollal'][$year])) { return null; @@ -377,7 +377,7 @@ protected function independenceMovementDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'independenceMovementDay', @@ -398,7 +398,7 @@ protected function arborDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { $datetime = 1960 === $year ? "{$year}-3-21" : "{$year}-4-5"; @@ -421,7 +421,7 @@ protected function buddhasBirthday( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['buddhasBirthday'][$year])) { return null; @@ -448,7 +448,7 @@ protected function childrensDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'childrensDay', @@ -469,7 +469,7 @@ protected function memorialDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'memorialDay', @@ -493,7 +493,7 @@ protected function constitutionDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'constitutionDay', @@ -514,7 +514,7 @@ protected function liberationDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'liberationDay', @@ -538,7 +538,7 @@ protected function chuseok( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['chuseok'][$year])) { return null; @@ -568,7 +568,7 @@ protected function dayBeforeChuseok( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['chuseok'][$year])) { return null; @@ -598,7 +598,7 @@ protected function dayAfterChuseok( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): ?Holiday { if (! isset(self::LUNAR_HOLIDAY['chuseok'][$year])) { return null; @@ -628,7 +628,7 @@ protected function armedForcesDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'armedForcesDay', @@ -649,7 +649,7 @@ protected function nationalFoundationDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'nationalFoundationDay', @@ -672,7 +672,7 @@ protected function hangulDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'hangulDay', @@ -695,7 +695,7 @@ protected function unitedNationsDay( int $year, string $timezone, string $locale, - string $type = Holiday::TYPE_OFFICIAL + string $type = Holiday::TYPE_OFFICIAL, ): Holiday { return new Holiday( 'unitedNationsDay', diff --git a/src/Yasumi/ProviderInterface.php b/src/Yasumi/ProviderInterface.php index 1e6278021..7e5121a47 100644 --- a/src/Yasumi/ProviderInterface.php +++ b/src/Yasumi/ProviderInterface.php @@ -209,7 +209,7 @@ public function previous(string $key): ?Holiday; public function between( \DateTimeInterface $startDate, \DateTimeInterface $endDate, - ?bool $equals = null + ?bool $equals = null, ): BetweenFilter; /** diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php index eccec5939..97c755be7 100644 --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -66,7 +66,7 @@ public function __construct( array $names, \DateTimeInterface $date, string $displayLocale = self::DEFAULT_LOCALE, - string $type = self::TYPE_OFFICIAL + string $type = self::TYPE_OFFICIAL, ) { $this->substitutedHoliday = $substitutedHoliday; diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php index e9238c973..870f99873 100644 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -73,7 +73,7 @@ class Yasumi public static function nextWorkingDay( string $class, \DateTimeInterface $startDate, - int $workingDays = 1 + int $workingDays = 1, ): \DateTimeInterface { $date = $startDate instanceof \DateTime ? \DateTimeImmutable::createFromMutable($startDate) : $startDate; $provider = null; @@ -186,7 +186,7 @@ public static function getAvailableLocales(): array public static function createByISO3166_2( string $isoCode, int $year = self::YEAR_LOWER_BOUND, - string $locale = self::DEFAULT_LOCALE + string $locale = self::DEFAULT_LOCALE, ): ProviderInterface { $availableProviders = self::getProviders(); @@ -277,7 +277,7 @@ public static function getProviders(): array public static function prevWorkingDay( string $class, \DateTimeInterface $startDate, - int $workingDays = 1 + int $workingDays = 1, ): \DateTimeInterface { $date = $startDate instanceof \DateTime ? \DateTimeImmutable::createFromMutable($startDate) : $startDate; $provider = null; diff --git a/tests/Randomizer.php b/tests/Randomizer.php index d851fe42e..8bdfa5b7a 100644 --- a/tests/Randomizer.php +++ b/tests/Randomizer.php @@ -42,7 +42,7 @@ public function generateRandomDates( int $day, ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $data = []; $range ??= 1000; @@ -68,7 +68,7 @@ public function generateRandomDates( public function generateRandomEasterDates( ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $data = []; $range ??= 1000; @@ -97,7 +97,7 @@ public function generateRandomEasterDates( public function generateRandomEasterMondayDates( ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $range ??= 1000; @@ -122,7 +122,7 @@ public function generateRandomModifiedEasterDates( callable $cb, ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $data = []; $range ??= 1000; @@ -152,7 +152,7 @@ public function generateRandomModifiedEasterDates( public function generateRandomGoodFridayDates( ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $range ??= 1000; @@ -175,7 +175,7 @@ public function generateRandomGoodFridayDates( public function generateRandomPentecostDates( ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { $range ??= 1000; @@ -203,7 +203,7 @@ public function generateRandomDatesWithHolidayMovedToMonday( int $day, ?string $timezone = null, ?int $iterations = null, - ?int $range = null + ?int $range = null, ): array { return $this->generateRandomDatesWithModifier($month, $day, function ($range, \DateTime $date): void { if ($this->isWeekend($date)) { @@ -232,7 +232,7 @@ public function generateRandomDatesWithModifier( callable $callback, int $iterations, int $range, - ?string $timezone = null + ?string $timezone = null, ): array { $data = []; @@ -260,7 +260,7 @@ public function generateRandomDatesWithModifier( */ public function generateRandomYear( ?int $lowerLimit = null, - ?int $upperLimit = null + ?int $upperLimit = null, ): int { return self::numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); } @@ -275,7 +275,7 @@ public function generateRandomYear( */ public function isWeekend( \DateTimeInterface $dateTime, - array $weekendDays = [0, 6] + array $weekendDays = [0, 6], ): bool { return \in_array((int) $dateTime->format('w'), $weekendDays, true); } diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index 176fa7870..84573ce32 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -64,7 +64,7 @@ public function assertHolidayWithSubstitution( string $key, int $year, \DateTimeInterface $expectedOfficial, - ?\DateTimeInterface $expectedSubstitution = null + ?\DateTimeInterface $expectedSubstitution = null, ): void { $holidays = Yasumi::create($provider, $year); diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index 2f83f16b2..cfbe336bc 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -53,7 +53,7 @@ public function assertDefinedHolidays( array $expectedHolidays, string $provider, int $year, - string $type + string $type, ): void { $holidays = Yasumi::create($provider, $year); @@ -98,7 +98,7 @@ public function assertHoliday( string $provider, string $key, int $year, - \DateTimeInterface $expected + \DateTimeInterface $expected, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); @@ -125,7 +125,7 @@ public function assertSubstituteHoliday( string $provider, string $key, int $year, - \DateTimeInterface $expected + \DateTimeInterface $expected, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday('substituteHoliday:' . $key); @@ -150,7 +150,7 @@ public function assertSubstituteHoliday( public function assertNotSubstituteHoliday( string $provider, string $key, - int $year + int $year, ): void { $this->assertNotHoliday( $provider, @@ -174,7 +174,7 @@ public function assertNotSubstituteHoliday( public function assertNotHoliday( string $provider, string $key, - int $year + int $year, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); @@ -199,7 +199,7 @@ public function assertTranslatedHolidayName( string $provider, string $key, int $year, - array $translations + array $translations, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); @@ -244,7 +244,7 @@ public function assertHolidayType( string $provider, string $key, int $year, - string $type + string $type, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); @@ -270,7 +270,7 @@ public function assertDayOfWeek( string $provider, string $key, int $year, - string $expectedDayOfWeek + string $expectedDayOfWeek, ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key);