diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index b84347c26..206439d0d 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -1,9 +1,11 @@ */ -$config = new AzuyaLabs\PhpCsFixerConfig\Config(); +$config = new AzuyaLabs\PhpCsFixerConfig\Config('2015', null, 'Yasumi'); $config->getFinder()->in(__DIR__)->notPath('var'); +$defaults = $config->getRules(); + +$config->setRules(array_merge($defaults, [ + 'php_unit_method_casing' => ['case' => 'camel_case'], +])); + return $config; diff --git a/composer.json b/composer.json index 1b06f3622..8db19a93d 100644 --- a/composer.json +++ b/composer.json @@ -40,8 +40,7 @@ }, "require-dev": { "ext-intl": "*", - "azuyalabs/php-cs-fixer-config": "^0.1", - "friendsofphp/php-cs-fixer": "^2.19 || 3.48", + "azuyalabs/php-cs-fixer-config": "^0.3", "mikey179/vfsstream": "^1.6", "phan/phan": "^5.4", "phpstan/phpstan": "^1.10", diff --git a/examples/basic.php b/examples/basic.php index 4407f7351..9cf5b8f98 100644 --- a/examples/basic.php +++ b/examples/basic.php @@ -2,7 +2,20 @@ // This file demonstrates the general use of Yasumi and its basic methods. -declare(strict_types=1); +declare(strict_types = 1); + +/** + * This file is part of the 'Yasumi' package. + * + * The easy PHP Library for calculating holidays. + * + * Copyright (c) 2015 - 2024 AzuyaLabs + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Sacha Telgenhof + */ require 'vendor/autoload.php'; @@ -10,20 +23,20 @@ $holidays = Yasumi\Yasumi::create('USA', (int) date('Y')); // Show the number of defined holidays -echo 'Number of defined holidays: '.$holidays->count().PHP_EOL; +echo 'Number of defined holidays: ' . $holidays->count() . PHP_EOL; echo PHP_EOL; // Display a list all of the holiday names (short names) -echo 'List of all the holiday names: '.PHP_EOL; +echo 'List of all the holiday names: ' . PHP_EOL; foreach ($holidays->getHolidayNames() as $name) { - echo $name.PHP_EOL; + echo $name . PHP_EOL; } echo PHP_EOL; // Display a list all of the holiday dates -echo 'List of all the holiday dates:'.PHP_EOL; +echo 'List of all the holiday dates:' . PHP_EOL; foreach ($holidays->getHolidayDates() as $date) { - echo $date.PHP_EOL; + echo $date . PHP_EOL; } echo PHP_EOL; @@ -31,17 +44,17 @@ $independenceDay = $holidays->getHoliday('independenceDay'); // Show the localized name -echo 'Name of the holiday : '.$independenceDay->getName().PHP_EOL; +echo 'Name of the holiday : ' . $independenceDay->getName() . PHP_EOL; // Show the date -echo 'Date of the holiday : '.$independenceDay.PHP_EOL; +echo 'Date of the holiday : ' . $independenceDay . PHP_EOL; // Show the type of holiday -echo 'Type of holiday : '.$independenceDay->getType().PHP_EOL; +echo 'Type of holiday : ' . $independenceDay->getType() . PHP_EOL; echo PHP_EOL; // Dump the holiday as a JSON object -echo 'Holiday as a JSON object:'.PHP_EOL; +echo 'Holiday as a JSON object:' . PHP_EOL; echo json_encode($independenceDay, JSON_PRETTY_PRINT); echo PHP_EOL; diff --git a/examples/between_filter.php b/examples/between_filter.php index 4b1358c9a..4b8b46f7c 100644 --- a/examples/between_filter.php +++ b/examples/between_filter.php @@ -3,7 +3,20 @@ // This file demonstrates the use of the `between` filter, selecting only a number of holidays // that fall in the given date range. -declare(strict_types=1); +declare(strict_types = 1); + +/** + * This file is part of the 'Yasumi' package. + * + * The easy PHP Library for calculating holidays. + * + * Copyright (c) 2015 - 2024 AzuyaLabs + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Sacha Telgenhof + */ require 'vendor/autoload.php'; @@ -12,16 +25,16 @@ // Use the factory to create a new holiday provider instance $holidays = Yasumi\Yasumi::create('Italy', $year); $holidaysInDecember = $holidays->between( - new DateTime('12/01/'.$year), - new DateTime('12/31/'.$year) + new DateTime('12/01/' . $year), + new DateTime('12/31/' . $year) ); // Show all holidays in Italy for December -echo 'List of all the holidays in December: '.PHP_EOL; +echo 'List of all the holidays in December: ' . PHP_EOL; foreach ($holidaysInDecember as $holiday) { - echo $holiday.' - '.$holiday->getName().PHP_EOL; + echo $holiday . ' - ' . $holiday->getName() . PHP_EOL; } echo PHP_EOL; // Show the number of filtered holidays -echo 'Number of filtered holidays: '.$holidaysInDecember->count().PHP_EOL; +echo 'Number of filtered holidays: ' . $holidaysInDecember->count() . PHP_EOL; diff --git a/examples/custom_provider.php b/examples/custom_provider.php index 773f93cc3..57f514d63 100644 --- a/examples/custom_provider.php +++ b/examples/custom_provider.php @@ -4,7 +4,20 @@ // those scenarios where you would need only a subset of holidays of an existing provider. Or, if you you like to // extend an existing provider with additional, non-standard holidays. -declare(strict_types=1); +declare(strict_types = 1); + +/** + * This file is part of the 'Yasumi' package. + * + * The easy PHP Library for calculating holidays. + * + * Copyright (c) 2015 - 2024 AzuyaLabs + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Sacha Telgenhof + */ require 'vendor/autoload.php'; @@ -33,11 +46,11 @@ public function initialize(): void $NYSEHolidays = Yasumi\Yasumi::create(NYSE::class, (int) date('Y')); // We then can retrieve the NYSE observed holidays in the usual manner: -echo 'List of all the holiday names: '.PHP_EOL; +echo 'List of all the holiday names: ' . PHP_EOL; foreach ($NYSEHolidays->getHolidayNames() as $day) { - echo $day.PHP_EOL; + echo $day . PHP_EOL; } echo PHP_EOL; // Use the count() method to show how many holidays are returned -echo 'Number of defined holidays: '.$NYSEHolidays->count().PHP_EOL; +echo 'Number of defined holidays: ' . $NYSEHolidays->count() . PHP_EOL; diff --git a/examples/filters.php b/examples/filters.php index 3a82af460..5e85543ab 100644 --- a/examples/filters.php +++ b/examples/filters.php @@ -4,7 +4,20 @@ // based on certain conditions. In this examples we show only the holidays that are // marked as 'official'. -declare(strict_types=1); +declare(strict_types = 1); + +/** + * This file is part of the 'Yasumi' package. + * + * The easy PHP Library for calculating holidays. + * + * Copyright (c) 2015 - 2024 AzuyaLabs + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Sacha Telgenhof + */ require 'vendor/autoload.php'; @@ -14,7 +27,7 @@ // Create a filter instance for the official holidays $official = new Yasumi\Filters\OfficialHolidaysFilter($holidays->getIterator()); -echo 'List of all official holidays: '.PHP_EOL; +echo 'List of all official holidays: ' . PHP_EOL; foreach ($official as $day) { - echo $day->getName().PHP_EOL; + echo $day->getName() . PHP_EOL; } diff --git a/phpinsights.php b/phpinsights.php index 4b5520d8b..9dbda25a8 100644 --- a/phpinsights.php +++ b/phpinsights.php @@ -1,6 +1,19 @@ + */ return [ /* diff --git a/rector.php b/rector.php index a75a58ab8..112903d93 100644 --- a/rector.php +++ b/rector.php @@ -1,6 +1,19 @@ + */ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; @@ -8,8 +21,8 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ - __DIR__.'/src', - __DIR__.'/tests', + __DIR__ . '/src', + __DIR__ . '/tests', ]); // single rules diff --git a/src/Yasumi/Exception/Exception.php b/src/Yasumi/Exception/Exception.php index fe9254e73..4faee05ea 100644 --- a/src/Yasumi/Exception/Exception.php +++ b/src/Yasumi/Exception/Exception.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -190,10 +192,10 @@ protected function calculateReconciliationDay(): void return; } - $date = new \DateTime($this->year.'-05-27', DateTimeZoneFactory::getDateTimeZone($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')); + $date = $date->add(0 === $day ? new \DateInterval('P1D') : new \DateInterval('P' . (8 - $day) . 'D')); } $this->addHoliday(new Holiday('reconciliationDay', ['en' => 'Reconciliation Day'], $date, $this->locale)); } diff --git a/src/Yasumi/Provider/Australia/NewSouthWales.php b/src/Yasumi/Provider/Australia/NewSouthWales.php index 54366a841..eb72ded0a 100644 --- a/src/Yasumi/Provider/Australia/NewSouthWales.php +++ b/src/Yasumi/Provider/Australia/NewSouthWales.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -138,7 +140,7 @@ protected function calculateBankHoliday(): void $this->addHoliday(new Holiday( 'bankHoliday', ['en' => 'Bank Holiday'], - new \DateTime('first monday of august '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('first monday of august ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); diff --git a/src/Yasumi/Provider/Australia/NorthernTerritory.php b/src/Yasumi/Provider/Australia/NorthernTerritory.php index 55c69d125..b9c88d4c0 100644 --- a/src/Yasumi/Provider/Australia/NorthernTerritory.php +++ b/src/Yasumi/Provider/Australia/NorthernTerritory.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -139,7 +141,7 @@ protected function calculatePicnicDay(): void $this->addHoliday(new Holiday( 'picnicDay', ['en' => 'Picnic Day'], - new \DateTime('first monday of august '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + 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 0c6e38dc7..6becbfd38 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -1,9 +1,11 @@ year; + $birthDay = 'first monday of october ' . $this->year; if ($this->year < 2012 || 2013 === $this->year || 2014 === $this->year || 2015 === $this->year) { - $birthDay = 'second monday of june '.$this->year; + $birthDay = 'second monday of june ' . $this->year; } $this->addHoliday(new Holiday( diff --git a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php index b63d8f2dd..96c6c66be 100644 --- a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php +++ b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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/SouthAustralia.php b/src/Yasumi/Provider/Australia/SouthAustralia.php index a08713fc0..d27e69f33 100644 --- a/src/Yasumi/Provider/Australia/SouthAustralia.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -145,10 +147,10 @@ protected function calculateLabourDay(): void protected function calculateAdelaideCupDay(): void { if ($this->year >= 1973) { - $cupDay = 'second monday of march '.$this->year; + $cupDay = 'second monday of march ' . $this->year; if ($this->year < 2006) { - $cupDay = 'third monday of may '.$this->year; + $cupDay = 'third monday of may ' . $this->year; } $this->addHoliday(new Holiday( diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index 7d97aa80f..9dce59344 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -100,7 +102,7 @@ protected function calculateRecreationDay(): void $this->addHoliday(new Holiday( 'recreationDay', ['en' => 'Recreation Day'], - new \DateTime('first monday of november '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + 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/CentralNorth.php b/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php index 3701c94b9..5134add2f 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php +++ b/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php @@ -1,9 +1,11 @@ year.'-12-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime($this->year . '-12-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->modify('previous friday'); if (! $date instanceof \DateTime) { diff --git a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php index 7f50e4579..91f9d227b 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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 78e4abc43..1916b3ce2 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'kingIslandShow', ['en' => 'King Island Show'], - new \DateTime('first tuesday of march '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + 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/Northeast.php b/src/Yasumi/Provider/Australia/Tasmania/Northeast.php index b2aca1fd9..46fcf2dce 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northeast.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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 be6fe7582..395204930 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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 160e966a0..e6da79a16 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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 512815daa..ee54acd74 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South.php @@ -1,9 +1,11 @@ year, DateTimeZoneFactory::getDateTimeZone($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 b489e4c53..08b73d70f 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'hobartRegatta', ['en' => 'Royal Hobart Regatta'], - new \DateTime('second monday of february '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + 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 e0784de43..1757a0a85 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'queensBirthday', [], - new \DateTime('second monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('second monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -167,7 +169,7 @@ protected function calculateQueensBirthday(): void */ protected function calculateMelbourneCupDay(): void { - $date = new \DateTime('first Tuesday of November'." {$this->year}", DateTimeZoneFactory::getDateTimeZone($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)); } diff --git a/src/Yasumi/Provider/Australia/WesternAustralia.php b/src/Yasumi/Provider/Australia/WesternAustralia.php index 6727b2609..ffe2fd801 100644 --- a/src/Yasumi/Provider/Australia/WesternAustralia.php +++ b/src/Yasumi/Provider/Australia/WesternAustralia.php @@ -1,9 +1,11 @@ year; + $birthDay = 'last monday of september ' . $this->year; if (2011 === $this->year) { $birthDay = '2011-10-28'; } @@ -109,7 +111,7 @@ protected function calculateWesternAustraliaDay(): void $this->addHoliday(new Holiday( 'westernAustraliaDay', ['en' => 'Western Australia Day'], - new \DateTime('first monday of june '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('first monday of june ' . $this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/Austria.php b/src/Yasumi/Provider/Austria.php index 1e3c5516b..37898e399 100644 --- a/src/Yasumi/Provider/Austria.php +++ b/src/Yasumi/Provider/Austria.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'stLeopoldsDay', [], - new \DateTime($this->year.'-11-15', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-11-15', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -125,7 +127,7 @@ protected function calculateNationalDay(): void $this->addHoliday(new Holiday( 'nationalDay', ['de' => 'Nationalfeiertag'], - new \DateTime($this->year.'-10-26', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-10-26', new \DateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Austria/Burgenland.php b/src/Yasumi/Provider/Austria/Burgenland.php index d9cf6c577..864c3314e 100644 --- a/src/Yasumi/Provider/Austria/Burgenland.php +++ b/src/Yasumi/Provider/Austria/Burgenland.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'plebisciteDay', [], - new \DateTime($this->year.'-10-10', new \DateTimeZone($this->timezone)), + 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 index 68696edc5..765ab054e 100644 --- a/src/Yasumi/Provider/Austria/LowerAustria.php +++ b/src/Yasumi/Provider/Austria/LowerAustria.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'stRupertsDay', [], - new \DateTime($this->year.'-9-24', new \DateTimeZone($this->timezone)), + 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 index bc88f2c0c..81b10f2fa 100644 --- a/src/Yasumi/Provider/Austria/Styria.php +++ b/src/Yasumi/Provider/Austria/Styria.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'stFloriansDay', [], - new \DateTime($this->year.'-5-4', new \DateTimeZone($this->timezone)), + 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 index 18f83e2a9..6cbc1f219 100644 --- a/src/Yasumi/Provider/Austria/Vienna.php +++ b/src/Yasumi/Provider/Austria/Vienna.php @@ -1,9 +1,11 @@ year < 1983) { return; } - $date = new \DateTime($this->year.'-07-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime($this->year . '-07-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)); if (7 === (int) $date->format('N')) { - $date = new \DateTime($this->year.'-07-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime($this->year . '-07-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday( 'canadaDay', diff --git a/src/Yasumi/Provider/Canada/Alberta.php b/src/Yasumi/Provider/Canada/Alberta.php index ef982cfa1..b827f8007 100644 --- a/src/Yasumi/Provider/Canada/Alberta.php +++ b/src/Yasumi/Provider/Canada/Alberta.php @@ -1,9 +1,11 @@ 'St. Patrick’s Day'], - new \DateTime($this->year.'-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); @@ -122,7 +124,7 @@ protected function calculateOrangemensDay(): void $holiday = new Holiday( 'orangemensDay', [], - new \DateTime($this->year.'-7-12', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-7-12', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); diff --git a/src/Yasumi/Provider/Canada/NorthwestTerritories.php b/src/Yasumi/Provider/Canada/NorthwestTerritories.php index ec1802d76..25662fa73 100644 --- a/src/Yasumi/Provider/Canada/NorthwestTerritories.php +++ b/src/Yasumi/Provider/Canada/NorthwestTerritories.php @@ -1,9 +1,11 @@ add(new \DateInterval('P'.$easterDays.'D')); + $easter->add(new \DateInterval('P' . $easterDays . 'D')); return $easter; } diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index e4006fb5f..762e84897 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -1,9 +1,11 @@ 'Den obnovy samostatného českého státu', 'en' => 'Day of renewal of the independent Czech state', ], - new \DateTime($this->year.'-01-01', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-01-01', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -121,7 +123,7 @@ protected 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-5', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-07-5', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -145,7 +147,7 @@ protected function calculateJanHusDay(): void $this->addHoliday(new Holiday( 'janHusDay', ['cs' => 'Den upálení mistra Jana Husa', 'en' => 'Jan Hus Day'], - new \DateTime($this->year.'-07-6', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-07-6', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -175,7 +177,7 @@ protected function calculateCzechStatehoodDay(): void 'cs' => 'Den české státnosti', 'en' => 'St. Wenceslas Day (Czech Statehood Day)', ], - new \DateTime($this->year.'-09-28', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-09-28', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -194,7 +196,7 @@ protected function calculateIndependentCzechoslovakStateDay(): void $this->addHoliday(new Holiday('independentCzechoslovakStateDay', [ 'cs' => 'Den vzniku samostatného československého státu', 'en' => 'Independent Czechoslovak State Day', - ], new \DateTime($this->year.'-10-28', new \DateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime($this->year . '-10-28', new \DateTimeZone($this->timezone)), $this->locale)); } /** @@ -214,7 +216,7 @@ protected 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', new \DateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/DateTimeZoneFactory.php b/src/Yasumi/Provider/DateTimeZoneFactory.php index 537828770..f09ea23f8 100644 --- a/src/Yasumi/Provider/DateTimeZoneFactory.php +++ b/src/Yasumi/Provider/DateTimeZoneFactory.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'germanUnityDay', ['de' => 'Tag der Deutschen Einheit'], - new \DateTime($this->year.'-10-3', new \DateTimeZone($this->timezone)), + new \DateTime($this->year . '-10-3', new \DateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Germany/BadenWurttemberg.php b/src/Yasumi/Provider/Germany/BadenWurttemberg.php index 678710d4e..57eec668c 100644 --- a/src/Yasumi/Provider/Germany/BadenWurttemberg.php +++ b/src/Yasumi/Provider/Germany/BadenWurttemberg.php @@ -1,9 +1,11 @@ 'Christmas Day', 'ga' => 'Lá Nollag'], - new \DateTime($this->year.'-12-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-12-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -198,7 +200,7 @@ protected function calculateStStephensDay(): void $holiday = new Holiday( 'stStephensDay', [], - new \DateTime($this->year.'-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -241,7 +243,7 @@ protected function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => 'St. Patrick’s Day', 'ga' => 'Lá Fhéile Pádraig'], - new \DateTime($this->year.'-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); diff --git a/src/Yasumi/Provider/Italy.php b/src/Yasumi/Provider/Italy.php index 8266fd9ab..fa1521b7b 100644 --- a/src/Yasumi/Provider/Italy.php +++ b/src/Yasumi/Provider/Italy.php @@ -1,9 +1,11 @@ add(new \DateInterval('P1D')); - $this->addHoliday(new Holiday('bridgeDay'.$counter, [ + $this->addHoliday(new Holiday('bridgeDay' . $counter, [ 'en' => 'Bridge Public holiday', 'ja' => '国民の休日', ], $bridgeDate, $this->locale)); diff --git a/src/Yasumi/Provider/Latvia.php b/src/Yasumi/Provider/Latvia.php index 9afe8d51e..fde07e6d2 100644 --- a/src/Yasumi/Provider/Latvia.php +++ b/src/Yasumi/Provider/Latvia.php @@ -1,9 +1,11 @@ */ -declare(strict_types=1); +declare(strict_types = 1); + +/** + * This file is part of the 'Yasumi' package. + * + * The easy PHP Library for calculating holidays. + * + * Copyright (c) 2015 - 2024 AzuyaLabs + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @author Sacha Telgenhof + */ namespace Yasumi\Provider; diff --git a/src/Yasumi/Provider/Mexico.php b/src/Yasumi/Provider/Mexico.php index d4bbffaff..971f59078 100644 --- a/src/Yasumi/Provider/Mexico.php +++ b/src/Yasumi/Provider/Mexico.php @@ -1,11 +1,11 @@ year < 1910 ? 'second wednesday of october' : 'fourth monday of october')." {$this->year}", + ($this->year < 1910 ? 'second wednesday of october' : 'fourth monday of october') . " {$this->year}", DateTimeZoneFactory::getDateTimeZone($this->timezone) ); diff --git a/src/Yasumi/Provider/Norway.php b/src/Yasumi/Provider/Norway.php index 894d5dc74..82c79806b 100644 --- a/src/Yasumi/Provider/Norway.php +++ b/src/Yasumi/Provider/Norway.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'stAndrewsDay', [], - new \DateTime($this->year.'-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -222,7 +224,7 @@ protected function calculateStJohnsDay(): void $this->addHoliday(new Holiday( 'stJohnsDay', [], - new \DateTime($this->year.'-01-07', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-01-07', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Russia.php b/src/Yasumi/Provider/Russia.php index 8f9b94f13..90146706f 100644 --- a/src/Yasumi/Provider/Russia.php +++ b/src/Yasumi/Provider/Russia.php @@ -1,9 +1,11 @@ addHoliday(new Holiday('newYearHolidaysDay'.$day, [ + $this->addHoliday(new Holiday('newYearHolidaysDay' . $day, [ 'en' => 'New Year’s holidays', 'ru' => 'Новогодние каникулы', ], new \DateTime("{$this->year}-01-{$day}", new \DateTimeZone($this->timezone)), $this->locale)); diff --git a/src/Yasumi/Provider/Slovakia.php b/src/Yasumi/Provider/Slovakia.php index 62406f4d5..603d6eda1 100644 --- a/src/Yasumi/Provider/Slovakia.php +++ b/src/Yasumi/Provider/Slovakia.php @@ -1,9 +1,11 @@ 'Deň vzniku Slovenskej republiky', 'en' => 'Day of the Establishment of the Slovak Republic', ], - new \DateTime($this->year.'-01-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-01-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -154,7 +156,7 @@ protected 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', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-07-05', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -177,7 +179,7 @@ protected function calculateSlovakNationalUprisingDay(): void 'sk' => 'Výročie Slovenského národného povstania', 'en' => 'Slovak National Uprising Day', ], - new \DateTime($this->year.'-08-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-08-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -200,7 +202,7 @@ protected function calculateSlovakConstitutionDay(): void 'sk' => 'Deň Ústavy Slovenskej republiky', 'en' => 'Day of the Constitution of the Slovak Republic', ], - new \DateTime($this->year.'-09-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-09-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -224,7 +226,7 @@ protected 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', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); + ], new \DateTime($this->year . '-09-15', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); } /** @@ -245,7 +247,7 @@ protected function calculateStruggleForFreedomAndDemocracyDay(): void 'cs' => 'Den boje za svobodu a demokracii', 'en' => 'Struggle for Freedom and Democracy Day', ], - new \DateTime($this->year.'-11-17', DateTimeZoneFactory::getDateTimeZone($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 42e14b406..5ce3d446c 100644 --- a/src/Yasumi/Provider/SouthAfrica.php +++ b/src/Yasumi/Provider/SouthAfrica.php @@ -1,9 +1,11 @@ addHoliday(new Holiday( 'humanRightsDay', ['en' => 'Human Rights Day'], - new \DateTime($this->year.'-3-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-3-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -149,7 +151,7 @@ protected function calculateFreedomDay(): void $this->addHoliday(new Holiday( 'freedomDay', ['en' => 'Freedom Day'], - new \DateTime($this->year.'-4-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-4-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -175,7 +177,7 @@ protected function calculateYouthDay(): void $this->addHoliday(new Holiday( 'youthDay', ['en' => 'Youth Day'], - new \DateTime($this->year.'-6-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-6-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -225,7 +227,7 @@ protected function calculateNationalWomensDay(): void $this->addHoliday(new Holiday( 'nationalWomensDay', ['en' => 'National Women’s Day'], - new \DateTime($this->year.'-8-9', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-8-9', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -249,7 +251,7 @@ protected function calculateHeritageDay(): void $this->addHoliday(new Holiday( 'heritageDay', ['en' => 'Heritage Day'], - new \DateTime($this->year.'-9-24', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-9-24', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -275,7 +277,7 @@ protected function calculateDayOfReconciliation(): void $this->addHoliday(new Holiday( 'reconciliationDay', ['en' => 'Day of Reconciliation'], - new \DateTime($this->year.'-12-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-12-16', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 4315758fc..c32ac9084 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -1,9 +1,11 @@ format('w'); if (\in_array($dayOfWeek, $acceptedHolidays[$name], true)) { - $dates[$day]['weekend:'.$day] = $name; + $dates[$day]['weekend:' . $day] = $name; } } diff --git a/src/Yasumi/Provider/Spain.php b/src/Yasumi/Provider/Spain.php index d5cf10c35..2a1007d17 100644 --- a/src/Yasumi/Provider/Spain.php +++ b/src/Yasumi/Provider/Spain.php @@ -1,9 +1,11 @@ 'Jour de la Saint-Berthold', 'en' => 'Berchtoldstag', ], - new \DateTime($this->year.'-01-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-01-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -101,7 +103,7 @@ protected function calculateBettagsMontag(): void { if ($this->year >= 1832) { // Find third Sunday of September - $date = new \DateTime('Third Sunday of '.$this->year.'-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime('Third Sunday of ' . $this->year . '-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); // Go to next Thursday $date->add(new \DateInterval('P1D')); @@ -139,7 +141,7 @@ protected function calculateNationalDay(): void $this->addHoliday(new Holiday( 'swissNationalDay', $translations, - new \DateTime($this->year.'-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -147,7 +149,7 @@ protected function calculateNationalDay(): void $this->addHoliday(new Holiday( 'swissNationalDay', $translations, - new \DateTime($this->year.'-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-08-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); diff --git a/src/Yasumi/Provider/Switzerland/Aargau.php b/src/Yasumi/Provider/Switzerland/Aargau.php index 00a46c444..419415503 100644 --- a/src/Yasumi/Provider/Switzerland/Aargau.php +++ b/src/Yasumi/Provider/Switzerland/Aargau.php @@ -1,8 +1,11 @@ 'December 26th', 'fr' => '26 décembre', ], - new \DateTime($this->year.'-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Geneva.php b/src/Yasumi/Provider/Switzerland/Geneva.php index 44f97125a..d09489768 100644 --- a/src/Yasumi/Provider/Switzerland/Geneva.php +++ b/src/Yasumi/Provider/Switzerland/Geneva.php @@ -1,8 +1,11 @@ year.'-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime('First Sunday of ' . $this->year . '-09', DateTimeZoneFactory::getDateTimeZone($this->timezone)); // Go to next Thursday $date->add(new \DateInterval('P4D')); @@ -115,7 +118,7 @@ protected function calculateRestaurationGenevoise(): void [ 'fr' => 'Restauration de la République', ], - new \DateTime($this->year.'-12-31', DateTimeZoneFactory::getDateTimeZone($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 a364d9516..2f81a2495 100644 --- a/src/Yasumi/Provider/Switzerland/Glarus.php +++ b/src/Yasumi/Provider/Switzerland/Glarus.php @@ -1,8 +1,11 @@ year >= 1389) { - $date = new \DateTime('First Thursday of '.$this->year.'-04', DateTimeZoneFactory::getDateTimeZone($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/Grisons.php b/src/Yasumi/Provider/Switzerland/Grisons.php index 36ffbeb69..6c33268fb 100644 --- a/src/Yasumi/Provider/Switzerland/Grisons.php +++ b/src/Yasumi/Provider/Switzerland/Grisons.php @@ -1,8 +1,11 @@ 'Commémoration du plébiscite jurassien', ], - new \DateTime($this->year.'-06-23', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-06-23', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Lucerne.php b/src/Yasumi/Provider/Switzerland/Lucerne.php index 30352ca47..a2ae96b48 100644 --- a/src/Yasumi/Provider/Switzerland/Lucerne.php +++ b/src/Yasumi/Provider/Switzerland/Lucerne.php @@ -1,8 +1,11 @@ 'Instauration de la République', ], - new \DateTime($this->year.'-03-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-03-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -116,7 +119,7 @@ protected function calculateJanuary2nd(): void 'en' => 'January 2nd', 'fr' => '2 janvier', ], - new \DateTime($this->year.'-01-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-01-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -137,7 +140,7 @@ protected function calculateDecember26th(): void 'en' => 'December 26th', 'fr' => '26 décembre', ], - new \DateTime($this->year.'-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-12-26', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Nidwalden.php b/src/Yasumi/Provider/Switzerland/Nidwalden.php index 0d0a42a73..d147fcce3 100644 --- a/src/Yasumi/Provider/Switzerland/Nidwalden.php +++ b/src/Yasumi/Provider/Switzerland/Nidwalden.php @@ -1,8 +1,11 @@ 'Bruder-Klausen-Fest', ], - new \DateTime($this->year.'-09-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-09-25', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -94,7 +97,7 @@ protected function calculateBruderKlausenFest(): void [ 'de' => 'Bruder-Klausen-Fest', ], - new \DateTime($this->year.'-09-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-09-21', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Schaffhausen.php b/src/Yasumi/Provider/Switzerland/Schaffhausen.php index c15f4f638..0ffcc885c 100644 --- a/src/Yasumi/Provider/Switzerland/Schaffhausen.php +++ b/src/Yasumi/Provider/Switzerland/Schaffhausen.php @@ -1,8 +1,11 @@ 'Solennité des saints Pierre et Paul', 'de' => 'St. Peter und Paul', ], - new \DateTime($this->year.'-06-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-06-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Switzerland/Uri.php b/src/Yasumi/Provider/Switzerland/Uri.php index 49358abc6..2b6f630e6 100644 --- a/src/Yasumi/Provider/Switzerland/Uri.php +++ b/src/Yasumi/Provider/Switzerland/Uri.php @@ -1,8 +1,11 @@ addHoliday(new SubstituteHoliday( $holiday, [ - 'en' => $label.' (observed)', + 'en' => $label . ' (observed)', ], $date, $this->locale diff --git a/src/Yasumi/Provider/Ukraine.php b/src/Yasumi/Provider/Ukraine.php index d08cb4cc3..2c37405f3 100644 --- a/src/Yasumi/Provider/Ukraine.php +++ b/src/Yasumi/Provider/Ukraine.php @@ -1,9 +1,11 @@ 'St. Patrick’s Day'], - new \DateTime($this->year.'-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); @@ -120,7 +123,7 @@ protected function calculateBattleOfTheBoyne(): void $holiday = new Holiday( 'battleOfTheBoyne', ['en' => 'Battle of the Boyne'], - new \DateTime($this->year.'-7-12', DateTimeZoneFactory::getDateTimeZone($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 258d26b93..e0b14b02f 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Scotland.php +++ b/src/Yasumi/Provider/UnitedKingdom/Scotland.php @@ -1,8 +1,11 @@ year.'-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year . '-11-30', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK ); diff --git a/src/Yasumi/Provider/UnitedKingdom/Wales.php b/src/Yasumi/Provider/UnitedKingdom/Wales.php index 21a6bc1f9..a59defc64 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Wales.php +++ b/src/Yasumi/Provider/UnitedKingdom/Wales.php @@ -1,8 +1,11 @@ substitutedHoliday = $substitutedHoliday; - $key = 'substituteHoliday:'.$substitutedHoliday->getKey(); + $key = 'substituteHoliday:' . $substitutedHoliday->getKey(); if ($date == $substitutedHoliday) { throw new \InvalidArgumentException('Date must differ from the substituted holiday'); diff --git a/src/Yasumi/Translations.php b/src/Yasumi/Translations.php index 7d1f93ca8..e7ec9a248 100644 --- a/src/Yasumi/Translations.php +++ b/src/Yasumi/Translations.php @@ -1,9 +1,11 @@ getFilename(); - $key = $file->getBasename('.'.$extension); + $key = $file->getBasename('.' . $extension); - $translations = require $directoryPath.$filename; + $translations = require $directoryPath . $filename; if (\is_array($translations)) { foreach (array_keys($translations) as $locale) { diff --git a/src/Yasumi/TranslationsInterface.php b/src/Yasumi/TranslationsInterface.php index 717d848fd..4adfe4b50 100644 --- a/src/Yasumi/TranslationsInterface.php +++ b/src/Yasumi/TranslationsInterface.php @@ -1,9 +1,11 @@ loadTranslations(__DIR__.'/data/translations'); + self::$globalTranslations->loadTranslations(__DIR__ . '/data/translations'); } // Assert locale input @@ -158,7 +160,7 @@ public static function create(string $class, int $year = self::YEAR_LOWER_BOUND, */ public static function getAvailableLocales(): array { - return require __DIR__.'/data/locales.php'; + return require __DIR__ . '/data/locales.php'; } /** @@ -212,7 +214,7 @@ public static function getProviders(): array $providers = []; $filesIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( - __DIR__.\DIRECTORY_SEPARATOR.'Provider', + __DIR__ . \DIRECTORY_SEPARATOR . 'Provider', \FilesystemIterator::SKIP_DOTS ), \RecursiveIteratorIterator::SELF_FIRST); diff --git a/src/Yasumi/data/locales.php b/src/Yasumi/data/locales.php index 35917a5d4..9e465b29e 100644 --- a/src/Yasumi/data/locales.php +++ b/src/Yasumi/data/locales.php @@ -1,8 +1,11 @@ between( new \DateTime('03/25/2011', new \DateTimeZone($timezone)), - new \DateTime('05/17/'.$year, new \DateTimeZone($timezone)) + new \DateTime('05/17/' . $year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -232,7 +235,7 @@ public function testHolidaysBetweenDateRangeWithEndAfterInstanceYear(): void $holidays = Yasumi::create('Italy', $year); $between = $holidays->between( - new \DateTime('03/25/'.$year, new \DateTimeZone($timezone)), + new \DateTime('03/25/' . $year, new \DateTimeZone($timezone)), new \DateTime('09/21/2021', new \DateTimeZone($timezone)) ); @@ -269,8 +272,8 @@ public function testWrongDates(): void $holidays = Yasumi::create('USA', $year); $holidays->between( - new \DateTime('12/31/'.$year, new \DateTimeZone($timezone)), - new \DateTime('01/01/'.$year, new \DateTimeZone($timezone)) + new \DateTime('12/31/' . $year, new \DateTimeZone($timezone)), + new \DateTime('01/01/' . $year, new \DateTimeZone($timezone)) ); } @@ -289,8 +292,8 @@ public function testCountBetweenWithSubstitutes(): void $holidays = Yasumi::create('Ireland', $year); $between = $holidays->between( - new \DateTime('01/01/'.$year, new \DateTimeZone($timezone)), - new \DateTime('12/31/'.$year, new \DateTimeZone($timezone)) + new \DateTime('01/01/' . $year, new \DateTimeZone($timezone)), + new \DateTime('12/31/' . $year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -329,8 +332,8 @@ public function testCountBetweenExcludingSubstituteHoliday(): void $holidays = Yasumi::create('Ireland', $year); $between = $holidays->between( - new \DateTime('01/01/'.$year, new \DateTimeZone($timezone)), - new \DateTime('03/20/'.$year, new \DateTimeZone($timezone)) + new \DateTime('01/01/' . $year, new \DateTimeZone($timezone)), + new \DateTime('03/20/' . $year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -373,8 +376,8 @@ public function testCountBetweenExcludingSubstituteHolidayIncludingOriginalHolid $holidays = Yasumi::create('Ireland', $year); $between = $holidays->between( - new \DateTime('01/01/'.$year, new \DateTimeZone($timezone)), - new \DateTime('03/18/'.$year, new \DateTimeZone($timezone)) + new \DateTime('01/01/' . $year, new \DateTimeZone($timezone)), + new \DateTime('03/18/' . $year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -418,8 +421,8 @@ public function testCountBetweenExcludingSubstituteHolidayAndOriginalHoliday(): $holidays = Yasumi::create('Ireland', $year); $between = $holidays->between( - new \DateTime('01/01/'.$year, new \DateTimeZone($timezone)), - new \DateTime('03/16/'.$year, new \DateTimeZone($timezone)) + new \DateTime('01/01/' . $year, new \DateTimeZone($timezone)), + new \DateTime('03/16/' . $year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); diff --git a/tests/Base/HolidayFiltersTest.php b/tests/Base/HolidayFiltersTest.php index 3fbcd82fa..b9ce89597 100644 --- a/tests/Base/HolidayFiltersTest.php +++ b/tests/Base/HolidayFiltersTest.php @@ -1,8 +1,11 @@ getName()); - self::assertEquals('substituteHoliday:'.$name, $substitute->getName()); + self::assertEquals('substituteHoliday:' . $name, $substitute->getName()); } /** @throws \Exception */ diff --git a/tests/Base/TranslationsTest.php b/tests/Base/TranslationsTest.php index 0ef705eab..cd3640482 100644 --- a/tests/Base/TranslationsTest.php +++ b/tests/Base/TranslationsTest.php @@ -1,8 +1,11 @@ [$key.'.php' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.php' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); @@ -181,7 +184,7 @@ public function testNotLoadingTranslationsFromFileWithInvalidExtension(): void ]; FILE; - vfsStream::setup('root', null, ['lang' => [$key.'.translation' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.translation' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); @@ -203,7 +206,7 @@ public function testLoadingTranslationsFromDirectoryWithUnknownLocaleException() ]; FILE; - vfsStream::setup('root', null, ['lang' => [$key.'.php' => $fileContents]]); + vfsStream::setup('root', null, ['lang' => [$key . '.php' => $fileContents]]); $translations = new Translations(self::LOCALES); $translations->loadTranslations(vfsStream::url('root/lang')); @@ -242,8 +245,8 @@ public function testLoadingMultipleTranslationsFromDirectory(): void vfsStream::setup('root', null, [ 'lang' => [ - $firstIdentifier.'.php' => $firstFileContents, - $secondIdentifier.'.php' => $secondFileContents, + $firstIdentifier . '.php' => $firstFileContents, + $secondIdentifier . '.php' => $secondFileContents, ], ]); diff --git a/tests/Base/TypographyTest.php b/tests/Base/TypographyTest.php index 913bdbb6d..bcf9d3321 100644 --- a/tests/Base/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -1,9 +1,11 @@ isHoliday(new \DateTime($date)); @@ -296,7 +299,7 @@ public function testIsNotHoliday(): void { $year = 5220; $provider = 'Japan'; - $date = $year.'-06-10'; + $date = $year . '-06-10'; // Assertion using a DateTime instance $isHoliday = Yasumi::create($provider, $year)->isHoliday(new \DateTime($date)); @@ -323,7 +326,7 @@ public function testIsWorkingDay(): void { $year = 2020; $provider = 'Netherlands'; - $date = $year.'-06-02'; + $date = $year . '-06-02'; // Assertion using a DateTime instance $isWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTime($date)); @@ -350,7 +353,7 @@ public function testIsNotWorkingDay(): void { $year = 2016; $provider = 'Japan'; - $date = $year.'-01-11'; + $date = $year . '-01-11'; // Assertion using a DateTime instance $isNotWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTime($date)); diff --git a/tests/Base/YasumiWorkdayTest.php b/tests/Base/YasumiWorkdayTest.php index c4a971d5c..e83fc34b9 100644 --- a/tests/Base/YasumiWorkdayTest.php +++ b/tests/Base/YasumiWorkdayTest.php @@ -1,8 +1,11 @@ + */ namespace Yasumi\tests\Georgia; diff --git a/tests/Georgia/GeorgiaBaseTestCase.php b/tests/Georgia/GeorgiaBaseTestCase.php index 98bbcde79..aba2854b9 100644 --- a/tests/Georgia/GeorgiaBaseTestCase.php +++ b/tests/Georgia/GeorgiaBaseTestCase.php @@ -1,9 +1,11 @@ generateRandomYear(); $time_stamp = strtotime( - $year.'-03-21'.easter_days($year).' day + 49 day' + $year . '-03-21' . easter_days($year) . ' day + 49 day' ); $date = date('Y-m-d', $time_stamp); diff --git a/tests/Germany/ReformationDay2017Test.php b/tests/Germany/ReformationDay2017Test.php index 52a876dfd..64f5d767c 100644 --- a/tests/Germany/ReformationDay2017Test.php +++ b/tests/Germany/ReformationDay2017Test.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next tuesday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/Ireland/EasterMondayTest.php b/tests/Ireland/EasterMondayTest.php index a5865fdd2..f035aeebb 100644 --- a/tests/Ireland/EasterMondayTest.php +++ b/tests/Ireland/EasterMondayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/Ireland/OctoberHolidayTest.php b/tests/Ireland/OctoberHolidayTest.php index f1bb56ad7..1921bea4e 100644 --- a/tests/Ireland/OctoberHolidayTest.php +++ b/tests/Ireland/OctoberHolidayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/Ireland/StStephensDayTest.php b/tests/Ireland/StStephensDayTest.php index d3598fe28..7bacde176 100644 --- a/tests/Ireland/StStephensDayTest.php +++ b/tests/Ireland/StStephensDayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/Ireland/pentecostMondayTest.php b/tests/Ireland/pentecostMondayTest.php index ab6356079..49ccfaaef 100644 --- a/tests/Ireland/pentecostMondayTest.php +++ b/tests/Ireland/pentecostMondayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-5-6", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/ComingOfAgeDayTest.php b/tests/Japan/ComingOfAgeDayTest.php index b41d4864c..86a017c5a 100644 --- a/tests/Japan/ComingOfAgeDayTest.php +++ b/tests/Japan/ComingOfAgeDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-5-6", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/CoronationDayTest.php b/tests/Japan/CoronationDayTest.php index 46891f10d..da3d5fb82 100644 --- a/tests/Japan/CoronationDayTest.php +++ b/tests/Japan/CoronationDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-11-4", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/EmperorsBirthdayTest.php b/tests/Japan/EmperorsBirthdayTest.php index ccd57d219..068e8dab1 100644 --- a/tests/Japan/EmperorsBirthdayTest.php +++ b/tests/Japan/EmperorsBirthdayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-12-24", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/EnthronementProclamationCeremonyTest.php b/tests/Japan/EnthronementProclamationCeremonyTest.php index b7d9cafce..8a3c7b79b 100644 --- a/tests/Japan/EnthronementProclamationCeremonyTest.php +++ b/tests/Japan/EnthronementProclamationCeremonyTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-5-6", new \DateTimeZone(self::TIMEZONE)) ); @@ -92,7 +95,7 @@ public function testHolidayBetween1989And2007SubstitutedNextWorkingDay(): void $year = 2001; $this->assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-4-30", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/JapanBaseTestCase.php b/tests/Japan/JapanBaseTestCase.php index 4e1de357c..2f3632964 100644 --- a/tests/Japan/JapanBaseTestCase.php +++ b/tests/Japan/JapanBaseTestCase.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-11-24", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/MarineDayTest.php b/tests/Japan/MarineDayTest.php index 7cecbe5a5..ff800ba81 100644 --- a/tests/Japan/MarineDayTest.php +++ b/tests/Japan/MarineDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-7-21", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/MountainDayTest.php b/tests/Japan/MountainDayTest.php index 82dff86e3..3e78396c1 100644 --- a/tests/Japan/MountainDayTest.php +++ b/tests/Japan/MountainDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-8-12", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/NationalFoundationDayTest.php b/tests/Japan/NationalFoundationDayTest.php index 9b44ebac1..f2c44dd7e 100644 --- a/tests/Japan/NationalFoundationDayTest.php +++ b/tests/Japan/NationalFoundationDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-2-12", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/NewYearsDayTest.php b/tests/Japan/NewYearsDayTest.php index 20ee8384d..de73f3880 100644 --- a/tests/Japan/NewYearsDayTest.php +++ b/tests/Japan/NewYearsDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-1-2", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/PublicBridgeDayTest.php b/tests/Japan/PublicBridgeDayTest.php index 57888876a..ee83c4bd9 100644 --- a/tests/Japan/PublicBridgeDayTest.php +++ b/tests/Japan/PublicBridgeDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::HOLIDAY.'1', + self::HOLIDAY . '1', $this->year, new \DateTime("{$this->year}-4-30", new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, - self::HOLIDAY.'2', + self::HOLIDAY . '2', $this->year, new \DateTime("{$this->year}-5-2", new \DateTimeZone(self::TIMEZONE)) ); @@ -66,7 +69,7 @@ public function testPublicBridgeDay(): void */ public function testTranslation(): void { - $this->assertTranslatedHolidayName(self::REGION, self::HOLIDAY.'1', $this->year, [self::LOCALE => '国民の休日']); + $this->assertTranslatedHolidayName(self::REGION, self::HOLIDAY . '1', $this->year, [self::LOCALE => '国民の休日']); } /** @@ -74,6 +77,6 @@ public function testTranslation(): void */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY.'1', $this->year, Holiday::TYPE_OFFICIAL); + $this->assertHolidayType(self::REGION, self::HOLIDAY . '1', $this->year, Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Japan/RespectForTheAgedDayTest.php b/tests/Japan/RespectForTheAgedDayTest.php index 3e22e866a..6049e054b 100644 --- a/tests/Japan/RespectForTheAgedDayTest.php +++ b/tests/Japan/RespectForTheAgedDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-9-16", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/ShowaDayTest.php b/tests/Japan/ShowaDayTest.php index eab7e362f..0c81b4d1c 100644 --- a/tests/Japan/ShowaDayTest.php +++ b/tests/Japan/ShowaDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-4-30", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/SportsDayTest.php b/tests/Japan/SportsDayTest.php index 5fc299a8b..a0310a248 100644 --- a/tests/Japan/SportsDayTest.php +++ b/tests/Japan/SportsDayTest.php @@ -1,8 +1,11 @@ assertHoliday( self::REGION, - self::SUBSTITUTE_PREFIX.self::HOLIDAY, + self::SUBSTITUTE_PREFIX . self::HOLIDAY, $year, new \DateTime("{$year}-10-11", new \DateTimeZone(self::TIMEZONE)) ); diff --git a/tests/Japan/VernalEquinoxDayTest.php b/tests/Japan/VernalEquinoxDayTest.php index 9eb842e8e..afb09dade 100644 --- a/tests/Japan/VernalEquinoxDayTest.php +++ b/tests/Japan/VernalEquinoxDayTest.php @@ -1,8 +1,11 @@ + */ namespace Yasumi\tests\Mexico; diff --git a/tests/Mexico/ChristmasTest.php b/tests/Mexico/ChristmasTest.php index 50d1f97de..2805ea2b9 100644 --- a/tests/Mexico/ChristmasTest.php +++ b/tests/Mexico/ChristmasTest.php @@ -1,8 +1,11 @@ + */ namespace Yasumi\tests\Mexico; diff --git a/tests/Mexico/VirginOfGuadalupeTest.php b/tests/Mexico/VirginOfGuadalupeTest.php index c8aa40089..f3ef2408e 100644 --- a/tests/Mexico/VirginOfGuadalupeTest.php +++ b/tests/Mexico/VirginOfGuadalupeTest.php @@ -1,6 +1,19 @@ + */ namespace Yasumi\tests\Mexico; diff --git a/tests/Netherlands/AscensionDayTest.php b/tests/Netherlands/AscensionDayTest.php index 7cd8a3195..fbd50b71f 100644 --- a/tests/Netherlands/AscensionDayTest.php +++ b/tests/Netherlands/AscensionDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(self::ESTABLISHMENT_YEAR); $expected = new \DateTime( - (($year < 1910) ? 'second wednesday of october' : 'fourth monday of october')." {$year}", + (($year < 1910) ? 'second wednesday of october' : 'fourth monday of october') . " {$year}", new \DateTimeZone(self::TIMEZONE) ); diff --git a/tests/NewZealand/NewYearsDayTest.php b/tests/NewZealand/NewYearsDayTest.php index 0235227af..fcfd109f8 100644 --- a/tests/NewZealand/NewYearsDayTest.php +++ b/tests/NewZealand/NewYearsDayTest.php @@ -1,8 +1,11 @@ add(new \DateInterval('P'.$easter_days.'D')); + $easter->add(new \DateInterval('P' . $easter_days . 'D')); return $easter; } diff --git a/tests/Romania/AssumptionOfMaryTest.php b/tests/Romania/AssumptionOfMaryTest.php index 62b6e71a7..8ec922302 100644 --- a/tests/Romania/AssumptionOfMaryTest.php +++ b/tests/Romania/AssumptionOfMaryTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/FamilyDayTest.php b/tests/SouthAfrica/FamilyDayTest.php index 3ba096b5a..909f05e58 100644 --- a/tests/SouthAfrica/FamilyDayTest.php +++ b/tests/SouthAfrica/FamilyDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/GoodFridayTest.php b/tests/SouthAfrica/GoodFridayTest.php index 60148fabe..9b35b3aaf 100644 --- a/tests/SouthAfrica/GoodFridayTest.php +++ b/tests/SouthAfrica/GoodFridayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/HumanRightsDayTest.php b/tests/SouthAfrica/HumanRightsDayTest.php index 140196022..05bd17211 100644 --- a/tests/SouthAfrica/HumanRightsDayTest.php +++ b/tests/SouthAfrica/HumanRightsDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/MunicipalElections2016DayTest.php b/tests/SouthAfrica/MunicipalElections2016DayTest.php index 45ba0b67a..84513dfe5 100644 --- a/tests/SouthAfrica/MunicipalElections2016DayTest.php +++ b/tests/SouthAfrica/MunicipalElections2016DayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/NewYearsDayTest.php b/tests/SouthAfrica/NewYearsDayTest.php index f37033346..20f989c6c 100644 --- a/tests/SouthAfrica/NewYearsDayTest.php +++ b/tests/SouthAfrica/NewYearsDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/ReconciliationDayTest.php b/tests/SouthAfrica/ReconciliationDayTest.php index 47199f0a9..9e9f1561c 100644 --- a/tests/SouthAfrica/ReconciliationDayTest.php +++ b/tests/SouthAfrica/ReconciliationDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/SecondChristmasDayTest.php b/tests/SouthAfrica/SecondChristmasDayTest.php index 44f9f09a0..ba97fa6b1 100644 --- a/tests/SouthAfrica/SecondChristmasDayTest.php +++ b/tests/SouthAfrica/SecondChristmasDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/SouthAfricaBaseTestCase.php b/tests/SouthAfrica/SouthAfricaBaseTestCase.php index eee3b1b57..e98efa0d5 100644 --- a/tests/SouthAfrica/SouthAfricaBaseTestCase.php +++ b/tests/SouthAfrica/SouthAfricaBaseTestCase.php @@ -1,9 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthAfrica/YouthDayTest.php b/tests/SouthAfrica/YouthDayTest.php index a38271a88..1e8dd5e9a 100644 --- a/tests/SouthAfrica/YouthDayTest.php +++ b/tests/SouthAfrica/YouthDayTest.php @@ -1,8 +1,11 @@ format('w')) { $date->add(new \DateInterval('P1D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/SouthKorea/ArborDayTest.php b/tests/SouthKorea/ArborDayTest.php index c93ff92a4..9cdf7f4dc 100644 --- a/tests/SouthKorea/ArborDayTest.php +++ b/tests/SouthKorea/ArborDayTest.php @@ -1,9 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Bern/BernBaseTestCase.php b/tests/Switzerland/Bern/BernBaseTestCase.php index 16b755b95..526a7c5b9 100644 --- a/tests/Switzerland/Bern/BernBaseTestCase.php +++ b/tests/Switzerland/Bern/BernBaseTestCase.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Fribourg/ChristmasDayTest.php b/tests/Switzerland/Fribourg/ChristmasDayTest.php index b403b28c2..189ecd63e 100644 --- a/tests/Switzerland/Fribourg/ChristmasDayTest.php +++ b/tests/Switzerland/Fribourg/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(1870, 1965); // Find first Sunday of September - $date = new \DateTime('First Sunday of '.$year.'-09', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime('First Sunday of ' . $year . '-09', new \DateTimeZone(self::TIMEZONE)); // Go to next Thursday $date->add(new \DateInterval('P4D')); @@ -54,7 +57,7 @@ public function testJeuneGenevoisBetween1840And1869(): void { $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)); + $date = new \DateTime('First Sunday of ' . $year . '-09', new \DateTimeZone(self::TIMEZONE)); // Go to next Thursday $date->add(new \DateInterval('P4D')); diff --git a/tests/Switzerland/Geneva/NewYearsDayTest.php b/tests/Switzerland/Geneva/NewYearsDayTest.php index 7c02946a7..e17861f8b 100644 --- a/tests/Switzerland/Geneva/NewYearsDayTest.php +++ b/tests/Switzerland/Geneva/NewYearsDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Glarus/ChristmasDayTest.php b/tests/Switzerland/Glarus/ChristmasDayTest.php index f492a03b9..9a99a5b39 100644 --- a/tests/Switzerland/Glarus/ChristmasDayTest.php +++ b/tests/Switzerland/Glarus/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new \DateTime('First Thursday of '.$year.'-04', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime('First Thursday of ' . $year . '-04', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } diff --git a/tests/Switzerland/Glarus/NewYearsDayTest.php b/tests/Switzerland/Glarus/NewYearsDayTest.php index 590e512c3..eef7dc1c9 100644 --- a/tests/Switzerland/Glarus/NewYearsDayTest.php +++ b/tests/Switzerland/Glarus/NewYearsDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Jura/BettagsMontagTest.php b/tests/Switzerland/Jura/BettagsMontagTest.php index 3064c4486..101d0c521 100644 --- a/tests/Switzerland/Jura/BettagsMontagTest.php +++ b/tests/Switzerland/Jura/BettagsMontagTest.php @@ -1,8 +1,11 @@ generateRandomYear(1832); // Find third Sunday of September - $date = new \DateTime('Third Sunday of '.$year.'-09', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime('Third Sunday of ' . $year . '-09', new \DateTimeZone(self::TIMEZONE)); // Go to next Thursday $date->add(new \DateInterval('P1D')); diff --git a/tests/Switzerland/Jura/ChristmasDayTest.php b/tests/Switzerland/Jura/ChristmasDayTest.php index 12b6cbc4b..497d27546 100644 --- a/tests/Switzerland/Jura/ChristmasDayTest.php +++ b/tests/Switzerland/Jura/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Lucerne/ChristmasDayTest.php b/tests/Switzerland/Lucerne/ChristmasDayTest.php index 286c4de51..902103361 100644 --- a/tests/Switzerland/Lucerne/ChristmasDayTest.php +++ b/tests/Switzerland/Lucerne/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(1832); // Find third Sunday of September - $date = new \DateTime('Third Sunday of '.$year.'-09', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime('Third Sunday of ' . $year . '-09', new \DateTimeZone(self::TIMEZONE)); // Go to next Thursday $date->add(new \DateInterval('P1D')); diff --git a/tests/Switzerland/Neuchatel/ChristmasDayTest.php b/tests/Switzerland/Neuchatel/ChristmasDayTest.php index 55702460a..7a67c3d84 100644 --- a/tests/Switzerland/Neuchatel/ChristmasDayTest.php +++ b/tests/Switzerland/Neuchatel/ChristmasDayTest.php @@ -1,8 +1,11 @@ assertNotHoliday( self::REGION, diff --git a/tests/Switzerland/Neuchatel/EasterMondayTest.php b/tests/Switzerland/Neuchatel/EasterMondayTest.php index 5c7b1eeb6..b866834be 100644 --- a/tests/Switzerland/Neuchatel/EasterMondayTest.php +++ b/tests/Switzerland/Neuchatel/EasterMondayTest.php @@ -1,8 +1,11 @@ assertNotHoliday( self::REGION, diff --git a/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php b/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php index f801e056c..85406b8d5 100644 --- a/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php +++ b/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php index a7b8811cf..d3d5befea 100644 --- a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php +++ b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php @@ -1,8 +1,11 @@ generateRandomYear(1947); - $date = new \DateTime($year.'-09-25', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-09-25', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); @@ -49,7 +52,7 @@ public function testBruderKlausenFestOnAfter1947(): void public function testBruderKlausenFestBetween1649And1946(): void { $year = $this->generateRandomYear(1649, 1946); - $date = new \DateTime($year.'-09-21', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-09-21', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Obwalden/ChristmasDayTest.php b/tests/Switzerland/Obwalden/ChristmasDayTest.php index 7467fec14..224330c64 100644 --- a/tests/Switzerland/Obwalden/ChristmasDayTest.php +++ b/tests/Switzerland/Obwalden/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php index 9d4edda92..a44947a49 100644 --- a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php +++ b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Solothurn/ChristmasDayTest.php b/tests/Switzerland/Solothurn/ChristmasDayTest.php index 599f801c3..dd0d43ed4 100644 --- a/tests/Switzerland/Solothurn/ChristmasDayTest.php +++ b/tests/Switzerland/Solothurn/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Thurgau/ChristmasDayTest.php b/tests/Switzerland/Thurgau/ChristmasDayTest.php index 908fb1e04..3c5c99fc9 100644 --- a/tests/Switzerland/Thurgau/ChristmasDayTest.php +++ b/tests/Switzerland/Thurgau/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Vaud/BettagsMontagTest.php b/tests/Switzerland/Vaud/BettagsMontagTest.php index 8b0e91909..368a363e3 100644 --- a/tests/Switzerland/Vaud/BettagsMontagTest.php +++ b/tests/Switzerland/Vaud/BettagsMontagTest.php @@ -1,8 +1,11 @@ generateRandomYear(1832); // Find third Sunday of September - $date = new \DateTime('Third Sunday of '.$year.'-09', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime('Third Sunday of ' . $year . '-09', new \DateTimeZone(self::TIMEZONE)); // Go to next Thursday $date->add(new \DateInterval('P1D')); diff --git a/tests/Switzerland/Vaud/ChristmasDayTest.php b/tests/Switzerland/Vaud/ChristmasDayTest.php index 9301bd460..8a3637139 100644 --- a/tests/Switzerland/Vaud/ChristmasDayTest.php +++ b/tests/Switzerland/Vaud/ChristmasDayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); - $date = new \DateTime($year.'-01-02', new \DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($year . '-01-02', new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); diff --git a/tests/Switzerland/Zug/ChristmasDayTest.php b/tests/Switzerland/Zug/ChristmasDayTest.php index 0c4be41fe..8efb9e1b2 100644 --- a/tests/Switzerland/Zug/ChristmasDayTest.php +++ b/tests/Switzerland/Zug/ChristmasDayTest.php @@ -1,8 +1,11 @@ isHoliday($holidayOfficial)); self::assertEquals(Holiday::TYPE_OFFICIAL, $holidayOfficial->getType()); - $holidaySubstitution = $holidays->getHoliday('substituteHoliday:'.$holidayOfficial->getKey()); + $holidaySubstitution = $holidays->getHoliday('substituteHoliday:' . $holidayOfficial->getKey()); if (! $expectedSubstitution instanceof \DateTimeInterface) { // without substitution diff --git a/tests/Ukraine/UkraineBaseTestCase.php b/tests/Ukraine/UkraineBaseTestCase.php index b9ad9b170..8dbd4567d 100644 --- a/tests/Ukraine/UkraineBaseTestCase.php +++ b/tests/Ukraine/UkraineBaseTestCase.php @@ -1,8 +1,11 @@ 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); + $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 d28c1e02f..93827c0ae 100644 --- a/tests/UnitedKingdom/ChristmasDayTest.php +++ b/tests/UnitedKingdom/ChristmasDayTest.php @@ -1,8 +1,11 @@ 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); + $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/EasterMondayTest.php b/tests/UnitedKingdom/EasterMondayTest.php index c8e6f51a2..309d2082f 100644 --- a/tests/UnitedKingdom/EasterMondayTest.php +++ b/tests/UnitedKingdom/EasterMondayTest.php @@ -1,8 +1,11 @@ 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); + $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 ccb38f337..3cd366bca 100644 --- a/tests/UnitedKingdom/England/ChristmasDayTest.php +++ b/tests/UnitedKingdom/England/ChristmasDayTest.php @@ -1,8 +1,11 @@ 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); + $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/EasterMondayTest.php b/tests/UnitedKingdom/England/EasterMondayTest.php index 9f71c5ea2..53ddde421 100644 --- a/tests/UnitedKingdom/England/EasterMondayTest.php +++ b/tests/UnitedKingdom/England/EasterMondayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php index 9af416e6c..6dfeac991 100644 --- a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php @@ -1,8 +1,11 @@ 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); + $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 e8e7fbaf0..e54f944cc 100644 --- a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php @@ -1,8 +1,11 @@ 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); + $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/EasterMondayTest.php b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php index ab46f8a46..912e35572 100644 --- a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php index fe912a8c3..a9198c914 100644 --- a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php @@ -1,8 +1,11 @@ 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); + $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 b089a2ba3..2a12100b7 100644 --- a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php @@ -1,8 +1,11 @@ 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); + $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/GoodFridayTest.php b/tests/UnitedKingdom/Scotland/GoodFridayTest.php index caf8d596f..7369c6a8d 100644 --- a/tests/UnitedKingdom/Scotland/GoodFridayTest.php +++ b/tests/UnitedKingdom/Scotland/GoodFridayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->add(new \DateInterval('P2D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php b/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php index b62cb9b0c..c76e60658 100644 --- a/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php +++ b/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->add(new \DateInterval('P2D')); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php index 5ea15793a..df7799ba9 100644 --- a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php @@ -1,8 +1,11 @@ format('w'), [0, 6], true)) { $date->modify('next monday'); - $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); + $this->assertHoliday(self::REGION, 'substituteHoliday:' . self::HOLIDAY, $year, $date); } } diff --git a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php index 3d24bb8e2..c7c1c959d 100644 --- a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php @@ -1,8 +1,11 @@ generateRandomYear(); diff --git a/tests/UnitedKingdom/Wales/BoxingDayTest.php b/tests/UnitedKingdom/Wales/BoxingDayTest.php index 2fd34f441..9f770fcb6 100644 --- a/tests/UnitedKingdom/Wales/BoxingDayTest.php +++ b/tests/UnitedKingdom/Wales/BoxingDayTest.php @@ -1,8 +1,11 @@ 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); + $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 83ef0087d..1a4114773 100644 --- a/tests/UnitedKingdom/Wales/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Wales/ChristmasDayTest.php @@ -1,8 +1,11 @@ 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); + $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/EasterMondayTest.php b/tests/UnitedKingdom/Wales/EasterMondayTest.php index 5154f67d5..1c825e6b6 100644 --- a/tests/UnitedKingdom/Wales/EasterMondayTest.php +++ b/tests/UnitedKingdom/Wales/EasterMondayTest.php @@ -1,8 +1,11 @@ getHoliday('substituteHoliday:'.$key); + $holiday = $holidays->getHoliday('substituteHoliday:' . $key); self::assertInstanceOf(SubstituteHoliday::class, $holiday); $this->assertDateTime($expected, $holiday); @@ -152,7 +154,7 @@ public function assertNotSubstituteHoliday( ): void { $this->assertNotHoliday( $provider, - 'substituteHoliday:'.$key, + 'substituteHoliday:' . $key, $year ); }