diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..d3ff85a66 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.php] +indent_size = 4 + +[*.json] +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 + diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index bb06be3b9..4d2f0d8fd 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: [ '7.4', '8.0' ] + php-versions: [ '7.4', '8.0', '8.1', '8.2'] steps: - name: Set git to use LF @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3.2.0 with: fetch-depth: 1 @@ -30,17 +30,17 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: pcov + extensions: intl - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Check Composer configuration run: composer validate --strict @@ -50,3 +50,6 @@ jobs: - name: Check Code Style run: vendor/bin/php-cs-fixer --diff --dry-run -v fix + env: + PHP_CS_FIXER_IGNORE_ENV: 1 + diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml deleted file mode 100644 index 65b72feaa..000000000 --- a/.github/workflows/mutation-tests.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: "Mutations testing" - -on: - - push - - pull_request - -jobs: - run: - name: "CI" - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ ubuntu-latest ] - php-versions: [ '7.4', '8.0' ] - - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 1 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: pcov - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Check Composer configuration - run: composer validate --strict - - - name: Install dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Run Mutation tests - run: vendor/bin/infection run -j 2 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 4f157e7ac..435ab1ab5 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: [ '7.4', '8.0' ] + php-versions: [ '7.4', '8.0', '8.1', '8.2' ] steps: - name: Set git to use LF @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3.2.0 with: fetch-depth: 1 @@ -30,17 +30,17 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: pcov + extensions: intl - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Check Composer configuration run: composer validate --strict diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 945e33fff..d36323dfe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: [ '7.4', '8.0' ] + php-versions: [ '7.4', '8.0', '8.1', '8.2' ] steps: - name: Set git to use LF @@ -21,7 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3.2.0 with: fetch-depth: 1 @@ -30,17 +30,17 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: pcov + extensions: intl, calendar - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Check Composer configuration run: composer validate --strict diff --git a/.gitignore b/.gitignore index b71a1e059..00cc7cd98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ .DS_Store .idea/ -vendor -composer.lock .php-cs-fixer.cache .php_cs.cache -bin/_* .phpunit.result.cache +bin/_* +composer.lock var +vendor diff --git a/.phan/config.php b/.phan/config.php index 8d583c969..242a55d5c 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -291,7 +291,8 @@ // should be added to the `directory_list` as well as // to `exclude_analysis_directory_list`. 'exclude_analysis_directory_list' => [ - 'vendor/', + 'vendor/', + 'examples/' ], // Enable this to enable checks of require/include statements referring to valid paths. @@ -349,7 +350,8 @@ // Thus, both first-party and third-party code being used by // your application should be included in this list. 'directory_list' => [ - 'src', + 'src', + 'examples' ], // A list of individual files to include in analysis diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 633b53776..e134debc6 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -1,9 +1,11 @@ -setRiskyAllowed(true)->setRules([ - '@Symfony' => true, - 'blank_line_after_opening_tag' => true, - 'is_null' => true, - 'modernize_types_casting' => true, - 'self_accessor' => true, - 'dir_constant' => true, - 'ordered_class_elements' => true, - 'declare_strict_types' => true, - 'no_superfluous_elseif' => true, - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, + '@Symfony' => true, + '@PER' => true, + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'declare_strict_types' => true, + 'no_superfluous_elseif' => true, + 'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true], + + // Risky rules + 'dir_constant' => true, + 'get_class_to_class_keyword' => true, + 'is_null' => true, + 'modernize_strpos' => true, + 'modernize_types_casting' => true, + 'self_accessor' => true, ])->setFinder($finder); return $config; diff --git a/CHANGELOG.md b/CHANGELOG.md index e292b5485..0a5ba753a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org). +Changes related to the business logic of the holidays or their providers are listed first, followed by any technical or architectural +changes. + ## [Unreleased] ### Added @@ -13,10 +16,78 @@ to [Semantic Versioning](https://semver.org). ### Fixed -### Deprecated +### Removed + +## [2.6.0] - 2023-04-27 + +### Added + +- Bank holiday for King Charles III’s Coronation in the United Kingdom. [\#305](https://github.com/azuyalabs/yasumi/pull/305) ([Freshleaf Media](https://www.github.com/freshleafmedia)) +- Bank holiday for Queen Elizabeth II’s State Funeral on September 19, 2022, for the United Kingdom. [\#287](https://github.com/azuyalabs/yasumi/pull/287) ([Freshleaf Media](https://www.github.com/freshleafmedia)) +- National Day of Mourning for Australia. [\#288](https://github.com/azuyalabs/yasumi/pull/288) ([FuzzyWuzzyFraggle](https://www.github.com/FuzzyWuzzyFraggle)). +- In Japan, Marine Day was rescheduled to July 23 as the 2020 Tokyo Olympics took place. The rescheduled Marine Day for + 2021 was included, but not the original rescheduled day for 2020. +- Slovak translations for a couple of popular holidays. [\#298](https://github.com/azuyalabs/yasumi/pull/298) ([Jozef Grencik](https://www.github.com/jozefgrencik)) +- All examples as shown on the documentation site as a convenience to developers who like to have all information in a + single place. +- Included an `.editorconfig` file to maintain a consistent style for developers using different text editors. +- The `ext-intl` extension as a required extension. [\#306](https://github.com/azuyalabs/yasumi/pull/306) ([Freshleaf Media](https://www.github.com/freshleafmedia)) +- An exception is thrown in case the time stamp of the start and end date in the `dateTimeBetween` method can't be established. +- Checks in case getting transition details or a date interval subtraction fails. + +### Changed + +- Adjusted the visibility of the `calculateSummerWinterTime` method to `private` as it is an internal method and + shouldn't be accessible directly. +- Made the calculation for summer/winter time more defensive by adding a check that the timestamps are successfully created. +- Changed to use the `strtotime` function as `mktime` does not generate timestamps before 1970-01-01 (negative values), + which is needed to determine winter/summertime before that. +- Refactored summer and winter time tests for Denmark and The Netherlands by introducing a base class holding the domain + logic. +- Switched from `getShortName()` to `getName()` for the `ReflectionClass` created by the method `anotherTime()` in the + `AbstractProvider` class. Using `getShortName` could result in a `ProviderNotFoundException` for some custom holiday + providers, since the namespace is not fully qualified. This can happen, if you create a custom holiday provider. + [\#292](https://github.com/azuyalabs/yasumi/pull/292) ([SupraSmooth](https://github.com/SupraSmooth)). +- Replaced the use of the `DateTime` class with `DateTimeInterface` (always use interface where possible). +- Use the preferred/idiomatic way of getting an immutable date from a mutable one. Added extra checks if modifying date + methods are not successful. +- Split functions that generate random dates/years into a new trait to slim down the overgrown base trait. +- Code styling fixes and improvements. +- Upgraded dependencies to latest working versions. +- Improved and cleaned up numerous unit tests. + +### Fixed + +- Liberation Day for The Netherlands is only an official holiday every 5 years [\#280](https://github.com/azuyalabs/yasumi/pull/280) ([Daan Roet](https://github.com/droet)). +- Pentecost Monday in France was only recognized as an official holiday until 2004. Since 2004, it is considered a + special holiday, a so called 'working holiday'. Hence, it is therefore classified as an observed holiday in Yasumi + from 2004 and forward. [\#281](https://github.com/azuyalabs/yasumi/issues/281). +- The holiday of Epiphany (6th of January) was incorrectly categorized as `other` and changed to an official holiday in + Baden-Württemberg, Bavaria and SaxonyAnhalt. [\#296](https://github.com/azuyalabs/yasumi/issues/296) ([Anna Damm](https://github.com/AnnaDamm)). +- The year 1988 was incorrectly omitted from observing the Emperor's birthday in Japan. +- The tests for Remembrance Day, Malvina's Day and National Sovereignty Day in Argentina were considered for all years; + however, these have only been celebrated since their establishment. +- Tests for New Year's Day, Spring Bank Holiday, and May Day Holiday in the United Kingdom (England, Wales, Northern + Ireland, and Scotland), as well as Battle of the Boyne in Northern Ireland, were considered for any calendar year; + however, these are celebrated only since a particular calendar year. +- In version 2022f of the `tz` db, a correction for 1947 was made for the summertime transition in Denmark to April + the 6th. Various corrections have been made to accommodate for change. +- The `ProviderInterface::getHolidays` has been re-added after it was erroneously removed. [\#277](https://github.com/azuyalabs/yasumi/pull/277) ([Jakub Wojtyra](https://github.com/jwojtyra-aterian)). +- Created the interface methods of the `ProviderInterface` that the abstract provider class implements. Since the return + type of the Yasumi factory methods is now `ProviderInterface`, those missing methods generated errors, especially by + static analysers. +- Changed the visibility of various class methods back to `protected`. The visibility was accidentally reduced during a clean-up + of code. This caused these methods not being accessible any more when extending a provider class. ### Removed +- The `count` method from the `ProviderInterface` as the `AbstractProvider` class already implements the Countable interface. +- Unused `InvalidDateException` class and other unused imported classes. +- `tests` folder from analysis by PHPStan (the large number of files makes the analysis needlessly long). +- Redundant checks for empty arrays and types. +- Mutation testing from GitHub Actions, as currently the outcome is not actively used. Running mutation tests locally + should be sufficient. + ## [2.5.0] - 2022-01-30 ### Added @@ -687,7 +758,9 @@ to [Semantic Versioning](https://semver.org). - Initial Release -[Unreleased]: https://github.com/azuyalabs/yasumi/compare/2.5.0...HEAD +[Unreleased]: https://github.com/azuyalabs/yasumi/compare/2.6.0...HEAD + +[2.6.0]: https://github.com/azuyalabs/yasumi/compare/2.5.0...2.6.0 [2.5.0]: https://github.com/azuyalabs/yasumi/compare/2.4.0...2.5.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3317cab59..49c1c9f31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,8 +10,8 @@ When contributing there are a few guidelines we'd like you to keep in mind: - **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** Please use the following command after you have completed your work: - ``` bash - $ composer format + ``` shell + composer format ``` This will check/correct all the code for the PSR-12 Coding Standard using the @@ -20,9 +20,9 @@ When contributing there are a few guidelines we'd like you to keep in mind: - **Add unit tests!** - Your Pull Request won't be accepted if it does not have tests: 1. Ensure your new Holiday Provider contains all the necessary unit tests. - 2. Next to the file 'BaseTestCase.php', a file called 'Test.php' needs to be present. This + 2. Next to the file `{REGIONNAME}BaseTestCase.php`, a file called `{REGIONNAME}Test.php` needs to be present. This file needs to include region/country level tests and requires assertion of all expected holidays. - 3. All the unit tests and the implementation Holiday Provider require to have the correct locale, timezone and + 3. All the unit tests and the implementation Holiday Provider require to have the correct locale, time zone and region/country name. 4. As almost all tests use automatic iterations, make sure the year for which the test is executed is a valid year. Some holidays are only established from a certain year and having the test year number smaller than the minimum @@ -39,12 +39,12 @@ When contributing there are a few guidelines we'd like you to keep in mind: ## Running Tests -``` bash -$ composer test +``` shell +composer test ``` -or alternatively run with: +Or, alternatively run with: -``` bash -$ vendor/bin/phpunit +``` shell +vendor/bin/phpunit ``` diff --git a/LICENSE b/LICENSE index cd30fd146..5276fcb26 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 - 2022 AzuyaLabs +Copyright (c) 2015 - 2023 AzuyaLabs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 66ab67363..1e8cdb127 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![GitHub Release](https://img.shields.io/github/release/azuyalabs/yasumi.svg?style=flat-square)](https://github.com/azuyalabs/yasumi/releases) [![Total Downloads](https://img.shields.io/packagist/dt/azuyalabs/yasumi.svg?style=flat-square)](https://packagist.org/packages/azuyalabs/yasumi) -![Coding Standard](https://img.shields.io/github/workflow/status/azuyalabs/yasumi/Coding%20Standard?label=Coding%20Standard&style=flat-square) -![Static analysis](https://img.shields.io/github/workflow/status/azuyalabs/yasumi/Static%20analysis?label=Static%20analysis&style=flat-square) -![Testing](https://img.shields.io/github/workflow/status/azuyalabs/yasumi/Testing?label=Testing&style=flat-square) +![Coding Standard](https://img.shields.io/github/actions/workflow/status/azuyalabs/yasumi/coding-standard.yml?label=Coding%20Standard&style=flat-square) +![Static analysis](https://img.shields.io/github/actions/workflow/status/azuyalabs/yasumi/static-analysis.yml?label=Static%20analysis&style=flat-square) +![Testing](https://img.shields.io/github/actions/workflow/status/azuyalabs/yasumi/testing.yml?label=Testing&style=flat-square) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) # Introduction @@ -24,6 +24,7 @@ The goal of Yasumi is to be powerful while remaining lightweight, by utilizing P Yasumi's calculation is provider-based (i.e. by country/state), making it easy to add new holiday providers that calculate holidays. +- Pure PHP - Straightforward API - Framework-agnostic - Use of Providers to easily extend and expand new Holidays @@ -31,7 +32,7 @@ calculate holidays. - Accounts for the date/time when holidays have been officially established and/or abolished - Filters enabling to easily select certain holiday types (Official, Observed, Bank, Seasonal or Other) - Global Translations -- Timezone aware +- Time zone aware - Implements [ArrayIterator](https://www.php.net/manual/en/class.arrayiterator.php) to easily process a provider's holidays - Fully documented diff --git a/SECURITY.md b/SECURITY.md index 28269d629..63dc1a82c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,12 +6,13 @@ Please refer to the below table for the supported versions of Yasumi. | Version | Supported | | ------- | ------------------ | +| 2.6 | :white_check_mark: | | 2.5 | :white_check_mark: | | < 2.4 | :x: | | < 1.8 | :x: | -As for supported PHP versions, Yasumi supports only the actively supported versions of PHP. Currently, that is PHP 7.4, -and 8.0. Please refer to the [supported versions](https://www.php.net/supported-versions.php) page, to find more +As for supported PHP versions, Yasumi generally supports only the actively supported versions of PHP. +Please refer to the [supported versions](https://www.php.net/supported-versions.php) page, to find more details. When a version of PHP becomes EOL, generally a new release of Yasumi will be issued that sunsets the support of that retired PHP version. diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 index 342460ac4..5aa7bd19a --- a/composer.json +++ b/composer.json @@ -1,16 +1,8 @@ { "name": "azuyalabs/yasumi", - "type": "library", "description": "The easy PHP Library for calculating holidays.", "license": "MIT", - "authors": [ - { - "name": "Sacha Telgenhof", - "email": "me@sachatelgenhof.com", - "role": "Maintainer" - } - ], - "homepage": "https://www.yasumi.dev", + "type": "library", "keywords": [ "holiday", "holidays", @@ -23,6 +15,14 @@ "national" ], "readme": "README.md", + "authors": [ + { + "name": "Sacha Telgenhof", + "email": "me@sachatelgenhof.com", + "role": "Maintainer" + } + ], + "homepage": "https://www.yasumi.dev", "support": { "issues": "https://github.com/azuyalabs/yasumi/issues", "source": "https://github.com/azuyalabs/yasumi", @@ -34,27 +34,24 @@ "url": "https://www.buymeacoffee.com/sachatelgenhof" } ], - "prefer-stable": true, "require": { "php": ">=7.4", "ext-json": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "v2.19 | v3.5", - "infection/infection": "^0.17 | ^0.26", + "ext-intl": "*", + "friendsofphp/php-cs-fixer": "^2.19 || ^3.16", + "infection/infection": "^0.17 || ^0.26", "mikey179/vfsstream": "^1.6", - "phan/phan": "^5.2", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^8.5 | ^9.5", - "vimeo/psalm": "^4.9" + "phan/phan": "^5.4", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5 || ^9.6", + "vimeo/psalm": "^5.9" }, - "config": { - "sort-packages": true, - "allow-plugins": { - "composer/package-versions-deprecated": true, - "infection/extension-installer": true - } + "suggest": { + "ext-calendar": "For calculating the date of Easter" }, + "prefer-stable": true, "autoload": { "psr-4": { "Yasumi\\": "src/Yasumi/" @@ -65,19 +62,23 @@ "Yasumi\\tests\\": "tests/" } }, + "config": { + "allow-plugins": { + "composer/package-versions-deprecated": true, + "infection/extension-installer": true + }, + "sort-packages": true + }, "scripts": { - "format": "./vendor/bin/php-cs-fixer fix", - "phpstan": "vendor/bin/phpstan analyse", - "psalm": "vendor/bin/psalm --threads=2", - "phan": "vendor/bin/phan -C", - "test": "vendor/bin/phpunit", - "infection": "vendor/bin/infection run -j 2", "analyse": [ "@phpstan", "@psalm" - ] - }, - "suggest": { - "ext-calendar": "For calculating the date of Easter" + ], + "format": "./vendor/bin/php-cs-fixer fix", + "infection": "vendor/bin/infection run -j 2", + "phan": "vendor/bin/phan -C", + "phpstan": "vendor/bin/phpstan analyse", + "psalm": "vendor/bin/psalm --threads=2", + "test": "vendor/bin/phpunit" } } diff --git a/examples/basic.php b/examples/basic.php new file mode 100644 index 000000000..4407f7351 --- /dev/null +++ b/examples/basic.php @@ -0,0 +1,47 @@ +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; +foreach ($holidays->getHolidayNames() as $name) { + echo $name.PHP_EOL; +} +echo PHP_EOL; + +// Display a list all of the holiday dates +echo 'List of all the holiday dates:'.PHP_EOL; +foreach ($holidays->getHolidayDates() as $date) { + echo $date.PHP_EOL; +} +echo PHP_EOL; + +// Get a holiday instance for Independence Day +$independenceDay = $holidays->getHoliday('independenceDay'); + +// Show the localized name +echo 'Name of the holiday : '.$independenceDay->getName().PHP_EOL; + +// Show the date +echo 'Date of the holiday : '.$independenceDay.PHP_EOL; + +// Show the type of holiday +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 json_encode($independenceDay, JSON_PRETTY_PRINT); + +echo PHP_EOL; diff --git a/examples/between_filter.php b/examples/between_filter.php new file mode 100644 index 000000000..4b1358c9a --- /dev/null +++ b/examples/between_filter.php @@ -0,0 +1,27 @@ +between( + 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; +foreach ($holidaysInDecember as $holiday) { + echo $holiday.' - '.$holiday->getName().PHP_EOL; +} +echo PHP_EOL; + +// Show the number of filtered holidays +echo 'Number of filtered holidays: '.$holidaysInDecember->count().PHP_EOL; diff --git a/examples/custom_provider.php b/examples/custom_provider.php new file mode 100644 index 000000000..907b58698 --- /dev/null +++ b/examples/custom_provider.php @@ -0,0 +1,43 @@ +addHoliday($this->goodFriday($this->year, $this->timezone, $this->locale)); + + // Remove Columbus Day and Veterans Day + $this->removeHoliday('columbusDay'); + $this->removeHoliday('veteransDay'); + } +} + +// Use the factory method to create a new holiday provider instance +$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; +foreach ($NYSEHolidays->getHolidayNames() as $day) { + 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; diff --git a/examples/filters.php b/examples/filters.php new file mode 100644 index 000000000..3a82af460 --- /dev/null +++ b/examples/filters.php @@ -0,0 +1,20 @@ +getIterator()); + +echo 'List of all official holidays: '.PHP_EOL; +foreach ($official as $day) { + echo $day->getName().PHP_EOL; +} diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2faf82185..fad49a494 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,6 +2,7 @@ parameters: level: 6 paths: - src + - examples ignoreErrors: - message: '#Comparison operation "<=" between [0-9]+ and int<[0-9]+, max> is always true.#' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c7356f333..ba4a53739 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,7 +2,7 @@ + + + + + + + diff --git a/rector.php b/rector.php index 0b826aa72..45f0106d5 100644 --- a/rector.php +++ b/rector.php @@ -2,21 +2,25 @@ declare(strict_types=1); -use Rector\Core\Configuration\Option; +use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [ +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->paths([ __DIR__.'/src', + __DIR__.'/tests', ]); - $parameters->set(Option::AUTOLOAD_PATHS, [ - ]); + // single rules + $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); - $containerConfigurator->import(SetList::CODE_QUALITY); - $containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT); - $containerConfigurator->import(SetList::PHP_74); - $containerConfigurator->import(SetList::DEAD_CODE); + // sets of rules + $rectorConfig->sets([ + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + SetList::EARLY_RETURN, + SetList::PHP_74, + SetList::TYPE_DECLARATION, + ]); }; diff --git a/src/Yasumi/Exception/Exception.php b/src/Yasumi/Exception/Exception.php index 340a90338..ec694152d 100644 --- a/src/Yasumi/Exception/Exception.php +++ b/src/Yasumi/Exception/Exception.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Exception/InvalidDateException.php b/src/Yasumi/Exception/InvalidDateException.php deleted file mode 100644 index ef0697d39..000000000 --- a/src/Yasumi/Exception/InvalidDateException.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ - -namespace Yasumi\Exception; - -use InvalidArgumentException; - -/** - * Class InvalidDateException. - */ -class InvalidDateException extends InvalidArgumentException implements Exception -{ - /** - * Initializes the Exception instance. - * - * @param mixed $argumentValue The value of the invalid argument - */ - public function __construct($argumentValue) - { - $type = \gettype($argumentValue); - switch ($type) { - case 'boolean': - $displayName = $argumentValue ? 'true' : 'false'; - break; - case 'integer': - case 'double': - $displayName = (string) $argumentValue; - break; - case 'string': - $displayName = $argumentValue; - break; - case 'object': - $displayName = \get_class($argumentValue); - break; - default: - $displayName = $type; - break; - } - - parent::__construct(sprintf('\'%s\' is not a valid DateTime(Immutable) instance', $displayName)); - } -} diff --git a/src/Yasumi/Exception/InvalidYearException.php b/src/Yasumi/Exception/InvalidYearException.php index a66ac1203..311576f03 100644 --- a/src/Yasumi/Exception/InvalidYearException.php +++ b/src/Yasumi/Exception/InvalidYearException.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,13 +15,11 @@ namespace Yasumi\Exception; -use InvalidArgumentException; - /** * Class InvalidYearException. * * @author Quentin Neyrat */ -class InvalidYearException extends InvalidArgumentException implements Exception +class InvalidYearException extends \InvalidArgumentException implements Exception { } diff --git a/src/Yasumi/Exception/MissingTranslationException.php b/src/Yasumi/Exception/MissingTranslationException.php index 7aa69c82c..d6b2bf6f3 100644 --- a/src/Yasumi/Exception/MissingTranslationException.php +++ b/src/Yasumi/Exception/MissingTranslationException.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -24,8 +24,8 @@ class MissingTranslationException extends BaseException implements Exception /** * Initializes the Exception instance. * - * @param string $key The holiday key - * @param array $locales The locales that was searched + * @param string $key The holiday key + * @param array $locales The locales that was searched */ public function __construct(string $key, array $locales) { diff --git a/src/Yasumi/Exception/ProviderNotFoundException.php b/src/Yasumi/Exception/ProviderNotFoundException.php index 9eccf62f1..60cdad06a 100644 --- a/src/Yasumi/Exception/ProviderNotFoundException.php +++ b/src/Yasumi/Exception/ProviderNotFoundException.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,13 +14,11 @@ namespace Yasumi\Exception; -use InvalidArgumentException; - /** * Class ProviderNotFoundException. * * @author Quentin Neyrat */ -class ProviderNotFoundException extends InvalidArgumentException implements Exception +class ProviderNotFoundException extends \InvalidArgumentException implements Exception { } diff --git a/src/Yasumi/Exception/UnknownLocaleException.php b/src/Yasumi/Exception/UnknownLocaleException.php index 8cfa97f71..bb9c71756 100644 --- a/src/Yasumi/Exception/UnknownLocaleException.php +++ b/src/Yasumi/Exception/UnknownLocaleException.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,9 @@ namespace Yasumi\Exception; -use InvalidArgumentException; - /** * Class UnknownLocaleException. */ -class UnknownLocaleException extends InvalidArgumentException implements Exception +class UnknownLocaleException extends \InvalidArgumentException implements Exception { } diff --git a/src/Yasumi/Filters/AbstractFilter.php b/src/Yasumi/Filters/AbstractFilter.php index 170749008..3581a5ccc 100644 --- a/src/Yasumi/Filters/AbstractFilter.php +++ b/src/Yasumi/Filters/AbstractFilter.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,14 +15,12 @@ namespace Yasumi\Filters; -use Countable; -use FilterIterator; use Yasumi\SubstituteHoliday; /** * AbstractFilter. */ -abstract class AbstractFilter extends FilterIterator implements Countable +abstract class AbstractFilter extends \FilterIterator implements \Countable { /** * Returns the number of holidays returned by this iterator. diff --git a/src/Yasumi/Filters/BankHolidaysFilter.php b/src/Yasumi/Filters/BankHolidaysFilter.php index 5d1b5b672..af3a5fd13 100644 --- a/src/Yasumi/Filters/BankHolidaysFilter.php +++ b/src/Yasumi/Filters/BankHolidaysFilter.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Filters/BetweenFilter.php b/src/Yasumi/Filters/BetweenFilter.php index 8bb8865ba..fbf97ea69 100644 --- a/src/Yasumi/Filters/BetweenFilter.php +++ b/src/Yasumi/Filters/BetweenFilter.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,7 @@ namespace Yasumi\Filters; -use Iterator; -use Yasumi\Provider\AbstractProvider; +use Yasumi\ProviderInterface; /** * BetweenFilter is a class used for filtering holidays based on given date range. @@ -40,14 +39,14 @@ class BetweenFilter extends AbstractFilter /** * Construct the Between FilterIterator Object. * - * @param Iterator $iterator Iterator object of the Holidays Provider - * @param \DateTimeInterface $startDate Start date of the time frame to check against - * @param \DateTimeInterface $endDate End date of the time frame to check against - * @param bool $equal Indicate whether the start and end dates should be included in the - * comparison + * @param \Iterator $iterator Iterator object of the Holidays Provider + * @param \DateTimeInterface $startDate Start date of the time frame to check against + * @param \DateTimeInterface $endDate End date of the time frame to check against + * @param bool $equal Indicate whether the start and end dates should be included in the + * comparison */ public function __construct( - Iterator $iterator, + \Iterator $iterator, \DateTimeInterface $startDate, \DateTimeInterface $endDate, bool $equal = true diff --git a/src/Yasumi/Filters/ObservedHolidaysFilter.php b/src/Yasumi/Filters/ObservedHolidaysFilter.php index 4b2bc65ba..17b3807ba 100644 --- a/src/Yasumi/Filters/ObservedHolidaysFilter.php +++ b/src/Yasumi/Filters/ObservedHolidaysFilter.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Filters/OfficialHolidaysFilter.php b/src/Yasumi/Filters/OfficialHolidaysFilter.php index 2e7f361fe..08d860502 100644 --- a/src/Yasumi/Filters/OfficialHolidaysFilter.php +++ b/src/Yasumi/Filters/OfficialHolidaysFilter.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Filters/OnFilter.php b/src/Yasumi/Filters/OnFilter.php index b45fcc7d1..028fe33c5 100644 --- a/src/Yasumi/Filters/OnFilter.php +++ b/src/Yasumi/Filters/OnFilter.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,7 @@ namespace Yasumi\Filters; -use Iterator; -use Yasumi\Provider\AbstractProvider; +use Yasumi\ProviderInterface; /** * OnFilter is a class used for filtering holidays based on a given date. @@ -33,11 +32,11 @@ class OnFilter extends AbstractFilter /** * Construct the On FilterIterator Object. * - * @param Iterator $iterator Iterator object of the Holidays Provider - * @param \DateTimeInterface $date Start date of the time frame to check against + * @param \Iterator $iterator Iterator object of the Holidays Provider + * @param \DateTimeInterface $date Start date of the time frame to check against */ public function __construct( - Iterator $iterator, + \Iterator $iterator, \DateTimeInterface $date ) { parent::__construct($iterator); diff --git a/src/Yasumi/Filters/OtherHolidaysFilter.php b/src/Yasumi/Filters/OtherHolidaysFilter.php index 9e7ab994d..dcaf7aa1a 100644 --- a/src/Yasumi/Filters/OtherHolidaysFilter.php +++ b/src/Yasumi/Filters/OtherHolidaysFilter.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Filters/SeasonalHolidaysFilter.php b/src/Yasumi/Filters/SeasonalHolidaysFilter.php index f87588fed..3fd9ed42d 100644 --- a/src/Yasumi/Filters/SeasonalHolidaysFilter.php +++ b/src/Yasumi/Filters/SeasonalHolidaysFilter.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Holiday.php b/src/Yasumi/Holiday.php old mode 100755 new mode 100644 index 8b0c52c13..a6944b0d9 --- a/src/Yasumi/Holiday.php +++ b/src/Yasumi/Holiday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,17 +15,13 @@ namespace Yasumi; -use DateTime; -use InvalidArgumentException; -use JsonSerializable; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; /** * Class Holiday. */ -class Holiday extends DateTime implements JsonSerializable +class Holiday extends \DateTime implements \JsonSerializable { /** * Type definition for Official (i.e. National/Federal) holidays. @@ -100,9 +96,8 @@ class Holiday extends DateTime implements JsonSerializable * TYPE_OBSERVANCE, TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default, an * official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * @throws \Exception */ public function __construct( @@ -114,11 +109,11 @@ public function __construct( ) { // Validate if key is not empty if (empty($key)) { - throw new InvalidArgumentException('Holiday name can not be blank.'); + throw new \InvalidArgumentException('Holiday name can not be blank.'); } // Load internal locales variable - if (empty(self::$locales)) { + if ([] === self::$locales) { self::$locales = Yasumi::getAvailableLocales(); } @@ -229,7 +224,7 @@ public function mergeGlobalTranslations(TranslationsInterface $globalTranslation * * @param array|null $locales Array of locales, or null if the display locale should be used * - * @return array an array of locales to check for translations + * @return array an array of locales to check for translations * * @see Holiday::DEFAULT_LOCALE * @see Holiday::LOCALE_KEY @@ -247,6 +242,10 @@ protected function getLocales(?array $locales): array // Expand e.g. ['de_DE', 'en_GB'] into ['de_DE', 'de', 'en_GB', 'en']. foreach (array_reverse($locales) as $locale) { $parent = strtok($locale, '_'); + if (!$parent) { + continue; + } + while ($child = strtok('_')) { $expanded[] = $parent; $parent .= '_'.$child; diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php old mode 100755 new mode 100644 index 2f7c01870..6b02b2efa --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\Provider; -use ArrayIterator; -use Countable; -use InvalidArgumentException; -use IteratorAggregate; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Filters\BetweenFilter; use Yasumi\Filters\OnFilter; @@ -31,7 +26,7 @@ /** * Class AbstractProvider. */ -abstract class AbstractProvider implements ProviderInterface, Countable, IteratorAggregate +abstract class AbstractProvider implements \Countable, ProviderInterface, \IteratorAggregate { /** * Code to identify the Holiday Provider. Typically, this is the ISO3166 code corresponding to the respective @@ -40,9 +35,9 @@ abstract class AbstractProvider implements ProviderInterface, Countable, Iterato public const ID = 'US'; /** - * @var array list of the days of the week (the index of the weekdays) that are considered weekend days. - * This list only concerns those countries that deviate from the global common definition, - * where the weekend starts on Saturday and ends on Sunday (0 = Sunday, 1 = Monday, etc.). + * @var array> list of the days of the week (the index of the weekdays) that are considered weekend days. + * This list only concerns those countries that deviate from the global common definition, + * where the weekend starts on Saturday and ends on Sunday (0 = Sunday, 1 = Monday, etc.). */ public const WEEKEND_DATA = [ // Thursday and Friday @@ -74,10 +69,8 @@ abstract class AbstractProvider implements ProviderInterface, Countable, Iterato 'IN' => [0], // India ]; - /** - * @var int the object's current year - */ - protected $year; + /** the object's current year */ + protected int $year; /** the object's current timezone */ protected string $timezone; @@ -108,19 +101,13 @@ public function __construct( ) { $this->clearHolidays(); - $this->year = $year ?: getdate()['year']; + $this->year = $year ?: (int) date('Y'); $this->locale = $locale ?? 'en_US'; $this->globalTranslations = $globalTranslations; $this->initialize(); } - /** - * Adds a holiday to the holidays providers (i.e. country/state) list of holidays. - * - * @param Holiday $holiday holiday instance (representing a holiday) to be added to the internal list - * of holidays of this country - */ public function addHoliday(Holiday $holiday): void { if ($this->globalTranslations instanceof TranslationsInterface) { @@ -128,54 +115,29 @@ public function addHoliday(Holiday $holiday): void } $this->holidays[$holiday->getKey()] = $holiday; - uasort($this->holidays, fn (\DateTimeInterface $dateA, \DateTimeInterface $dateB): int => $this::compareDates($dateA, $dateB)); + uasort($this->holidays, fn (\DateTimeInterface $dateA, \DateTimeInterface $dateB): int => self::compareDates($dateA, $dateB)); } - /** - * Removes a holiday from the holidays providers (i.e. country/state) list of holidays. - * - * This function can be helpful in cases where an existing holiday provider class can be extended but some holidays - * are not part of the original (extended) provider. - * - * @param string $key holiday key - */ public function removeHoliday(string $key): void { unset($this->holidays[$key]); } - /** {@inheritdoc} */ public function isWorkingDay(\DateTimeInterface $date): bool { - return !$this->isHoliday($date) && !$this->isWeekendDay($date); + if ($this->isHoliday($date)) { + return false; + } + + return !$this->isWeekendDay($date); } - /** - * Determines whether a date represents a holiday or not. - * - * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, - * \DateTime) - * - * @return bool true if date represents a holiday, otherwise false - * - * @throws InvalidDateException - */ public function isHoliday(\DateTimeInterface $date): bool { // Check if given date is a holiday or not return \in_array($date->format('Y-m-d'), $this->getHolidayDates(), true); } - /** - * Determines whether a date represents a weekend day or not. - * - * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, - * \DateTime) - * - * @return bool true if date represents a weekend day, otherwise false - * - * @throws InvalidDateException - */ public function isWeekendDay(\DateTimeInterface $date): bool { // If no data is defined for this Holiday Provider, the function falls back to the global weekend definition. @@ -186,15 +148,6 @@ public function isWeekendDay(\DateTimeInterface $date): bool ); } - /** - * On what date is the given holiday? - * - * @param string $key holiday key - * - * @return string the date of the requested holiday - * - * @throws InvalidArgumentException when the given name is blank or empty - */ public function whenIs(string $key): string { $this->isHolidayKeyNotEmpty($key); // Validate if key is not empty @@ -202,18 +155,6 @@ public function whenIs(string $key): string return (string) $this->holidays[$key]; } - /** - * On what day of the week is the given holiday? - * - * This function returns the index number for the day of the week on which the given holiday falls. - * The index number is an integer starting with 0 being Sunday, 1 = Monday, etc. - * - * @param string $key key of the holiday - * - * @return int the index of the weekdays of the requested holiday (0 = Sunday, 1 = Monday, etc.) - * - * @throws InvalidArgumentException when the given name is blank or empty - */ public function whatWeekDayIs(string $key): int { $this->isHolidayKeyNotEmpty($key); // Validate if key is not empty @@ -240,51 +181,26 @@ public function count(): int return \count(array_unique($names)); } - /** - * Gets all the holidays defined by this holiday provider (for the given year). - * - * @return Holiday[] list of all holidays defined for the given year - */ public function getHolidays(): array { return $this->holidays; } - /** - * Gets all the holiday names defined by this holiday provider (for the given year). - * - * @return array list of all holiday names defined for the given year - */ public function getHolidayNames(): array { return array_keys($this->holidays); } - /** {@inheritdoc} */ public function getYear(): int { return $this->year; } - /** - * Retrieves the next date (year) the given holiday is going to take place. - * - * @param string $key key of the holiday for which the next occurrence need to be retrieved - * - * @return Holiday|null a Holiday instance for the given holiday - * - * @throws UnknownLocaleException - * @throws \RuntimeException - * @throws InvalidArgumentException - * - * @covers AbstractProvider::anotherTime - */ public function next(string $key): ?Holiday { return $this->anotherTime($this->year + 1, $key); } - /** {@inheritdoc} */ public function getHoliday(string $key): ?Holiday { $this->isHolidayKeyNotEmpty($key); // Validate if key is not empty @@ -294,87 +210,33 @@ public function getHoliday(string $key): ?Holiday return $holidays[$key] ?? null; } - /** - * Retrieves the previous date (year) the given holiday took place. - * - * @param string $key key of the holiday for which the previous occurrence need to be retrieved - * - * @return Holiday|null a Holiday instance for the given holiday - * - * @throws UnknownLocaleException - * @throws \RuntimeException - * @throws InvalidArgumentException - * - * @covers AbstractProvider::anotherTime - */ public function previous(string $key): ?Holiday { return $this->anotherTime($this->year - 1, $key); } - /** - * Retrieves a list of all holidays between the given start and end date. - * - * Yasumi only calculates holidays for a single year, so a start date or end date beyond the given year will only - * return holidays for the given year. For example, holidays calculated for the year 2016, will only return 2016 - * holidays if the provided period is for example 01/01/2012 - 31/12/2017. - * - * Please take care to use the appropriate timezone for the start and end date parameters. In case you use - * different - * timezone for these parameters versus the instantiated Holiday Provider, the outcome might be unexpected (but - * correct). - * - * @param \DateTimeInterface $startDate Start date of the time frame to check against - * @param \DateTimeInterface $endDate End date of the time frame to check against - * @param ?bool $equals indicate whether the start and end dates should be included in the - * comparison - * - * @throws InvalidArgumentException an InvalidArgumentException is thrown if the start date is set after the end - * date - */ public function between( \DateTimeInterface $startDate, \DateTimeInterface $endDate, ?bool $equals = null ): BetweenFilter { if ($startDate > $endDate) { - throw new InvalidArgumentException('Start date must be a date before the end date.'); + throw new \InvalidArgumentException('Start date must be a date before the end date.'); } return new BetweenFilter($this->getIterator(), $startDate, $endDate, $equals ?? true); } - /** - * Get an iterator for the holidays. - * - * @return ArrayIterator iterator for the holidays of this calendar - */ - public function getIterator(): ArrayIterator + public function getIterator(): \ArrayIterator { - return new ArrayIterator($this->getHolidays()); + return new \ArrayIterator($this->getHolidays()); } - /** - * Retrieves a list of all holidays that happen on the given date. - * - * Yasumi only calculates holidays for a single year, so a date outside the given year will not appear to - * contain any holidays. - * - * Please take care to use the appropriate timezone for the date parameters. If there is a different timezone used - * for these parameters versus the instantiated Holiday Provider, the outcome might be unexpected (but correct). - * - * @param \DateTimeInterface $date date to check for holidays on - */ public function on(\DateTimeInterface $date): OnFilter { return new OnFilter($this->getIterator(), $date); } - /** - * Gets all the holiday dates defined by this holiday provider (for the given year). - * - * @return array list of all holiday dates defined for the given year - */ public function getHolidayDates(): array { return array_map(static fn ($holiday): string => (string) $holiday, $this->holidays); @@ -387,7 +249,7 @@ public function getHolidayDates(): array * * @return true upon success, otherwise an InvalidArgumentException is thrown * - * @throws InvalidArgumentException an InvalidArgumentException is thrown if the given holiday parameter is empty + * @throws \InvalidArgumentException an InvalidArgumentException is thrown if the given holiday parameter is empty * * @deprecated deprecated in favor of isHolidayKeyNotEmpty() * @deprecated see isHolidayKeyNotEmpty() @@ -412,12 +274,12 @@ private function clearHolidays(): void * * @return true upon success, otherwise an InvalidArgumentException is thrown * - * @throws InvalidArgumentException an InvalidArgumentException is thrown if the given holiday parameter is empty + * @throws \InvalidArgumentException an InvalidArgumentException is thrown if the given holiday parameter is empty */ private function isHolidayKeyNotEmpty(string $key): bool { if (empty($key)) { - throw new InvalidArgumentException('Holiday key can not be blank.'); + throw new \InvalidArgumentException('Holiday key can not be blank.'); } return true; @@ -445,7 +307,7 @@ private static function compareDates(\DateTimeInterface $dateA, \DateTimeInterfa * * @return Holiday|null a Holiday instance for the given holiday and year * - * @throws InvalidArgumentException when the given name is blank or empty + * @throws \InvalidArgumentException when the given name is blank or empty * @throws UnknownLocaleException * @throws \RuntimeException */ @@ -456,6 +318,6 @@ private function anotherTime(int $year, string $key): ?Holiday // Get calling class name $hReflectionClass = new \ReflectionClass(\get_class($this)); - return Yasumi::create($hReflectionClass->getShortName(), $year, $this->locale)->getHoliday($key); + return Yasumi::create($hReflectionClass->getName(), $year, $this->locale)->getHoliday($key); } } diff --git a/src/Yasumi/Provider/Argentina.php b/src/Yasumi/Provider/Argentina.php index 42870d937..1027a54a5 100644 --- a/src/Yasumi/Provider/Argentina.php +++ b/src/Yasumi/Provider/Argentina.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -39,7 +36,6 @@ class Argentina extends AbstractProvider /** * Initialize holidays for Argentina. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -98,34 +94,30 @@ private function addCarnvalHolidays(): void $easter = $this->calculateEaster($this->year, $this->timezone); $carnavalMonday = clone $easter; - $carnavalMondayDate = $carnavalMonday->sub(new DateInterval('P48D')); - if (false !== $carnavalMondayDate) { - $this->addHoliday(new Holiday( - 'carnavalMonday', - [ - 'en' => 'Carnival Monday', - 'es' => 'Lunes de Carnaval', - ], - $carnavalMondayDate, - $this->locale, - Holiday::TYPE_OBSERVANCE - )); - } + $carnavalMondayDate = $carnavalMonday->sub(new \DateInterval('P48D')); + $this->addHoliday(new Holiday( + 'carnavalMonday', + [ + 'en' => 'Carnival Monday', + 'es' => 'Lunes de Carnaval', + ], + $carnavalMondayDate, + $this->locale, + Holiday::TYPE_OBSERVANCE + )); $carnavalTuesday = clone $easter; - $carnavalTuesdayDate = $carnavalTuesday->sub(new DateInterval('P47D')); - if (false !== $carnavalTuesdayDate) { - $this->addHoliday(new Holiday( - 'carnavalTuesday', - [ - 'en' => 'Carnival Tuesday', - 'es' => 'Martes de Carnaval', - ], - $carnavalTuesdayDate, - $this->locale, - Holiday::TYPE_OBSERVANCE - )); - } + $carnavalTuesdayDate = $carnavalTuesday->sub(new \DateInterval('P47D')); + $this->addHoliday(new Holiday( + 'carnavalTuesday', + [ + 'en' => 'Carnival Tuesday', + 'es' => 'Martes de Carnaval', + ], + $carnavalTuesdayDate, + $this->locale, + Holiday::TYPE_OBSERVANCE + )); } } @@ -144,13 +136,13 @@ private function addRemembranceDay(): void { if ($this->year >= 2006) { $this->addHoliday(new Holiday( - 'remembranceDay', - [ - 'en' => 'Day of Remembrance for Truth and Justice', - 'es' => 'Día Nacional de la Memoria por la Verdad y la Justicia', - ], - new DateTime("$this->year-03-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'remembranceDay', + [ + 'en' => 'Day of Remembrance for Truth and Justice', + 'es' => 'Día Nacional de la Memoria por la Verdad y la Justicia', + ], + new \DateTime("$this->year-03-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -170,13 +162,13 @@ private function addMalvinasDay(): void { if ($this->year >= 1982) { $this->addHoliday(new Holiday( - 'malvinasDay', - [ - 'en' => 'Malvinas Day', - 'es' => 'Día del Veterano y de los Caídos en la Guerra de Malvinas', - ], - new DateTime("$this->year-04-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'malvinasDay', + [ + 'en' => 'Malvinas Day', + 'es' => 'Día del Veterano y de los Caídos en la Guerra de Malvinas', + ], + new \DateTime("$this->year-04-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -198,13 +190,13 @@ private function addMayRevolution(): void { if ($this->year >= 1810) { $this->addHoliday(new Holiday( - 'mayRevolution', - [ - 'en' => 'May Revolution', - 'es' => 'Día de la Revolución de Mayo', - ], - new DateTime("$this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'mayRevolution', + [ + 'en' => 'May Revolution', + 'es' => 'Día de la Revolución de Mayo', + ], + new \DateTime("$this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -219,13 +211,13 @@ private function addGeneralMartinMigueldeGuemesDay(): void { if ($this->year >= 1821) { $this->addHoliday(new Holiday( - 'generalMartinMigueldeGuemesDay', - [ - 'en' => 'Anniversary of the Passing of General Martín Miguel de Güemes', - 'es' => 'Paso a la Inmortalidad del General Martín Miguel de Güemes', - ], - new DateTime("$this->year-06-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'generalMartinMigueldeGuemesDay', + [ + 'en' => 'Anniversary of the Passing of General Martín Miguel de Güemes', + 'es' => 'Paso a la Inmortalidad del General Martín Miguel de Güemes', + ], + new \DateTime("$this->year-06-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -242,13 +234,13 @@ private function addFlagDay(): void { if ($this->year >= 1938) { $this->addHoliday(new Holiday( - 'flagDay', - [ - 'en' => 'General Manuel Belgrano Memorial Day', - 'es' => 'Paso a la Inmortalidad del General Manuel Belgrano', - ], - new DateTime("$this->year-06-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'flagDay', + [ + 'en' => 'General Manuel Belgrano Memorial Day', + 'es' => 'Paso a la Inmortalidad del General Manuel Belgrano', + ], + new \DateTime("$this->year-06-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -264,13 +256,13 @@ private function addIndependenceDay(): void { if ($this->year >= self::PROCLAMATION_OF_INDEPENDENCE_YEAR) { $this->addHoliday(new Holiday( - 'independenceDay', - [ - 'en' => 'Independence Day', - 'es' => 'Día de la Independencia', - ], - new DateTime("$this->year-07-09", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'independenceDay', + [ + 'en' => 'Independence Day', + 'es' => 'Día de la Independencia', + ], + new \DateTime("$this->year-07-09", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -285,13 +277,13 @@ private function addGeneralJoseSanMartinDay(): void { if ($this->year >= 1850) { $this->addHoliday(new Holiday( - 'generalJoseSanMartinDay', - [ - 'en' => 'General José de San Martín Memorial Day', - 'es' => 'Paso a la Inmortalidad del General José de San Martín', - ], - new DateTime("$this->year-08-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'generalJoseSanMartinDay', + [ + 'en' => 'General José de San Martín Memorial Day', + 'es' => 'Paso a la Inmortalidad del General José de San Martín', + ], + new \DateTime("$this->year-08-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -308,13 +300,13 @@ private function addRaceDay(): void { if ($this->year >= 1492) { $this->addHoliday(new Holiday( - 'raceDay', - [ - 'en' => 'Day of Respect for Cultural Diversity', - 'es' => 'Día del Respeto a la Diversidad Cultural', - ], - new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'raceDay', + [ + 'en' => 'Day of Respect for Cultural Diversity', + 'es' => 'Día del Respeto a la Diversidad Cultural', + ], + new \DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -331,13 +323,13 @@ private function addNationalSovereigntyDay(): void { if ($this->year >= 2010) { $this->addHoliday(new Holiday( - 'nationalSovereigntyDay', - [ - 'en' => 'National Sovereignty Day', - 'es' => 'Día de la Soberanía Nacional', - ], - new DateTime("$this->year-11-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'nationalSovereigntyDay', + [ + 'en' => 'National Sovereignty Day', + 'es' => 'Día de la Soberanía Nacional', + ], + new \DateTime("$this->year-11-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } @@ -354,13 +346,13 @@ private function addImmaculateConceptionDay(): void { if ($this->year >= 1900) { $this->addHoliday(new Holiday( - 'immaculateConceptionDay', - [ - 'en' => 'Immaculate Conception Day', - 'es' => 'Día de la Inmaculada Concepción de María', - ], - new DateTime("$this->year-12-08", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale + 'immaculateConceptionDay', + [ + 'en' => 'Immaculate Conception Day', + 'es' => 'Día de la Inmaculada Concepción de María', + ], + new \DateTime("$this->year-12-08", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale )); } } diff --git a/src/Yasumi/Provider/Australia.php b/src/Yasumi/Provider/Australia.php old mode 100755 new mode 100644 index d8cf32855..d18471bb4 --- a/src/Yasumi/Provider/Australia.php +++ b/src/Yasumi/Provider/Australia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -49,6 +47,7 @@ public function initialize(): void $this->calculateNewYearHolidays(); $this->calculateAustraliaDay(); $this->calculateAnzacDay(); + $this->calculateNationalDayOfMourning(); // Add Christian holidays $this->addHoliday($this->goodFriday($this->year, $this->timezone, $this->locale)); @@ -79,7 +78,7 @@ public function getSources(): array */ private function calculateNewYearHolidays(): void { - $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $newYearsDay = new \DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'newYearsDay', [], @@ -89,7 +88,7 @@ private function calculateNewYearHolidays(): void )); switch ($newYearsDay->format('w')) { case 0: // sunday - $newYearsDay->add(new DateInterval('P1D')); + $newYearsDay->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'newYearsHoliday', ['en' => 'New Year’s Holiday'], @@ -99,7 +98,7 @@ private function calculateNewYearHolidays(): void )); break; case 6: // saturday - $newYearsDay->add(new DateInterval('P2D')); + $newYearsDay->add(new \DateInterval('P2D')); $this->addHoliday(new Holiday( 'newYearsHoliday', ['en' => 'New Year’s Holiday'], @@ -131,7 +130,7 @@ private function calculateNewYearHolidays(): void */ private function calculateAustraliaDay(): void { - $date = new DateTime("$this->year-01-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-01-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $holiday = new Holiday( 'australiaDay', @@ -144,7 +143,7 @@ private function calculateAustraliaDay(): void $day = (int) $date->format('w'); if (0 === $day || 6 === $day) { - $date = $date->add(0 === $day ? new DateInterval('P1D') : new DateInterval('P2D')); + $date = $date->add(0 === $day ? new \DateInterval('P1D') : new \DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( $holiday, @@ -178,7 +177,7 @@ private function calculateAnzacDay(): void return; } - $date = new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'anzacDay', [], @@ -189,11 +188,11 @@ private function calculateAnzacDay(): void $easter = $this->calculateEaster($this->year, $this->timezone); $easterMonday = $this->calculateEaster($this->year, $this->timezone); - $easterMonday->add(new DateInterval('P1D')); + $easterMonday->add(new \DateInterval('P1D')); $fDate = $date->format('Y-m-d'); if ($fDate === $easter->format('Y-m-d') || $fDate === $easterMonday->format('Y-m-d')) { - $easterMonday->add(new DateInterval('P1D')); + $easterMonday->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'easterTuesday', ['en' => 'Easter Tuesday'], @@ -204,6 +203,34 @@ private function calculateAnzacDay(): void } } + /** + * National Day of Mourning. + * + * An additional, once off, national public holiday was proclaimed on the 10th of September 2022, to be observed on the 22nd of September 2022, as a + * National day of mourning for the passing of Queen Elizabeth II + * + * @see https://www.pm.gov.au/media/commemorating-her-majesty-queen-elizabeth-ii + * @see https://www.timeanddate.com/holidays/australia/national-day-of-mourning + * + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + private function calculateNationalDayOfMourning(): void + { + if (2022 !== $this->year) { + return; + } + + $this->addHoliday(new Holiday( + 'nationalDayOfMourning', + ['en' => 'National Day of Mourning'], + new \DateTime("$this->year-9-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_OFFICIAL + )); + } + /** * Christmas Day / Boxing Day. * @@ -218,8 +245,8 @@ private function calculateAnzacDay(): void */ private function calculateChristmasDay(): void { - $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $boxingDay = new DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $christmasDay = new \DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $boxingDay = new \DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'christmasDay', [], @@ -237,7 +264,7 @@ private function calculateChristmasDay(): void switch ($christmasDay->format('w')) { case 0: // sunday - $christmasDay->add(new DateInterval('P2D')); + $christmasDay->add(new \DateInterval('P2D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], @@ -247,7 +274,7 @@ private function calculateChristmasDay(): void )); break; case 5: // friday - $boxingDay->add(new DateInterval('P2D')); + $boxingDay->add(new \DateInterval('P2D')); $this->addHoliday(new Holiday( 'secondChristmasHoliday', ['en' => 'Boxing Day Holiday'], @@ -257,8 +284,8 @@ private function calculateChristmasDay(): void )); break; case 6: // saturday - $christmasDay->add(new DateInterval('P2D')); - $boxingDay->add(new DateInterval('P2D')); + $christmasDay->add(new \DateInterval('P2D')); + $boxingDay->add(new \DateInterval('P2D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], diff --git a/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php index 5936ccc50..20f3113a3 100644 --- a/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php +++ b/src/Yasumi/Provider/Australia/AustralianCapitalTerritory.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -111,7 +109,7 @@ private function easterSaturday( return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')), $locale, $type ?? Holiday::TYPE_OFFICIAL ); @@ -137,7 +135,7 @@ private function calculateQueensBirthday(): void $this->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 )); @@ -150,7 +148,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -168,7 +166,7 @@ private function calculateCanberraDay(): void new Holiday( 'canberraDay', ['en' => 'Canberra Day'], - new DateTime($datePattern, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($datePattern, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ) ); @@ -185,10 +183,10 @@ private 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 87031bfea..5a73af588 100644 --- a/src/Yasumi/Provider/Australia/NewSouthWales.php +++ b/src/Yasumi/Provider/Australia/NewSouthWales.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -78,7 +76,7 @@ private function easterSaturday( return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')), $locale, $type ?? Holiday::TYPE_OFFICIAL ); @@ -104,7 +102,7 @@ private function calculateQueensBirthday(): void $this->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 )); @@ -117,7 +115,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -133,7 +131,7 @@ private 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 324b52711..b9cca6ed8 100644 --- a/src/Yasumi/Provider/Australia/NorthernTerritory.php +++ b/src/Yasumi/Provider/Australia/NorthernTerritory.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -77,7 +75,7 @@ private function easterSaturday( return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')), $locale, $type ?? Holiday::TYPE_OFFICIAL ); @@ -103,7 +101,7 @@ private function calculateQueensBirthday(): void $this->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 )); @@ -116,7 +114,7 @@ private function calculateQueensBirthday(): void */ private function calculateMayDay(): void { - $date = new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('mayDay', ['en' => 'May Day'], $date, $this->locale)); } @@ -134,7 +132,7 @@ private 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 cf451af89..9238098da 100644 --- a/src/Yasumi/Provider/Australia/Queensland.php +++ b/src/Yasumi/Provider/Australia/Queensland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -74,7 +73,7 @@ private function calculateQueensBirthday(): void $this->addHoliday(new Holiday( 'queensBirthday', [], - new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -87,9 +86,9 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if (2013 === $this->year || 2014 === $this->year || 2015 === $this->year) { - $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); diff --git a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php index 3255f2fe7..e3dc7de70 100644 --- a/src/Yasumi/Provider/Australia/Queensland/Brisbane.php +++ b/src/Yasumi/Provider/Australia/Queensland/Brisbane.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Queensland; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Queensland; @@ -68,11 +66,11 @@ public function initialize(): void */ private function calculatePeoplesDay(): void { - $date = new DateTime('first friday of august '.$this->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')); + $date = $date->add(new \DateInterval('P7D')); } - $date = $date->add(new DateInterval('P5D')); + $date = $date->add(new \DateInterval('P5D')); $this->addHoliday(new Holiday('peoplesDay', ['en' => 'Ekka People’s Day'], $date, $this->locale)); } } diff --git a/src/Yasumi/Provider/Australia/SouthAustralia.php b/src/Yasumi/Provider/Australia/SouthAustralia.php index 0b5540407..d427bbc98 100644 --- a/src/Yasumi/Provider/Australia/SouthAustralia.php +++ b/src/Yasumi/Provider/Australia/SouthAustralia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -85,7 +83,7 @@ private function easterSaturday( return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')), $locale, $type ?? Holiday::TYPE_OFFICIAL ); @@ -111,7 +109,7 @@ private function calculateQueensBirthday(): void $this->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 )); @@ -124,7 +122,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', ['en' => 'Labour Day'], $date, $this->locale)); } @@ -149,7 +147,7 @@ private function calculateAdelaideCupDay(): void $this->addHoliday(new Holiday( 'adelaideCup', ['en' => 'Adelaide Cup'], - new DateTime($cupDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($cupDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -163,7 +161,7 @@ private function calculateAdelaideCupDay(): void */ private function calculateProclamationDay(): void { - $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $christmasDay = new \DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'christmasDay', @@ -175,7 +173,7 @@ private function calculateProclamationDay(): void switch ($christmasDay->format('w')) { case 0: // sunday - $christmasDay->add(new DateInterval('P1D')); + $christmasDay->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], @@ -183,13 +181,13 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); - $christmasDay->add(new DateInterval('P1D')); + $christmasDay->add(new \DateInterval('P1D')); break; case 5: // friday - $christmasDay->add(new DateInterval('P3D')); + $christmasDay->add(new \DateInterval('P3D')); break; case 6: // saturday - $christmasDay->add(new DateInterval('P2D')); + $christmasDay->add(new \DateInterval('P2D')); $this->addHoliday(new Holiday( 'christmasHoliday', ['en' => 'Christmas Holiday'], @@ -197,10 +195,10 @@ private function calculateProclamationDay(): void $this->locale, Holiday::TYPE_OFFICIAL )); - $christmasDay->add(new DateInterval('P1D')); + $christmasDay->add(new \DateInterval('P1D')); break; default: // monday-thursday - $christmasDay->add(new DateInterval('P1D')); + $christmasDay->add(new \DateInterval('P1D')); break; } diff --git a/src/Yasumi/Provider/Australia/Tasmania.php b/src/Yasumi/Provider/Australia/Tasmania.php index 72ebf4c46..2f1398978 100644 --- a/src/Yasumi/Provider/Australia/Tasmania.php +++ b/src/Yasumi/Provider/Australia/Tasmania.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -56,7 +55,7 @@ public function initialize(): void */ private function calculateEightHoursDay(): void { - $date = new DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('eightHourDay', ['en' => 'Eight Hour Day'], $date, $this->locale)); } @@ -81,7 +80,7 @@ private function calculateQueensBirthday(): void $this->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 +99,7 @@ private 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 ef276de98..d7cdfd081 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php +++ b/src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -53,7 +52,7 @@ public function initialize(): void */ private function calculateDevonportShow(): void { - $date = new DateTime($this->year.'-12-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime($this->year.'-12-02', DateTimeZoneFactory::getDateTimeZone($this->timezone)); $date = $date->modify('previous friday'); $this->addHoliday(new Holiday('devonportShow', ['en' => 'Devonport Show'], $date, $this->locale)); diff --git a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php index 42c899567..a9a83ab67 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -54,8 +52,8 @@ public function initialize(): void */ private function calculateFlindersIslandShow(): void { - $date = new DateTime('third saturday of october '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $date = $date->sub(new DateInterval('P1D')); + $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 70edbbe94..380277dbf 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php +++ b/src/Yasumi/Provider/Australia/Tasmania/KingIsland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -56,7 +55,7 @@ private function calculateKingIslandShow(): void $this->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 2df8693f2..d52af67e4 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northeast.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -54,8 +52,8 @@ public function initialize(): void */ private function calculateLauncestonShow(): void { - $date = new DateTime('second saturday of october '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $date = $date->sub(new DateInterval('P2D')); + $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 138b1934f..62f5b979e 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -54,8 +52,8 @@ public function initialize(): void */ private function calculateBurnieShow(): void { - $date = new DateTime('first saturday of october '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $date = $date->sub(new DateInterval('P1D')); + $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 d947cdba1..22d0518ff 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php +++ b/src/Yasumi/Provider/Australia/Tasmania/Northwest/CircularHead.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania\Northwest; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania\Northwest; @@ -54,8 +52,8 @@ public function initialize(): void */ private function calculateAGFEST(): void { - $date = new DateTime('first thursday of may '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $date = $date->add(new DateInterval('P1D')); + $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 891878777..3dc62c00e 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania; @@ -54,8 +52,8 @@ public function initialize(): void */ private function calculateHobartShow(): void { - $date = new DateTime('fourth saturday of october '.$this->year, DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $date = $date->sub(new DateInterval('P2D')); + $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 39454d5c7..7880b2c5a 100644 --- a/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php +++ b/src/Yasumi/Provider/Australia/Tasmania/South/Southeast.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia\Tasmania\South; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia\Tasmania\South; @@ -59,7 +58,7 @@ private function calculateHobartRegatta(): void $this->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 09ec7684a..9f43ed991 100644 --- a/src/Yasumi/Provider/Australia/Victoria.php +++ b/src/Yasumi/Provider/Australia/Victoria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateInterval; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -111,7 +109,7 @@ private function easterSaturday( return new Holiday( 'easterSaturday', ['en' => 'Easter Saturday'], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P1D')), $locale, $type ?? Holiday::TYPE_OFFICIAL ); @@ -124,7 +122,7 @@ private function easterSaturday( */ private function calculateLabourDay(): void { - $date = new DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("second monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -149,7 +147,7 @@ private function calculateQueensBirthday(): void $this->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 )); @@ -162,7 +160,7 @@ private function calculateQueensBirthday(): void */ private 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)); } @@ -197,7 +195,7 @@ private function calculateAFLGrandFinalDay(): void return; } - $date = new DateTime($aflGrandFinalFriday, DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime($aflGrandFinalFriday, DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'aflGrandFinalFriday', diff --git a/src/Yasumi/Provider/Australia/WesternAustralia.php b/src/Yasumi/Provider/Australia/WesternAustralia.php index 426531535..fd04b602b 100644 --- a/src/Yasumi/Provider/Australia/WesternAustralia.php +++ b/src/Yasumi/Provider/Australia/WesternAustralia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Australia; -use DateTime; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Australia; @@ -78,7 +77,7 @@ private function calculateQueensBirthday(): void $this->addHoliday(new Holiday( 'queensBirthday', [], - new DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($birthDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -91,7 +90,7 @@ private function calculateQueensBirthday(): void */ private function calculateLabourDay(): void { - $date = new DateTime("first monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("first monday of march $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday('labourDay', [], $date, $this->locale)); } @@ -109,7 +108,7 @@ private 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 6a96a7f7f..db1fd54f4 100644 --- a/src/Yasumi/Provider/Austria.php +++ b/src/Yasumi/Provider/Austria.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +35,6 @@ class Austria extends AbstractProvider /** * Initialize holidays for Austria. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -87,7 +84,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Leopold_III,_Margrave_of_Austria * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -101,7 +97,7 @@ protected function calculateStLeopoldsDay(): void $this->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 )); } @@ -116,7 +112,6 @@ protected function calculateStLeopoldsDay(): void * * @see https://en.wikipedia.org/wiki/Declaration_of_Neutrality * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -130,7 +125,7 @@ private 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 old mode 100755 new mode 100644 index 7e2ceb178..8d3182443 --- a/src/Yasumi/Provider/Austria/Burgenland.php +++ b/src/Yasumi/Provider/Austria/Burgenland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class Burgenland extends Austria /** * Initialize holidays for Burgenland (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Austria/Carinthia.php b/src/Yasumi/Provider/Austria/Carinthia.php old mode 100755 new mode 100644 index 7fb449ed0..fd7c174ce --- a/src/Yasumi/Provider/Austria/Carinthia.php +++ b/src/Yasumi/Provider/Austria/Carinthia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Austria; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Austria; @@ -36,7 +34,6 @@ class Carinthia extends Austria /** * Initialize holidays for Carinthia (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/1920_Carinthian_plebiscite * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ private function calculatePlebisciteDay(): void $this->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 old mode 100755 new mode 100644 index 5c7704778..e910b0a29 --- a/src/Yasumi/Provider/Austria/LowerAustria.php +++ b/src/Yasumi/Provider/Austria/LowerAustria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class LowerAustria extends Austria /** * Initialize holidays for Lower Austria (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Austria/Salzburg.php b/src/Yasumi/Provider/Austria/Salzburg.php old mode 100755 new mode 100644 index b342bb338..ab3d512fd --- a/src/Yasumi/Provider/Austria/Salzburg.php +++ b/src/Yasumi/Provider/Austria/Salzburg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Austria; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Austria; @@ -36,7 +34,6 @@ class Salzburg extends Austria /** * Initialize holidays for Salzburg (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -61,7 +58,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Rupert_of_Salzburg * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +71,7 @@ private function calculateStRupertsDay(): void $this->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 old mode 100755 new mode 100644 index eda059e8f..a3e8afd38 --- a/src/Yasumi/Provider/Austria/Styria.php +++ b/src/Yasumi/Provider/Austria/Styria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class Styria extends Austria /** * Initialize holidays for Styria (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Austria/Tyrol.php b/src/Yasumi/Provider/Austria/Tyrol.php old mode 100755 new mode 100644 index ccbaa65d3..4f19cc35b --- a/src/Yasumi/Provider/Austria/Tyrol.php +++ b/src/Yasumi/Provider/Austria/Tyrol.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class Tyrol extends Austria /** * Initialize holidays for Tyrol (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Austria/UpperAustria.php b/src/Yasumi/Provider/Austria/UpperAustria.php old mode 100755 new mode 100644 index 63c30ed2f..0fdfd1cf7 --- a/src/Yasumi/Provider/Austria/UpperAustria.php +++ b/src/Yasumi/Provider/Austria/UpperAustria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Austria; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Austria; @@ -36,7 +34,6 @@ class UpperAustria extends Austria /** * Initialize holidays for Upper Austria (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -62,7 +59,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Saint_Florian * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -76,7 +72,7 @@ private function calculateStFloriansDay(): void $this->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 old mode 100755 new mode 100644 index 61219f274..68f9ba148 --- a/src/Yasumi/Provider/Austria/Vienna.php +++ b/src/Yasumi/Provider/Austria/Vienna.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class Vienna extends Austria /** * Initialize holidays for Vienna (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Austria/Vorarlberg.php b/src/Yasumi/Provider/Austria/Vorarlberg.php old mode 100755 new mode 100644 index 9bd3f733b..ec7307ebf --- a/src/Yasumi/Provider/Austria/Vorarlberg.php +++ b/src/Yasumi/Provider/Austria/Vorarlberg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Austria; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Austria; @@ -34,7 +33,6 @@ class Vorarlberg extends Austria /** * Initialize holidays for Vorarlberg (Austria). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Belgium.php b/src/Yasumi/Provider/Belgium.php old mode 100755 new mode 100644 index 84f879f50..25c395909 --- a/src/Yasumi/Provider/Belgium.php +++ b/src/Yasumi/Provider/Belgium.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Belgium extends AbstractProvider /** * Initialize holidays for Belgium. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -69,7 +66,7 @@ public function initialize(): void 'fr' => 'Fête nationale', 'en' => 'Belgian National Day', 'nl' => 'nationale feestdag', - ], new DateTime("$this->year-7-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-7-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } public function getSources(): array diff --git a/src/Yasumi/Provider/Bosnia.php b/src/Yasumi/Provider/Bosnia.php index 326a9c9c3..6e75d5639 100644 --- a/src/Yasumi/Provider/Bosnia.php +++ b/src/Yasumi/Provider/Bosnia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -38,7 +36,6 @@ class Bosnia extends AbstractProvider /** * Initialize holidays for Bosnia. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -61,7 +58,7 @@ public function initialize(): void $this->addHoliday(new Holiday('orthodoxChristmasDay', [ 'en' => 'Orthodox Christmas Day', 'bs_Latn' => 'Pravoslavni Božić', - ], new DateTime("$this->year-01-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)))); + ], new \DateTime("$this->year-01-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)))); /* * Independence Day @@ -70,7 +67,7 @@ public function initialize(): void $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'bs_Latn' => 'Dan Nezavisnosti', - ], new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /* @@ -80,7 +77,7 @@ public function initialize(): void $this->addHoliday(new Holiday('statehoodDay', [ 'en' => 'Statehood Day', 'bs_Latn' => 'Dan državnosti', - ], new DateTime("$this->year-11-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-11-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /* @@ -89,7 +86,7 @@ public function initialize(): void $this->addHoliday(new Holiday('dayAfterNewYearsDay', [ 'en' => 'Day after New Year’s Day', 'bs_Latn' => 'Nova godina - drugi dan', - ], new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); /* * Second Labour day @@ -97,7 +94,7 @@ public function initialize(): void $this->addHoliday(new Holiday('secondLabourDay', [ 'en' => 'Second Labour Day', 'bs_Latn' => 'Praznik rada - drugi dan', - ], new DateTime("$this->year-05-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-05-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } public function getSources(): array diff --git a/src/Yasumi/Provider/Brazil.php b/src/Yasumi/Provider/Brazil.php index 7a09d20c1..ed8c4c4ef 100644 --- a/src/Yasumi/Provider/Brazil.php +++ b/src/Yasumi/Provider/Brazil.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class Brazil extends AbstractProvider /** * Initialize holidays for Brazil. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +68,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'carnavalMonday', ['pt' => 'Segunda-feira de Carnaval'], - $carnavalMonday->sub(new DateInterval('P48D')), + $carnavalMonday->sub(new \DateInterval('P48D')), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -81,7 +77,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'carnavalTuesday', ['pt' => 'Terça-feira de Carnaval'], - $carnavalTuesday->sub(new DateInterval('P47D')), + $carnavalTuesday->sub(new \DateInterval('P47D')), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -100,7 +96,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'tiradentesDay', ['pt' => 'Dia de Tiradentes'], - new DateTime("$this->year-04-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-04-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -117,7 +113,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'independenceDay', ['pt' => 'Dia da Independência do Brasil'], - new DateTime("$this->year-09-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-09-07", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -137,7 +133,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'ourLadyOfAparecidaDay', ['pt' => 'Dia de Nossa Senhora Aparecida'], - new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -153,7 +149,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'allSoulsDay', [], - new DateTime("$this->year-11-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -171,7 +167,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'proclamationOfRepublicDay', ['pt' => 'Dia da Proclamação da República'], - new DateTime("$this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada.php b/src/Yasumi/Provider/Canada.php index 6fc52365e..8fa1240ed 100644 --- a/src/Yasumi/Provider/Canada.php +++ b/src/Yasumi/Provider/Canada.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +35,6 @@ class Canada extends AbstractProvider /** * Initialize holidays for Canada. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +72,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Family_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -89,7 +85,7 @@ protected function calculateFamilyDay(): void $this->addHoliday(new Holiday( 'familyDay', [], - new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -99,7 +95,6 @@ protected function calculateFamilyDay(): void * * @see https://en.wikipedia.org/wiki/Victoria_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -113,7 +108,7 @@ protected function calculateVictoriaDay(): void $this->addHoliday(new Holiday( 'victoriaDay', [], - new DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -123,7 +118,6 @@ protected function calculateVictoriaDay(): void * * @see https://www.rcaanc-cirnac.gc.ca/eng/1100100013248/1534872397533 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -137,7 +131,7 @@ protected function calculateNationalIndigenousPeoplesDay(): void $this->addHoliday(new Holiday( 'nationalIndigenousPeoplesDay', [], - new DateTime("$this->year-06-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-06-21", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -147,7 +141,6 @@ protected function calculateNationalIndigenousPeoplesDay(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -161,7 +154,7 @@ protected function calculateCivicHoliday(): void $this->addHoliday(new Holiday( 'civicHoliday', [], - 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 )); } @@ -175,7 +168,6 @@ protected function calculateCivicHoliday(): void * by statute, Canada Day is July 1 if that day is not Sunday, and July 2 if July 1 is a Sunday. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -185,9 +177,9 @@ private function calculateCanadaDay(): void if ($this->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', @@ -202,7 +194,6 @@ private function calculateCanadaDay(): void * * @see https://en.wikipedia.org/wiki/Thanksgiving_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -216,7 +207,7 @@ private function calculateThanksgivingDay(): void $this->addHoliday(new Holiday( 'thanksgivingDay', [], - new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -226,7 +217,6 @@ private function calculateThanksgivingDay(): void * * @see https://en.wikipedia.org/wiki/Remembrance_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -240,7 +230,7 @@ private function calculateRemembranceDay(): void $this->addHoliday(new Holiday( 'remembranceDay', [], - new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -250,7 +240,6 @@ private function calculateRemembranceDay(): void * * @see https://en.wikipedia.org/wiki/Labour_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -264,7 +253,7 @@ private function calculateLabourDay(): void $this->addHoliday(new Holiday( 'labourDay', [], - new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -274,7 +263,6 @@ private function calculateLabourDay(): void * * @see https://parl.ca/Content/Bills/432/Government/C-5/C-5_4/C-5_4.PDF, S. C. 2021, C.11. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -288,7 +276,7 @@ private function calculateNationalDayForTruthAndReconciliation(): void $this->addHoliday(new Holiday( 'truthAndReconciliationDay', [], - new DateTime("last day of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("last day of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada/Alberta.php b/src/Yasumi/Provider/Canada/Alberta.php index 21f387e7d..ae5fd15b4 100644 --- a/src/Yasumi/Provider/Canada/Alberta.php +++ b/src/Yasumi/Provider/Canada/Alberta.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class Alberta extends Canada /** * Initialize holidays for Alberta (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ private function calculateHeritageDay(): void $this->addHoliday(new Holiday( 'heritageDay', [], - 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 )); } diff --git a/src/Yasumi/Provider/Canada/BritishColumbia.php b/src/Yasumi/Provider/Canada/BritishColumbia.php index ebb3a3be4..ca2507e52 100644 --- a/src/Yasumi/Provider/Canada/BritishColumbia.php +++ b/src/Yasumi/Provider/Canada/BritishColumbia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Canada; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Canada; @@ -36,7 +35,6 @@ class BritishColumbia extends Canada /** * Initialize holidays for British Columbia (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Canada/Manitoba.php b/src/Yasumi/Provider/Canada/Manitoba.php index 4aa9af92f..bbe8135a7 100644 --- a/src/Yasumi/Provider/Canada/Manitoba.php +++ b/src/Yasumi/Provider/Canada/Manitoba.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class Manitoba extends Canada /** * Initialize holidays for Manitoba (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ protected function calculateCivicHoliday(): void $this->addHoliday(new Holiday( 'terryFoxDay', [], - 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 )); } @@ -84,7 +80,6 @@ protected function calculateCivicHoliday(): void * * @see https://en.wikipedia.org/wiki/Family_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -98,7 +93,7 @@ private function calculateLouisRielDay(): void $this->addHoliday(new Holiday( 'louisRielDay', [], - new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada/NewBrunswick.php b/src/Yasumi/Provider/Canada/NewBrunswick.php index 4178d45bd..f47fc2c32 100644 --- a/src/Yasumi/Provider/Canada/NewBrunswick.php +++ b/src/Yasumi/Provider/Canada/NewBrunswick.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Canada; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Canada; @@ -36,7 +35,6 @@ class NewBrunswick extends Canada /** * Initialize holidays for New Brunswick (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php index ebd4556a1..713807436 100644 --- a/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php +++ b/src/Yasumi/Provider/Canada/NewfoundlandAndLabrador.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -40,7 +38,6 @@ class NewfoundlandAndLabrador extends Canada /** * Initialize holidays for Newfoundland and Labrador (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -67,11 +64,9 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Saint_Patrick%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateStPatricksDay(): void { @@ -82,7 +77,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => '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 ); @@ -113,11 +108,9 @@ private function calculateStPatricksDay(): void * * @see https://en.wikipedia.org/wiki/The_Twelfth * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateOrangemensDay(): void { @@ -128,7 +121,7 @@ private 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 6abf69fd3..8a58600e9 100644 --- a/src/Yasumi/Provider/Canada/NorthwestTerritories.php +++ b/src/Yasumi/Provider/Canada/NorthwestTerritories.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Canada; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Canada; @@ -36,7 +35,6 @@ class NorthwestTerritories extends Canada /** * Initialize holidays for Northwest Territories (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Canada/NovaScotia.php b/src/Yasumi/Provider/Canada/NovaScotia.php index c4141842e..8734fd184 100644 --- a/src/Yasumi/Provider/Canada/NovaScotia.php +++ b/src/Yasumi/Provider/Canada/NovaScotia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class NovaScotia extends Canada /** * Initialize holidays for Nova Scotia (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ protected function calculateCivicHoliday(): void $this->addHoliday(new Holiday( 'natalHoliday', [], - 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 )); } @@ -84,7 +80,6 @@ protected function calculateCivicHoliday(): void * * @see https://en.wikipedia.org/wiki/Family_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -98,7 +93,7 @@ private function calculateHeritageDay(): void $this->addHoliday(new Holiday( 'novaScotiaHeritageDay', [], - new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada/Nunavut.php b/src/Yasumi/Provider/Canada/Nunavut.php index 3ec863c1a..97fd6b8ad 100644 --- a/src/Yasumi/Provider/Canada/Nunavut.php +++ b/src/Yasumi/Provider/Canada/Nunavut.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Canada; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Canada; @@ -36,7 +35,6 @@ class Nunavut extends Canada /** * Initialize holidays for Nunavut (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Canada/Ontario.php b/src/Yasumi/Provider/Canada/Ontario.php index 74cfb2f07..12dfc4114 100644 --- a/src/Yasumi/Provider/Canada/Ontario.php +++ b/src/Yasumi/Provider/Canada/Ontario.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Canada; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Canada; @@ -36,7 +35,6 @@ class Ontario extends Canada /** * Initialize holidays for Ontario (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php b/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php index 68373252a..605d92310 100644 --- a/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php +++ b/src/Yasumi/Provider/Canada/PrinceEdwardIsland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class PrinceEdwardIsland extends Canada /** * Initialize holidays for Prince Edward Island (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Family_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ private function calculateIslanderDay(): void $this->addHoliday(new Holiday( 'islanderDay', [], - new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -84,7 +80,6 @@ private function calculateIslanderDay(): void * * @see https://en.wikipedia.org/wiki/Public_holidays_in_Canada#Statutory_holidays * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -98,7 +93,7 @@ private function calculateGoldCupParadeDay(): void $this->addHoliday(new Holiday( 'goldCupParadeDay', [], - new DateTime("third friday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third friday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada/Quebec.php b/src/Yasumi/Provider/Canada/Quebec.php index 2275fc17b..60d1d8a2c 100644 --- a/src/Yasumi/Provider/Canada/Quebec.php +++ b/src/Yasumi/Provider/Canada/Quebec.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class Quebec extends Canada /** * Initialize holidays for Quebec (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -71,7 +68,6 @@ public function initialize(): void * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -85,7 +81,7 @@ private function saintJeanBaptisteDay( return new Holiday( 'saintJeanBaptisteDay', [], - new DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -96,7 +92,6 @@ private function saintJeanBaptisteDay( * * @see https://en.wikipedia.org/wiki/National_Patriots%27_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -110,7 +105,7 @@ private function calculateNationalPatriotsDay(): void $this->addHoliday(new Holiday( 'nationalPatriotsDay', [], - new DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("last monday front of $this->year-05-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Canada/Saskatchewan.php b/src/Yasumi/Provider/Canada/Saskatchewan.php index 666ad56b8..dc154e917 100644 --- a/src/Yasumi/Provider/Canada/Saskatchewan.php +++ b/src/Yasumi/Provider/Canada/Saskatchewan.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class Saskatchewan extends Canada /** * Initialize holidays for Saskatchewan (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -60,7 +57,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -74,7 +70,7 @@ private function calculateSaskatchewanDay(): void $this->addHoliday(new Holiday( 'saskatchewanDay', [], - 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 )); } diff --git a/src/Yasumi/Provider/Canada/Yukon.php b/src/Yasumi/Provider/Canada/Yukon.php index fdb4d981f..df0f03652 100644 --- a/src/Yasumi/Provider/Canada/Yukon.php +++ b/src/Yasumi/Provider/Canada/Yukon.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Canada; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Canada; @@ -39,7 +37,6 @@ class Yukon extends Canada /** * Initialize holidays for Yukon (Canada). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -61,7 +58,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Civic_Holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +71,7 @@ private function calculateDiscoveryDay(): void $this->addHoliday(new Holiday( 'discoveryDay', [], - new DateTime("third monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -85,7 +81,6 @@ private function calculateDiscoveryDay(): void * * @see https://en.wikipedia.org/wiki/Family_Day_(Canada) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -99,7 +94,7 @@ private function calculateHeritageDay(): void $this->addHoliday(new Holiday( 'yukonHeritageDay', [], - 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 )); } diff --git a/src/Yasumi/Provider/ChristianHolidays.php b/src/Yasumi/Provider/ChristianHolidays.php index 40e229a11..3274499ad 100644 --- a/src/Yasumi/Provider/ChristianHolidays.php +++ b/src/Yasumi/Provider/ChristianHolidays.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -42,7 +39,6 @@ trait ChristianHolidays * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default a type of 'other' is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -56,7 +52,7 @@ protected function corpusChristi( return new Holiday( 'corpusChristi', [], - $this->calculateEaster($year, $timezone)->add(new DateInterval('P60D')), + $this->calculateEaster($year, $timezone)->add(new \DateInterval('P60D')), $locale, $type ); @@ -78,7 +74,6 @@ protected function corpusChristi( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -89,7 +84,7 @@ protected function allSaintsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('allSaintsDay', [], new DateTime("$year-11-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('allSaintsDay', [], new \DateTime("$year-11-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -107,7 +102,6 @@ protected function allSaintsDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -121,7 +115,7 @@ protected function assumptionOfMary( return new Holiday( 'assumptionOfMary', [], - new DateTime("$year-8-15", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-8-15", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -140,7 +134,6 @@ protected function assumptionOfMary( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -154,7 +147,7 @@ protected function goodFriday( return new Holiday( 'goodFriday', [], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P2D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P2D')), $locale, $type ); @@ -177,7 +170,6 @@ protected function goodFriday( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -188,7 +180,7 @@ protected function epiphany( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('epiphany', [], new DateTime("$year-1-6", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('epiphany', [], new \DateTime("$year-1-6", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -208,7 +200,6 @@ protected function epiphany( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -219,7 +210,7 @@ protected function stJosephsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stJosephsDay', [], new DateTime("$year-3-19", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('stJosephsDay', [], new \DateTime("$year-3-19", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -238,7 +229,6 @@ protected function stJosephsDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -249,7 +239,7 @@ protected function stGeorgesDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stGeorgesDay', [], new DateTime("$year-4-23", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('stGeorgesDay', [], new \DateTime("$year-4-23", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -275,7 +265,7 @@ protected function calculateOrthodoxEaster(int $year, string $timezone): \DateTi $month = floor(($d + $e + 114) / 31); $day = (($d + $e + 114) % 31) + 1; - return (new DateTime("$year-$month-$day", DateTimeZoneFactory::getDateTimeZone($timezone)))->add(new DateInterval('P13D')); + return (new \DateTime("$year-$month-$day", DateTimeZoneFactory::getDateTimeZone($timezone)))->add(new \DateInterval('P13D')); } /** @@ -299,7 +289,6 @@ protected function calculateOrthodoxEaster(int $year, string $timezone): \DateTi * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -313,7 +302,7 @@ protected function reformationDay( return new Holiday( 'reformationDay', [], - new DateTime("$year-10-31", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-10-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -390,8 +379,8 @@ protected function calculateEaster(int $year, string $timezone): \DateTimeInterf $easterDays = $pfm + $tmp + 1; // Easter as the number of days after 21st March } - $easter = new DateTime("$year-3-21", DateTimeZoneFactory::getDateTimeZone($timezone)); - $easter->add(new DateInterval('P'.$easterDays.'D')); + $easter = new \DateTime("$year-3-21", DateTimeZoneFactory::getDateTimeZone($timezone)); + $easter->add(new \DateInterval('P'.$easterDays.'D')); return $easter; } @@ -411,7 +400,6 @@ protected function calculateEaster(int $year, string $timezone): \DateTimeInterf * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -437,7 +425,6 @@ protected function easter( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -451,7 +438,7 @@ protected function pentecost( return new Holiday( 'pentecost', [], - $this->calculateEaster($year, $timezone)->add(new DateInterval('P49D')), + $this->calculateEaster($year, $timezone)->add(new \DateInterval('P49D')), $locale, $type ); @@ -472,12 +459,11 @@ protected function pentecost( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function easterMonday( + protected function easterMonday( int $year, string $timezone, string $locale, @@ -486,7 +472,7 @@ private function easterMonday( return new Holiday( 'easterMonday', [], - $this->calculateEaster($year, $timezone)->add(new DateInterval('P1D')), + $this->calculateEaster($year, $timezone)->add(new \DateInterval('P1D')), $locale, $type ); @@ -507,12 +493,11 @@ private function easterMonday( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function ascensionDay( + protected function ascensionDay( int $year, string $timezone, string $locale, @@ -521,7 +506,7 @@ private function ascensionDay( return new Holiday( 'ascensionDay', [], - $this->calculateEaster($year, $timezone)->add(new DateInterval('P39D')), + $this->calculateEaster($year, $timezone)->add(new \DateInterval('P39D')), $locale, $type ); @@ -539,12 +524,11 @@ private function ascensionDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function pentecostMonday( + protected function pentecostMonday( int $year, string $timezone, string $locale, @@ -553,7 +537,7 @@ private function pentecostMonday( return new Holiday( 'pentecostMonday', [], - $this->calculateEaster($year, $timezone)->add(new DateInterval('P50D')), + $this->calculateEaster($year, $timezone)->add(new \DateInterval('P50D')), $locale, $type ); @@ -575,12 +559,11 @@ private function pentecostMonday( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default observance is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function christmasEve( + protected function christmasEve( int $year, string $timezone, string $locale, @@ -589,7 +572,7 @@ private function christmasEve( return new Holiday( 'christmasEve', [], - new DateTime("$year-12-24", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-12-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -608,12 +591,11 @@ private function christmasEve( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function christmasDay( + protected function christmasDay( int $year, string $timezone, string $locale, @@ -622,7 +604,7 @@ private function christmasDay( return new Holiday( 'christmasDay', [], - new DateTime("$year-12-25", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-12-25", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -641,12 +623,11 @@ private function christmasDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function secondChristmasDay( + protected function secondChristmasDay( int $year, string $timezone, string $locale, @@ -655,7 +636,7 @@ private function secondChristmasDay( return new Holiday( 'secondChristmasDay', [], - new DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -676,12 +657,11 @@ private function secondChristmasDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function ashWednesday( + protected function ashWednesday( int $year, string $timezone, string $locale, @@ -690,7 +670,7 @@ private function ashWednesday( return new Holiday( 'ashWednesday', [], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P46D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P46D')), $locale, $type ); @@ -712,12 +692,11 @@ private function ashWednesday( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function immaculateConception( + protected function immaculateConception( int $year, string $timezone, string $locale, @@ -726,7 +705,7 @@ private function immaculateConception( return new Holiday( 'immaculateConception', [], - new DateTime("$year-12-8", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-12-8", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -749,12 +728,11 @@ private function immaculateConception( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function stStephensDay( + protected function stStephensDay( int $year, string $timezone, string $locale, @@ -763,7 +741,7 @@ private function stStephensDay( return new Holiday( 'stStephensDay', [], - new DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-12-26", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -785,12 +763,11 @@ private function stStephensDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function maundyThursday( + protected function maundyThursday( int $year, string $timezone, string $locale, @@ -799,7 +776,7 @@ private function maundyThursday( return new Holiday( 'maundyThursday', [], - $this->calculateEaster($year, $timezone)->sub(new DateInterval('P3D')), + $this->calculateEaster($year, $timezone)->sub(new \DateInterval('P3D')), $locale, $type ); @@ -822,18 +799,17 @@ private function maundyThursday( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function stJohnsDay( + protected function stJohnsDay( int $year, string $timezone, string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('stJohnsDay', [], new DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('stJohnsDay', [], new \DateTime("$year-06-24", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -853,12 +829,11 @@ private function stJohnsDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function annunciation( + protected function annunciation( int $year, string $timezone, string $locale, @@ -867,7 +842,7 @@ private function annunciation( return new Holiday( 'annunciation', [], - new DateTime("$year-03-25", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-03-25", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); diff --git a/src/Yasumi/Provider/CommonHolidays.php b/src/Yasumi/Provider/CommonHolidays.php index 8afb5131d..20f55c30c 100644 --- a/src/Yasumi/Provider/CommonHolidays.php +++ b/src/Yasumi/Provider/CommonHolidays.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -44,7 +42,6 @@ trait CommonHolidays * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -55,7 +52,7 @@ protected function newYearsDay( string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('newYearsDay', [], new DateTime("$year-1-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('newYearsDay', [], new \DateTime("$year-1-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -75,7 +72,6 @@ protected function newYearsDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -89,7 +85,7 @@ protected function internationalWorkersDay( return new Holiday( 'internationalWorkersDay', [], - new DateTime("$year-5-1", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-5-1", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -112,7 +108,6 @@ protected function internationalWorkersDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -126,7 +121,7 @@ protected function stMartinsDay( return new Holiday( 'stMartinsDay', [], - new DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -145,7 +140,6 @@ protected function stMartinsDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -159,7 +153,7 @@ protected function internationalWomensDay( return new Holiday( 'internationalWomensDay', [], - new DateTime("$year-03-08", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-03-08", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -181,18 +175,17 @@ protected function internationalWomensDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function newYearsEve( + protected function newYearsEve( int $year, string $timezone, string $locale, string $type = Holiday::TYPE_OFFICIAL ): Holiday { - return new Holiday('newYearsEve', [], new DateTime("$year-12-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); + return new Holiday('newYearsEve', [], new \DateTime("$year-12-31", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type); } /** @@ -212,12 +205,11 @@ private function newYearsEve( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function valentinesDay( + protected function valentinesDay( int $year, string $timezone, string $locale, @@ -226,7 +218,7 @@ private function valentinesDay( return new Holiday( 'valentinesDay', [], - new DateTime("$year-2-14", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-2-14", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -247,12 +239,11 @@ private function valentinesDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function worldAnimalDay( + protected function worldAnimalDay( int $year, string $timezone, string $locale, @@ -261,7 +252,7 @@ private function worldAnimalDay( return new Holiday( 'worldAnimalDay', [], - new DateTime("$year-10-4", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-10-4", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -283,12 +274,11 @@ private function worldAnimalDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function fathersDay( + protected function fathersDay( int $year, string $timezone, string $locale, @@ -297,7 +287,7 @@ private function fathersDay( return new Holiday( 'fathersDay', [], - new DateTime("third sunday of june $year", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("third sunday of june $year", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -319,12 +309,11 @@ private function fathersDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function mothersDay( + protected function mothersDay( int $year, string $timezone, string $locale, @@ -333,7 +322,7 @@ private function mothersDay( return new Holiday( 'mothersDay', [], - new DateTime("second sunday of may $year", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("second sunday of may $year", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -355,12 +344,11 @@ private function mothersDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function victoryInEuropeDay( + protected function victoryInEuropeDay( int $year, string $timezone, string $locale, @@ -369,7 +357,7 @@ private function victoryInEuropeDay( return new Holiday( 'victoryInEuropeDay', [], - new DateTime("$year-5-8", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-5-8", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -393,12 +381,11 @@ private function victoryInEuropeDay( * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception */ - private function armisticeDay( + protected function armisticeDay( int $year, string $timezone, string $locale, @@ -407,7 +394,7 @@ private function armisticeDay( return new Holiday( 'armisticeDay', [], - new DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime("$year-11-11", DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); @@ -426,7 +413,7 @@ private function armisticeDay( * * @throws \Exception */ - private function summerTime( + protected function summerTime( int $year, string $timezone, string $locale, @@ -460,7 +447,7 @@ private function summerTime( * * @throws \Exception */ - private function winterTime( + protected function winterTime( int $year, string $timezone, string $locale, @@ -510,9 +497,23 @@ private function calculateSummerWinterTime( ): ?\DateTimeImmutable { $zone = DateTimeZoneFactory::getDateTimeZone($timezone); - $transitions = $zone->getTransitions(mktime(0, 0, 0, 1, 1, $year), mktime(23, 59, 59, 12, 31, $year)); + $tsBegin = strtotime(sprintf('%u-01-01 00:00:00', $year)); + if (false === $tsBegin) { + throw new \RuntimeException(sprintf('unable to create a beginning timestamp for the year `%u`', $year)); + } + + $tsEnd = strtotime(sprintf('%u-12-31 23:59:59', $year)); + if (false === $tsEnd) { + throw new \RuntimeException(sprintf('unable to create an ending timestamp for the year `%u`', $year)); + } + + $transitions = $zone->getTransitions($tsBegin, $tsEnd); $transition = array_shift($transitions); + if (!is_array($transition)) { + throw new \RuntimeException('unable to get transition details'); + } + $dst = $transition['isdst']; foreach ($transitions as $transition) { diff --git a/src/Yasumi/Provider/Croatia.php b/src/Yasumi/Provider/Croatia.php index e64bf30b6..a692e078b 100644 --- a/src/Yasumi/Provider/Croatia.php +++ b/src/Yasumi/Provider/Croatia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -38,7 +36,6 @@ class Croatia extends AbstractProvider /** * Initialize holidays for Croatia. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -68,7 +65,7 @@ public function initialize(): void $this->addHoliday(new Holiday('antifascistStruggleDay', [ 'en' => 'Day of Antifascist Struggle', 'hr' => 'Dan antifašističke borbe', - ], new DateTime("$this->year-6-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-6-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } $this->calculateStatehoodDay(); @@ -97,9 +94,9 @@ private function calculateStatehoodDay(): void $statehoodDayDate = null; if ($this->year >= 1991 && $this->year < 2020) { - $statehoodDayDate = new DateTime("$this->year-6-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $statehoodDayDate = new \DateTime("$this->year-6-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2020) { - $statehoodDayDate = new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $statehoodDayDate = new \DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } if (null !== $statehoodDayDate) { @@ -131,7 +128,7 @@ private function calculateHomelandThanksgivingDay(): void $this->addHoliday(new Holiday( 'homelandThanksgiving', $names, - new DateTime("$this->year-8-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-8-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -146,12 +143,18 @@ private function calculateHomelandThanksgivingDay(): void */ private function calculateIndependenceDay(): void { - if ($this->year >= 1991 && $this->year < 2020) { - $this->addHoliday(new Holiday('independenceDay', [ - 'en' => 'Independence Day', - 'hr' => 'Dan neovisnosti', - ], new DateTime("$this->year-10-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + if ($this->year < 1991) { + return; } + + if ($this->year >= 2020) { + return; + } + + $this->addHoliday(new Holiday('independenceDay', [ + 'en' => 'Independence Day', + 'hr' => 'Dan neovisnosti', + ], new \DateTime("$this->year-10-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -166,7 +169,7 @@ private function calculateRemembranceDayForHomelandWarVictims(): void $this->addHoliday(new Holiday('remembranceDay', [ 'en' => 'Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja', 'hr' => 'Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje', - ], new DateTime("$this->year-11-18", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-11-18", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/CzechRepublic.php b/src/Yasumi/Provider/CzechRepublic.php index fe7db41e3..442523566 100644 --- a/src/Yasumi/Provider/CzechRepublic.php +++ b/src/Yasumi/Provider/CzechRepublic.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -40,7 +38,6 @@ class CzechRepublic extends AbstractProvider /** * Initialize holidays for the Czech Republic. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -78,7 +75,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -91,7 +87,7 @@ private function calculateRenewalOfCzechIndependenceDay(): void 'cs' => '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 )); } @@ -112,7 +108,6 @@ private function calculateRenewalOfCzechIndependenceDay(): void * @see https://en.wikipedia.org/wiki/Saints_Cyril_and_Methodius * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -125,7 +120,7 @@ private function calculateSaintsCyrilAndMethodiusDay(): void 'cs' => 'Den slovanských věrozvěstů Cyrila a Metoděje', 'en' => 'Saints Cyril and Methodius Day', ], - new DateTime($this->year.'-07-5', new \DateTimeZone($this->timezone)), + new \DateTime($this->year.'-07-5', new \DateTimeZone($this->timezone)), $this->locale )); } @@ -140,7 +135,6 @@ private function calculateSaintsCyrilAndMethodiusDay(): void * @see https://en.wikipedia.org/wiki/Jan_Hus * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -150,7 +144,7 @@ private 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 )); } @@ -168,7 +162,6 @@ private function calculateJanHusDay(): void * @see https://en.wikipedia.org/wiki/Wenceslaus_I,_Duke_of_Bohemia * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -181,7 +174,7 @@ private 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 )); } @@ -191,7 +184,6 @@ private function calculateCzechStatehoodDay(): void * * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -201,7 +193,7 @@ private 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)); } /** @@ -209,7 +201,6 @@ private function calculateIndependentCzechoslovakStateDay(): void * * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -222,7 +213,7 @@ private function calculateStruggleForFreedomAndDemocracyDay(): void 'cs' => 'Den boje za svobodu a demokracii', 'en' => 'Struggle for Freedom and Democracy Day', ], - new DateTime($this->year.'-11-17', new \DateTimeZone($this->timezone)), + new \DateTime($this->year.'-11-17', new \DateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/DateTimeZoneFactory.php b/src/Yasumi/Provider/DateTimeZoneFactory.php index 9aead9d21..aded018cd 100644 --- a/src/Yasumi/Provider/DateTimeZoneFactory.php +++ b/src/Yasumi/Provider/DateTimeZoneFactory.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -22,7 +22,7 @@ final class DateTimeZoneFactory { /** @var array */ - private static ?array $dateTimeZones = null; + private static array $dateTimeZones = []; public static function getDateTimeZone(string $timezone): \DateTimeZone { diff --git a/src/Yasumi/Provider/Denmark.php b/src/Yasumi/Provider/Denmark.php index deeef714c..4fd00c526 100644 --- a/src/Yasumi/Provider/Denmark.php +++ b/src/Yasumi/Provider/Denmark.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +35,6 @@ class Denmark extends AbstractProvider /** * Initialize holidays for Denmark. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -94,7 +91,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Store_Bededag * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -107,7 +103,7 @@ private function calculateGreatPrayerDay(): void $this->addHoliday(new Holiday( 'greatPrayerDay', ['da' => 'store bededag'], - new DateTime("fourth friday $easter", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("fourth friday $easter", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -124,7 +120,6 @@ private function calculateGreatPrayerDay(): void * * @see https://en.wikipedia.org/wiki/Constitution_Day_(Denmark) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -135,7 +130,7 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday( 'constitutionDay', ['da' => 'grundlovsdag'], - new DateTime("$this->year-6-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); diff --git a/src/Yasumi/Provider/Estonia.php b/src/Yasumi/Provider/Estonia.php index f87b7b12c..4b2c1c6cd 100644 --- a/src/Yasumi/Provider/Estonia.php +++ b/src/Yasumi/Provider/Estonia.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Provider/Finland.php b/src/Yasumi/Provider/Finland.php index 8370df710..ccbe88db6 100644 --- a/src/Yasumi/Provider/Finland.php +++ b/src/Yasumi/Provider/Finland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Finland extends AbstractProvider /** * Initialize holidays for Finland. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -88,7 +85,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Midsummer#Finland * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -100,7 +96,7 @@ private function calculateStJohnsDay(): void $this->addHoliday(new Holiday( 'stJohnsDay', [], - new DateTime($stJohnsDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($stJohnsDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -122,7 +118,6 @@ private function calculateStJohnsDay(): void * @see https://en.wikipedia.org/wiki/All_Saints%27_Day * @see https://fi.wikipedia.org/wiki/Pyh%C3%A4inp%C3%A4iv%C3%A4 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -132,7 +127,7 @@ private function calculateAllSaintsDay(): void $this->addHoliday(new Holiday( 'allSaintsDay', [], - new DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -150,7 +145,6 @@ private function calculateAllSaintsDay(): void * * @see https://en.wikipedia.org/wiki/Independence_Day_(Finland) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -161,7 +155,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday( 'independenceDay', ['fi' => 'Itsenäisyyspäivä'], - new DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/France.php b/src/Yasumi/Provider/France.php old mode 100755 new mode 100644 index 7be3329eb..56d9acbf2 --- a/src/Yasumi/Provider/France.php +++ b/src/Yasumi/Provider/France.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -33,10 +31,11 @@ class France extends AbstractProvider */ public const ID = 'FR'; + public const EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY = 2004; + /** * Initialize holidays for France. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -56,7 +55,6 @@ public function initialize(): void $this->addHoliday($this->easterMonday($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->internationalWorkersDay($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->ascensionDay($this->year, $this->timezone, $this->locale)); - $this->addHoliday($this->pentecostMonday($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->assumptionOfMary($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale)); @@ -68,6 +66,7 @@ public function initialize(): void // Calculate other holidays $this->calculateBastilleDay(); + $this->calculatePentecostMonday(); } public function getSources(): array @@ -89,7 +88,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Bastille_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -100,7 +98,30 @@ private function calculateBastilleDay(): void $this->addHoliday(new Holiday('bastilleDay', [ 'en' => 'Bastille Day', 'fr' => 'La Fête nationale', - ], new DateTime("$this->year-7-14", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-7-14", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + } + } + + /** + * Pentecost Monday. + * + * Until 2004, Pentecost Monday was an official holiday. Since 2004, the holiday is considered a 'working holiday', + * imposed by law to be by default on Pentecost Monday. Pentecost Monday is still a holiday (but a working holiday). + * + * @see: https://en.wikipedia.org/wiki/Journ%C3%A9e_de_solidarit%C3%A9_envers_les_personnes_%C3%A2g%C3%A9es + * + * @see: https://fr.wikipedia.org/w/index.php?title=Journ%C3%A9e_de_solidarit%C3%A9_envers_les_personnes_%C3%A2g%C3%A9es_et_handicap%C3%A9es&tableofcontents=0 + * + * @throws \Exception + */ + private function calculatePentecostMonday(): void + { + $type = Holiday::TYPE_OFFICIAL; + + if ($this->year >= 2004) { + $type = Holiday::TYPE_OBSERVANCE; } + + $this->addHoliday($this->pentecostMonday($this->year, $this->timezone, $this->locale, $type)); } } diff --git a/src/Yasumi/Provider/France/BasRhin.php b/src/Yasumi/Provider/France/BasRhin.php old mode 100755 new mode 100644 index b924a3b05..c7c98f3be --- a/src/Yasumi/Provider/France/BasRhin.php +++ b/src/Yasumi/Provider/France/BasRhin.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\France; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\ChristianHolidays; use Yasumi\Provider\France; @@ -41,7 +40,6 @@ class BasRhin extends France /** * Initialize holidays for Bas-Rhin (France). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/France/HautRhin.php b/src/Yasumi/Provider/France/HautRhin.php old mode 100755 new mode 100644 index 6eff5dd82..93299f6b8 --- a/src/Yasumi/Provider/France/HautRhin.php +++ b/src/Yasumi/Provider/France/HautRhin.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\France; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\ChristianHolidays; use Yasumi\Provider\France; @@ -41,7 +40,6 @@ class HautRhin extends France /** * Initialize holidays for Haut-Rhin (France). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/France/Moselle.php b/src/Yasumi/Provider/France/Moselle.php old mode 100755 new mode 100644 index 2c6abb304..c7bfcd40a --- a/src/Yasumi/Provider/France/Moselle.php +++ b/src/Yasumi/Provider/France/Moselle.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\France; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\ChristianHolidays; use Yasumi\Provider\France; @@ -42,7 +41,6 @@ class Moselle extends France /** * Initialize holidays for Moselle (France). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Georgia.php b/src/Yasumi/Provider/Georgia.php index 8822ee289..c378235af 100644 --- a/src/Yasumi/Provider/Georgia.php +++ b/src/Yasumi/Provider/Georgia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -73,9 +73,9 @@ public function getSources(): array } /** - * @throws \Exception - * * @return \DateTime|\DateTimeImmutable + * + * @throws \Exception */ protected function calculateEaster(int $year, string $timezone): \DateTimeInterface { diff --git a/src/Yasumi/Provider/Germany.php b/src/Yasumi/Provider/Germany.php index 0d49459ef..d4a365184 100644 --- a/src/Yasumi/Provider/Germany.php +++ b/src/Yasumi/Provider/Germany.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +35,6 @@ class Germany extends AbstractProvider /** * Initialize holidays for Germany. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -89,7 +86,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/German_Unity_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -100,7 +96,7 @@ private function calculateGermanUnityDay(): void $this->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 old mode 100755 new mode 100644 index 4f84b2897..9c7e92379 --- a/src/Yasumi/Provider/Germany/BadenWurttemberg.php +++ b/src/Yasumi/Provider/Germany/BadenWurttemberg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -39,7 +38,6 @@ class BadenWurttemberg extends Germany /** * Initialize holidays for Baden-Württemberg (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -49,7 +47,7 @@ public function initialize(): void parent::initialize(); // Add custom Christian holidays - $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER)); + $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale, Holiday::TYPE_OFFICIAL)); $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale)); } diff --git a/src/Yasumi/Provider/Germany/Bavaria.php b/src/Yasumi/Provider/Germany/Bavaria.php old mode 100755 new mode 100644 index d043b918a..6d0f687b8 --- a/src/Yasumi/Provider/Germany/Bavaria.php +++ b/src/Yasumi/Provider/Germany/Bavaria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -38,7 +37,6 @@ class Bavaria extends Germany public const ID = 'DE-BY'; /** - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -48,7 +46,7 @@ public function initialize(): void parent::initialize(); // Add custom Christian holidays - $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER)); + $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale)); $this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale, Holiday::TYPE_OFFICIAL)); $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale)); } diff --git a/src/Yasumi/Provider/Germany/Berlin.php b/src/Yasumi/Provider/Germany/Berlin.php old mode 100755 new mode 100644 index 5d77e3420..6e9b59a64 --- a/src/Yasumi/Provider/Germany/Berlin.php +++ b/src/Yasumi/Provider/Germany/Berlin.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Germany; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\DateTimeZoneFactory; @@ -42,7 +40,6 @@ class Berlin extends Germany /** * Initialize holidays for Berlin (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -73,7 +70,6 @@ public function initialize(): void * @param string $type The type of holiday. Use the following constants: TYPE_OFFICIAL, TYPE_OBSERVANCE, * TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -86,7 +82,7 @@ private function dayOfLiberation( return new Holiday( 'dayOfLiberation', [], - new DateTime('2020-05-08', DateTimeZoneFactory::getDateTimeZone($timezone)), + new \DateTime('2020-05-08', DateTimeZoneFactory::getDateTimeZone($timezone)), $locale, $type ); diff --git a/src/Yasumi/Provider/Germany/Brandenburg.php b/src/Yasumi/Provider/Germany/Brandenburg.php old mode 100755 new mode 100644 index 201ac9ff4..1d2e7103f --- a/src/Yasumi/Provider/Germany/Brandenburg.php +++ b/src/Yasumi/Provider/Germany/Brandenburg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Germany; @@ -38,7 +37,6 @@ class Brandenburg extends Germany /** * Initialize holidays for Brandenburg (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -59,7 +57,6 @@ public function initialize(): void * For the German state of Brandenburg, Reformation Day was celebrated since 1517. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Bremen.php b/src/Yasumi/Provider/Germany/Bremen.php old mode 100755 new mode 100644 index 27090fa30..9ae2a4aa4 --- a/src/Yasumi/Provider/Germany/Bremen.php +++ b/src/Yasumi/Provider/Germany/Bremen.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Germany; @@ -38,7 +37,6 @@ class Bremen extends Germany /** * Initialize holidays for Bremen (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -55,7 +53,6 @@ public function initialize(): void * For the German state of Bremen, Reformation Day is celebrated since 2018. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Hamburg.php b/src/Yasumi/Provider/Germany/Hamburg.php old mode 100755 new mode 100644 index 98eb9408f..8894624c9 --- a/src/Yasumi/Provider/Germany/Hamburg.php +++ b/src/Yasumi/Provider/Germany/Hamburg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -40,7 +39,6 @@ class Hamburg extends Germany /** * Initialize holidays for Schleswig-Holstein (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -56,7 +54,6 @@ public function initialize(): void * Since 2018 Hamburg celebrates the "Day of Reformation". * It is not called "Reformation Day" like other states to prevent church-based associations. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Hesse.php b/src/Yasumi/Provider/Germany/Hesse.php old mode 100755 new mode 100644 index d73cbff3d..5df1b70d4 --- a/src/Yasumi/Provider/Germany/Hesse.php +++ b/src/Yasumi/Provider/Germany/Hesse.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -41,7 +40,6 @@ class Hesse extends Germany /** * Initialize holidays for Hesse (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/LowerSaxony.php b/src/Yasumi/Provider/Germany/LowerSaxony.php old mode 100755 new mode 100644 index f73e412c5..a31d90219 --- a/src/Yasumi/Provider/Germany/LowerSaxony.php +++ b/src/Yasumi/Provider/Germany/LowerSaxony.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Germany; @@ -39,7 +38,6 @@ class LowerSaxony extends Germany /** * Initialize holidays for Lower Saxony (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -58,7 +56,6 @@ public function initialize(): void * * @see https://www.zeit.de/gesellschaft/zeitgeschehen/2018-06/reformationstag-niedersachsen-neuer-feiertag * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/MecklenburgWesternPomerania.php b/src/Yasumi/Provider/Germany/MecklenburgWesternPomerania.php old mode 100755 new mode 100644 index 71baed470..7809fbdf2 --- a/src/Yasumi/Provider/Germany/MecklenburgWesternPomerania.php +++ b/src/Yasumi/Provider/Germany/MecklenburgWesternPomerania.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Germany; @@ -39,7 +38,6 @@ class MecklenburgWesternPomerania extends Germany /** * Initialize holidays for Mecklenburg-Western Pomerania (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -56,7 +54,6 @@ public function initialize(): void * For the German state of Mecklenburg-Western Pomerania, Reformation Day was celebrated since 1517. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/NorthRhineWestphalia.php b/src/Yasumi/Provider/Germany/NorthRhineWestphalia.php old mode 100755 new mode 100644 index 8cb3cdfad..6ee8da18f --- a/src/Yasumi/Provider/Germany/NorthRhineWestphalia.php +++ b/src/Yasumi/Provider/Germany/NorthRhineWestphalia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -40,7 +39,6 @@ class NorthRhineWestphalia extends Germany /** * Initialize holidays for North Rhine-Westphalia (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/RhinelandPalatinate.php b/src/Yasumi/Provider/Germany/RhinelandPalatinate.php old mode 100755 new mode 100644 index bff0b0e40..d72dbd322 --- a/src/Yasumi/Provider/Germany/RhinelandPalatinate.php +++ b/src/Yasumi/Provider/Germany/RhinelandPalatinate.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -39,7 +38,6 @@ class RhinelandPalatinate extends Germany /** * Initialize holidays for Rhineland Palatinate (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Saarland.php b/src/Yasumi/Provider/Germany/Saarland.php old mode 100755 new mode 100644 index 32b035e01..508a6f0eb --- a/src/Yasumi/Provider/Germany/Saarland.php +++ b/src/Yasumi/Provider/Germany/Saarland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\Germany; @@ -40,7 +39,6 @@ class Saarland extends Germany /** * Initialize holidays for Saarland (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Saxony.php b/src/Yasumi/Provider/Germany/Saxony.php old mode 100755 new mode 100644 index 83b4579cd..ad2819941 --- a/src/Yasumi/Provider/Germany/Saxony.php +++ b/src/Yasumi/Provider/Germany/Saxony.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Germany; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\DateTimeZoneFactory; @@ -41,7 +39,6 @@ class Saxony extends Germany /** * Initialize holidays for Saxony (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -59,7 +56,6 @@ public function initialize(): void * For the German state of Saxony, Reformation Day was celebrated since 1517. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -85,7 +81,6 @@ private function calculateReformationDay(): void * * @see https://en.wikipedia.org/wiki/Bu%C3%9F-_und_Bettag * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -96,7 +91,7 @@ private function calculateRepentanceAndPrayerDay(): void $this->addHoliday(new Holiday( 'repentanceAndPrayerDay', ['de' => 'Buß- und Bettag'], - new DateTime("next wednesday $this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("next wednesday $this->year-11-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/Germany/SaxonyAnhalt.php b/src/Yasumi/Provider/Germany/SaxonyAnhalt.php old mode 100755 new mode 100644 index b79334166..b526f9c4f --- a/src/Yasumi/Provider/Germany/SaxonyAnhalt.php +++ b/src/Yasumi/Provider/Germany/SaxonyAnhalt.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,7 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; -use Yasumi\Holiday; use Yasumi\Provider\Germany; /** @@ -39,7 +37,6 @@ class SaxonyAnhalt extends Germany /** * Initialize holidays for Saxony-Anhalt (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -49,7 +46,7 @@ public function initialize(): void parent::initialize(); // Add custom Christian holidays - $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER)); + $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale)); $this->calculateReformationDay(); } @@ -57,7 +54,6 @@ public function initialize(): void * For the German state of Saxony-Anhalt, Reformation Day was celebrated since 1517. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/SchleswigHolstein.php b/src/Yasumi/Provider/Germany/SchleswigHolstein.php old mode 100755 new mode 100644 index 966040822..b590d6679 --- a/src/Yasumi/Provider/Germany/SchleswigHolstein.php +++ b/src/Yasumi/Provider/Germany/SchleswigHolstein.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Provider\Germany; @@ -38,7 +37,6 @@ class SchleswigHolstein extends Germany /** * Initialize holidays for Schleswig-Holstein (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -55,7 +53,6 @@ public function initialize(): void * For the German state of Schleswig-Holstein, Reformation Day is celebrated since 2018. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Germany/Thuringia.php b/src/Yasumi/Provider/Germany/Thuringia.php old mode 100755 new mode 100644 index 1806f1ee9..37cd178f9 --- a/src/Yasumi/Provider/Germany/Thuringia.php +++ b/src/Yasumi/Provider/Germany/Thuringia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Germany; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\DateTimeZoneFactory; @@ -41,7 +40,6 @@ class Thuringia extends Germany /** * Initialize holidays for Thuringia (Germany). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -61,7 +59,6 @@ public function initialize(): void * For the German state of Thuringia, Reformation Day was celebrated since 1517. * Note: In 2017 all German states will celebrate Reformation Day for its 500th anniversary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Greece.php b/src/Yasumi/Provider/Greece.php index f6c0635f3..5420783bb 100644 --- a/src/Yasumi/Provider/Greece.php +++ b/src/Yasumi/Provider/Greece.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class Greece extends AbstractProvider /** * Initialize holidays for Greece. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -86,7 +82,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Three_Holy_Hierarchs * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -96,7 +91,7 @@ private function calculateThreeHolyHierarchs(): void $this->addHoliday(new Holiday( 'threeHolyHierarchs', ['el' => 'Τριών Ιεραρχών'], - new DateTime("$this->year-1-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-1-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -111,7 +106,6 @@ private function calculateThreeHolyHierarchs(): void * * @see https://en.wikipedia.org/wiki/Clean_Monday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -121,7 +115,7 @@ private function calculateCleanMonday(): void $this->addHoliday(new Holiday( 'cleanMonday', ['el' => 'Καθαρά Δευτέρα'], - $this->calculateEaster($this->year, $this->timezone)->sub(new DateInterval('P48D')), + $this->calculateEaster($this->year, $this->timezone)->sub(new \DateInterval('P48D')), $this->locale )); } @@ -129,9 +123,9 @@ private function calculateCleanMonday(): void /** * Orthodox Easter. * - * @throws \Exception - * * @return \DateTime|\DateTimeImmutable + * + * @throws \Exception */ private function calculateEaster(int $year, string $timezone): \DateTimeInterface { @@ -145,7 +139,6 @@ private function calculateEaster(int $year, string $timezone): \DateTimeInterfac * * @see https://en.wikipedia.org/wiki/Greek_War_of_Independence * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -156,7 +149,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday( 'independenceDay', ['el' => 'Εικοστή Πέμπτη Μαρτίου'], - new DateTime("$this->year-3-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-3-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -169,7 +162,6 @@ private function calculateIndependenceDay(): void * * @see https://en.wikipedia.org/wiki/Ohi_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -180,7 +172,7 @@ private function calculateOhiDay(): void $this->addHoliday(new Holiday( 'ohiDay', ['el' => 'Επέτειος του Όχι'], - new DateTime("$this->year-10-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -193,7 +185,6 @@ private function calculateOhiDay(): void * * @see https://en.wikipedia.org/wiki/Athens_Polytechnic_uprising * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -204,7 +195,7 @@ private function calculatePolytechnio(): void $this->addHoliday(new Holiday( 'polytechnio', ['el' => 'Πολυτεχνείο'], - new DateTime("$this->year-11-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); diff --git a/src/Yasumi/Provider/Hungary.php b/src/Yasumi/Provider/Hungary.php index a5f7c7bf5..c29e7deea 100644 --- a/src/Yasumi/Provider/Hungary.php +++ b/src/Yasumi/Provider/Hungary.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -38,7 +36,6 @@ class Hungary extends AbstractProvider /** * Initialize holidays for Hungary. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -70,7 +67,7 @@ public function initialize(): void $this->addHoliday(new Holiday('memorialDay1848', [ 'en' => 'Memorial day of the 1848 Revolution', 'hu' => 'Az 1848-as forradalom ünnepe', - ], new DateTime("$this->year-3-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-3-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /* @@ -80,7 +77,7 @@ public function initialize(): void $this->addHoliday(new Holiday('stateFoundation', [ 'en' => 'State Foundation Day', 'hu' => 'Az államalapítás ünnepe', - ], new DateTime("$this->year-8-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-8-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /* @@ -90,7 +87,7 @@ public function initialize(): void $this->addHoliday(new Holiday('memorialDay1956', [ 'en' => 'Memorial day of the 1956 Revolution', 'hu' => 'Az 1956-os forradalom ünnepe', - ], new DateTime("$this->year-10-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-10-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Ireland.php b/src/Yasumi/Provider/Ireland.php index 6a6f0e756..76ebe65dd 100644 --- a/src/Yasumi/Provider/Ireland.php +++ b/src/Yasumi/Provider/Ireland.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -43,7 +41,6 @@ class Ireland extends AbstractProvider /** * Initialize holidays for Ireland. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -71,7 +68,7 @@ public function initialize(): void $this->addHoliday(new Holiday( 'augustHoliday', ['en' => 'August Holiday', 'ga' => 'Lá Saoire i mí Lúnasa'], - new DateTime("next monday $this->year-7-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("next monday $this->year-7-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); $this->calculateOctoberHoliday(); @@ -98,7 +95,6 @@ public function getSources(): array * states that New Years Day is substituted the *next* day if it does not fall on a weekday. So what if it * falls on a Saturday? * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -134,7 +130,6 @@ private function calculateNewYearsDay(): void * @see http://www.irishstatutebook.ie/eli/1939/act/1/section/8/enacted/en/html * @see http://www.irishstatutebook.ie/eli/1973/act/25/schedule/1/enacted/en/html#sched1 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -156,18 +151,16 @@ private function calculatePentecostMonday(): void * * @see http://www.irishstatutebook.ie/eli/1973/act/25/schedule/1/enacted/en/html#sched1 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateChristmasDay(): void { $holiday = new Holiday( 'christmasDay', ['en' => '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 ); @@ -196,18 +189,16 @@ private function calculateChristmasDay(): void * @see https://en.wikipedia.org/wiki/St._Stephen%27s_Day * @see ChristianHolidays * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private 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 ); @@ -238,11 +229,9 @@ private function calculateStStephensDay(): void * * @see https://en.wikipedia.org/wiki/Saint_Patrick%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateStPatricksDay(): void { @@ -252,7 +241,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => 'St. Patrick’s Day', 'ga' => 'Lá Fhéile Pádraig'], - new DateTime($this->year.'-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year.'-3-17', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); @@ -283,11 +272,9 @@ private function calculateStPatricksDay(): void * * @see https://en.wikipedia.org/wiki/May_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateMayDay(): void { @@ -298,7 +285,7 @@ private function calculateMayDay(): void $this->addHoliday(new Holiday( 'mayDay', ['en' => 'May Day', 'ga' => 'Lá Bealtaine'], - new DateTime("next monday $this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("next monday $this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -311,11 +298,9 @@ private function calculateMayDay(): void * * @see http://www.irishstatutebook.ie/eli/1961/act/33/section/8/enacted/en/html * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateJuneHoliday(): void { @@ -326,7 +311,7 @@ private function calculateJuneHoliday(): void $this->addHoliday(new Holiday( 'juneHoliday', ['en' => 'June Holiday', 'ga' => 'Lá Saoire i mí an Mheithimh'], - new DateTime("next monday $this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("next monday $this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -338,11 +323,9 @@ private function calculateJuneHoliday(): void * * @see http://www.irishstatutebook.ie/eli/1973/act/25/schedule/1/enacted/en/html#sched1 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateOctoberHoliday(): void { @@ -353,7 +336,7 @@ private function calculateOctoberHoliday(): void $this->addHoliday(new Holiday( 'octoberHoliday', ['en' => 'October Holiday', 'ga' => 'Lá Saoire i mí Dheireadh Fómhair'], - new DateTime("previous monday $this->year-11-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("previous monday $this->year-11-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Italy.php b/src/Yasumi/Provider/Italy.php old mode 100755 new mode 100644 index 1308f959e..348ba1bee --- a/src/Yasumi/Provider/Italy.php +++ b/src/Yasumi/Provider/Italy.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Italy extends AbstractProvider /** * Initialize holidays for Italy. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -83,11 +80,9 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Liberation_Day_%28Italy%29 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateLiberationDay(): void { @@ -95,7 +90,7 @@ private function calculateLiberationDay(): void $this->addHoliday(new Holiday( 'liberationDay', ['it' => 'Festa della Liberazione'], - new DateTime("$this->year-4-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-4-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -111,11 +106,9 @@ private function calculateLiberationDay(): void * * @see https://en.wikipedia.org/wiki/Festa_della_Repubblica * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateRepublicDay(): void { @@ -123,7 +116,7 @@ private function calculateRepublicDay(): void $this->addHoliday(new Holiday( 'republicDay', ['it' => 'Festa della Repubblica'], - new DateTime("$this->year-6-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Japan.php b/src/Yasumi/Provider/Japan.php old mode 100755 new mode 100644 index 26cbc702d..814f9dc75 --- a/src/Yasumi/Provider/Japan.php +++ b/src/Yasumi/Provider/Japan.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use DateTimeInterface; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -74,7 +70,6 @@ class Japan extends AbstractProvider /** * Initialize holidays for Japan. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -132,7 +127,7 @@ private function calculateNationalFoundationDay(): void 'en' => 'National Foundation Day', 'ja' => '建国記念の日', ], - new DateTime("$this->year-2-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-2-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -152,7 +147,7 @@ private function calculateShowaDay(): void 'en' => 'Showa Day', 'ja' => '昭和の日', ], - new DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -172,7 +167,7 @@ private function calculateConstitutionMemorialDay(): void 'en' => 'Constitution Memorial Day', 'ja' => '憲法記念日', ], - new DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -192,7 +187,7 @@ private function calculateChildrensDay(): void 'en' => 'Children’s Day', 'ja' => 'こどもの日', ], - new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -209,7 +204,7 @@ private function calculateCultureDay(): void $this->addHoliday(new Holiday( 'cultureDay', ['en' => 'Culture Day', 'ja' => '文化の日'], - new DateTime("$this->year-11-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -226,7 +221,7 @@ private function calculateLaborThanksgivingDay(): void $this->addHoliday(new Holiday( 'laborThanksgivingDay', ['en' => 'Labor Thanksgiving Day', 'ja' => '勤労感謝の日'], - new DateTime("$this->year-11-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-11-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -247,7 +242,7 @@ private function calculateEmperorsBirthday(): void $emperorsBirthday = "$this->year-2-23"; } elseif ($this->year >= 1989 && $this->year < 2019) { $emperorsBirthday = "$this->year-12-23"; - } elseif ($this->year >= 1949 && $this->year < 1988) { + } elseif ($this->year >= 1949 && $this->year <= 1988) { $emperorsBirthday = "$this->year-4-29"; } @@ -255,7 +250,7 @@ private function calculateEmperorsBirthday(): void $this->addHoliday(new Holiday( 'emperorsBirthday', ['en' => 'Emperors Birthday', 'ja' => '天皇誕生日'], - new DateTime($emperorsBirthday, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($emperorsBirthday, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -270,7 +265,6 @@ private function calculateEmperorsBirthday(): void * * @see http://www.h3.dion.ne.jp/~sakatsu/holiday_topic.htm (in Japanese) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -294,7 +288,7 @@ private function calculateVernalEquinoxDay(): void $this->addHoliday(new Holiday( 'vernalEquinoxDay', ['en' => 'Vernal Equinox Day', 'ja' => '春分の日'], - new DateTime("$this->year-3-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-3-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -306,22 +300,20 @@ private function calculateVernalEquinoxDay(): void * Coming of Age Day was established after 1948 on January 15th. After 2000 it was changed to be the second monday * of January. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateComingOfAgeDay(): void { $date = null; if ($this->year >= 2000) { - $date = new DateTime("second monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("second monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1948) { - $date = new DateTime("$this->year-1-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-1-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } - if ($date instanceof DateTimeInterface) { + if ($date instanceof \DateTimeInterface) { $this->addHoliday(new Holiday( 'comingOfAgeDay', ['en' => 'Coming of Age Day', 'ja' => '成人の日'], @@ -336,22 +328,20 @@ private function calculateComingOfAgeDay(): void * * Greenery Day was established from 1989 on April 29th. After 2007 it was changed to be May 4th. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateGreeneryDay(): void { $date = null; if ($this->year >= 2007) { - $date = new DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1989) { - $date = new DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-4-29", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } - if ($date instanceof DateTimeInterface) { + if ($date instanceof \DateTimeInterface) { $this->addHoliday(new Holiday( 'greeneryDay', ['en' => 'Greenery Day', 'ja' => 'みどりの日'], @@ -367,33 +357,38 @@ private function calculateGreeneryDay(): void * Marine Day was established since 1996 on July 20th. After 2003 it was changed to be the third monday of July.In * 2020 is July 23th. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception - * @throws \Exception */ private function calculateMarineDay(): void { - $date = null; - if (2021 === $this->year) { - // For Olympic 2021 Tokyo (rescheduled due to the COVID-19 pandemic) - $date = new DateTime("$this->year-7-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - } elseif ($this->year >= 2003) { - $date = new DateTime("third monday of july $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-7-20", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + if (1996 > $this->year) { + return; } - if ($date instanceof DateTimeInterface) { - $this->addHoliday(new Holiday( - 'marineDay', - ['en' => 'Marine Day', 'ja' => '海の日'], - $date, - $this->locale - )); + $date = "$this->year-7-20"; + + if ($this->year >= 2003) { + $date = "third monday of july $this->year"; } + + if (2020 === $this->year) { + // For the 2020 Tokyo Olympics, Marine Day was rescheduled. + $date = "$this->year-7-23"; + } + + if (2021 === $this->year) { + // Due to the COVID-19 pandemic, the 2020 Tokyo Olympics were rescheduled and hence Marine Day as well. + $date = "$this->year-7-22"; + } + + $this->addHoliday(new Holiday( + 'marineDay', + ['en' => 'Marine Day', 'ja' => '海の日'], + new \DateTime($date, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); } /** @@ -404,22 +399,21 @@ private function calculateMarineDay(): void * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateMountainDay(): void { $date = null; if (2021 === $this->year) { // For Olympic 2021 Tokyo (after COVID-19) - $date = new DateTime("$this->year-8-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-8-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif (2020 === $this->year) { // For Olympic 2020 Tokyo - $date = new DateTime("$this->year-8-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-8-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2016) { - $date = new DateTime("$this->year-8-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-8-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } - if ($date instanceof DateTimeInterface) { + if ($date instanceof \DateTimeInterface) { $this->addHoliday(new Holiday( 'mountainDay', ['en' => 'Mountain Day', 'ja' => '山の日'], @@ -435,22 +429,20 @@ private function calculateMountainDay(): void * Respect for the Age Day was established since 1996 on September 15th. After 2003 it was changed to be the third * monday of September. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateRespectForTheAgeDay(): void { $date = null; if ($this->year >= 2003) { - $date = new DateTime("third monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("third monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-9-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-9-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } - if ($date instanceof DateTimeInterface) { + if ($date instanceof \DateTimeInterface) { $this->addHoliday(new Holiday( 'respectfortheAgedDay', ['en' => 'Respect for the Aged Day', 'ja' => '敬老の日'], @@ -466,26 +458,23 @@ private function calculateRespectForTheAgeDay(): void * Health And Sports Day was established since 1966 on October 10th. After 2000 it was changed to be the second * monday of October.In 2020 is July 24th. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception - * @throws \Exception */ private function calculateSportsDay(): void { $date = null; if (2021 === $this->year) { // For Olympic 2021 Tokyo (after COVID-19) - $date = new DateTime("$this->year-7-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-7-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif (2020 === $this->year) { // For Olympic 2020 Tokyo - $date = new DateTime("$this->year-7-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-7-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 2000) { - $date = new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } elseif ($this->year >= 1996) { - $date = new DateTime("$this->year-10-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-10-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $holidayName = ['en' => 'Health And Sports Day', 'ja' => '体育の日']; @@ -493,7 +482,7 @@ private function calculateSportsDay(): void $holidayName = ['en' => 'Sports Day', 'ja' => 'スポーツの日']; } - if ($date instanceof DateTimeInterface) { + if ($date instanceof \DateTimeInterface) { $this->addHoliday(new Holiday( 'sportsDay', $holidayName, @@ -512,7 +501,6 @@ private function calculateSportsDay(): void * * @see http://www.h3.dion.ne.jp/~sakatsu/holiday_topic.htm (in Japanese) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -536,7 +524,7 @@ private function calculateAutumnalEquinoxDay(): void $this->addHoliday(new Holiday( 'autumnalEquinoxDay', ['en' => 'Autumnal Equinox Day', 'ja' => '秋分の日'], - new DateTime("$this->year-9-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-9-$day", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -548,7 +536,6 @@ private function calculateAutumnalEquinoxDay(): void * Generally if a national holiday falls on a Sunday, the holiday is observed the next working day (not being * another holiday). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -560,6 +547,9 @@ private function calculateSubstituteHolidays(): void // Loop through all holidays foreach ($this->getHolidays() as $holiday) { + if (!$holiday instanceof Holiday) { + continue; + } $date = clone $holiday; // If holidays falls on a Sunday @@ -567,10 +557,10 @@ private function calculateSubstituteHolidays(): void if ($this->year >= 2007) { // Find next week day (not being another holiday) while (\in_array($date, $dates, false)) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } } elseif ($holiday >= '1973-04-12') { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); if (\in_array($date, $dates, false)) { continue; // @codeCoverageIgnore } @@ -603,7 +593,7 @@ private function calculateCoronationDay(): void $this->addHoliday(new Holiday( 'coronationDay', ['en' => 'Coronation Day', 'ja' => '即位の日'], - new DateTime("$this->year-5-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -621,7 +611,7 @@ private function calculateEnthronementProclamationCeremony(): void $this->addHoliday(new Holiday( 'enthronementProclamationCeremony', ['en' => 'Enthronement Proclamation Ceremony', 'ja' => '即位礼正殿の儀'], - new DateTime("$this->year-10-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -632,7 +622,6 @@ private function calculateEnthronementProclamationCeremony(): void * * Any day that falls between two other national holidays also becomes a holiday, known as a bridge holiday. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -655,8 +644,12 @@ private function calculateBridgeHolidays(): void // Determine if gap between holidays is one day and create bridge holiday if (2 === (int) $previous->diff($datesIterator->current())->format('%a')) { + if (!$previous instanceof Holiday) { + throw new \RuntimeException('unable to determine the difference between dates'); + } + $bridgeDate = clone $previous; - $bridgeDate->add(new DateInterval('P1D')); + $bridgeDate->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday('bridgeDay'.$counter, [ 'en' => 'Bridge Public holiday', diff --git a/src/Yasumi/Provider/Latvia.php b/src/Yasumi/Provider/Latvia.php index 1a64df69b..5217aae88 100644 --- a/src/Yasumi/Provider/Latvia.php +++ b/src/Yasumi/Provider/Latvia.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Provider/Lithuania.php b/src/Yasumi/Provider/Lithuania.php index 447cc8f2b..7c3d05882 100644 --- a/src/Yasumi/Provider/Lithuania.php +++ b/src/Yasumi/Provider/Lithuania.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Provider/Luxembourg.php b/src/Yasumi/Provider/Luxembourg.php old mode 100755 new mode 100644 index 0783eb388..59d6294e4 --- a/src/Yasumi/Provider/Luxembourg.php +++ b/src/Yasumi/Provider/Luxembourg.php @@ -2,7 +2,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -38,7 +36,6 @@ class Luxembourg extends AbstractProvider /** * Initialize holidays for Luxembourg. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -80,7 +77,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Europe_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -91,7 +87,7 @@ private function calculateEuropeDay(): void $this->addHoliday(new Holiday('europeDay', [ 'en_US' => 'Europe day', 'fr' => 'La Journée de l’Europe', - ], new DateTime("$this->year-5-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-5-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -106,7 +102,6 @@ private function calculateEuropeDay(): void * * @see https://en.wikipedia.org/wiki/Grand_Duke%27s_Official_Birthday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -116,6 +111,6 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday('nationalDay', [ 'en_US' => 'National day', 'fr' => 'La Fête nationale', - ], new DateTime("$this->year-6-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-6-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Netherlands.php b/src/Yasumi/Provider/Netherlands.php old mode 100755 new mode 100644 index 0c81a78a7..df44b39b2 --- a/src/Yasumi/Provider/Netherlands.php +++ b/src/Yasumi/Provider/Netherlands.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class Netherlands extends AbstractProvider /** * Initialize holidays for the Netherlands. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -113,7 +109,7 @@ private function calculateCarnival(): void $this->addHoliday(new Holiday( 'carnivalDay', ['en' => 'Carnival', 'nl' => 'Carnaval'], - $carnivalDay1->sub(new DateInterval('P49D')), + $carnivalDay1->sub(new \DateInterval('P49D')), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -125,7 +121,7 @@ private function calculateCarnival(): void $this->addHoliday(new Holiday( 'secondCarnivalDay', ['en' => 'Carnival', 'nl' => 'Carnaval'], - $carnivalDay2->sub(new DateInterval('P48D')), + $carnivalDay2->sub(new \DateInterval('P48D')), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -137,7 +133,7 @@ private function calculateCarnival(): void $this->addHoliday(new Holiday( 'thirdCarnivalDay', ['en' => 'Carnival', 'nl' => 'Carnaval'], - $carnivalDay3->sub(new DateInterval('P47D')), + $carnivalDay3->sub(new \DateInterval('P47D')), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -197,7 +193,7 @@ private function calculateStNicholasDay(): void $this->addHoliday(new Holiday( 'stNicholasDay', ['en' => 'St. Nicholas’ Day', 'nl' => 'Sinterklaas'], - new DateTime("$this->year-12-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-12-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -220,7 +216,7 @@ private function calculateHalloween(): void $this->addHoliday(new Holiday( 'halloween', ['en' => 'Halloween', 'nl' => 'Halloween'], - new DateTime("$this->year-10-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -239,7 +235,7 @@ private function calculatePrincesDay(): void $this->addHoliday(new Holiday( 'princesDay', ['en' => 'Prince’s Day', 'nl' => 'Prinsjesdag'], - new DateTime("third tuesday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("third tuesday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OTHER )); @@ -257,14 +253,14 @@ private function calculatePrincesDay(): void private function calculateQueensday(): void { if ($this->year >= 1891 && $this->year <= 2013) { - $date = new DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year <= 1948) { - $date = new DateTime("$this->year-8-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-8-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } // Determine substitution day if (0 === (int) $date->format('w')) { - $this->year < 1980 ? $date->add(new DateInterval('P1D')) : $date->sub(new DateInterval('P1D')); + $this->year < 1980 ? $date->add(new \DateInterval('P1D')) : $date->sub(new \DateInterval('P1D')); } $this->addHoliday(new Holiday( @@ -287,10 +283,10 @@ private function calculateQueensday(): void private function calculateKingsday(): void { if ($this->year >= 2014) { - $date = new DateTime("$this->year-4-27", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-4-27", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if (0 === (int) $date->format('w')) { - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); } $this->addHoliday(new Holiday( @@ -315,16 +311,18 @@ private function calculateCommemorationLiberationDay(): void $this->addHoliday(new Holiday( 'commemorationDay', ['en' => 'Commemoration Day', 'nl' => 'dodenherdenking'], - new DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); + // Liberation day is only an official holiday every 5 years + $holidayType = (0 === $this->year % 5) ? Holiday::TYPE_OFFICIAL : Holiday::TYPE_OBSERVANCE; $this->addHoliday(new Holiday( 'liberationDay', ['en' => 'Liberation Day', 'nl' => 'Bevrijdingsdag'], - new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, - Holiday::TYPE_OFFICIAL + $holidayType )); } } diff --git a/src/Yasumi/Provider/NewZealand.php b/src/Yasumi/Provider/NewZealand.php index c8be986c8..00c8c01a8 100644 --- a/src/Yasumi/Provider/NewZealand.php +++ b/src/Yasumi/Provider/NewZealand.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class NewZealand extends AbstractProvider /** * Initialize holidays for New Zealand. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -77,27 +73,26 @@ public function getSources(): array * @see https://www.timeanddate.com/holidays/new-zealand/day-after-new-years-day * @see https://www.employment.govt.nz/leave-and-holidays/public-holidays/public-holidays-falling-on-a-weekend/ * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception */ private function calculateNewYearHolidays(): void { - $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $dayAfterNewYearsDay = new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $newYearsDay = new \DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $dayAfterNewYearsDay = new \DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)); switch ($newYearsDay->format('w')) { case 0: - $newYearsDay->add(new DateInterval('P1D')); - $dayAfterNewYearsDay->add(new DateInterval('P1D')); + $newYearsDay->add(new \DateInterval('P1D')); + $dayAfterNewYearsDay->add(new \DateInterval('P1D')); break; case 5: - $dayAfterNewYearsDay->add(new DateInterval('P2D')); + $dayAfterNewYearsDay->add(new \DateInterval('P2D')); break; case 6: - $newYearsDay->add(new DateInterval('P2D')); - $dayAfterNewYearsDay->add(new DateInterval('P2D')); + $newYearsDay->add(new \DateInterval('P2D')); + $dayAfterNewYearsDay->add(new \DateInterval('P2D')); break; } @@ -117,7 +112,6 @@ private function calculateNewYearHolidays(): void * @see https://en.wikipedia.org/wiki/Waitangi_Day * @see https://www.employment.govt.nz/leave-and-holidays/public-holidays/public-holidays-falling-on-a-weekend/ * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -128,7 +122,7 @@ private function calculateWaitangiDay(): void return; } - $date = new DateTime("$this->year-02-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-02-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 2015 && !$this->isWorkingDay($date)) { $date->modify('next monday'); @@ -147,7 +141,6 @@ private function calculateWaitangiDay(): void * @see https://en.wikipedia.org/wiki/Anzac_Day * @see https://www.employment.govt.nz/leave-and-holidays/public-holidays/public-holidays-falling-on-a-weekend/ * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -158,7 +151,7 @@ private function calculateAnzacDay(): void return; } - $date = new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 2015 && !$this->isWorkingDay($date)) { $date->modify('next monday'); @@ -180,7 +173,6 @@ private function calculateAnzacDay(): void * * @see https://www.timeanddate.com/holidays/new-zealand/queen-birthday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -194,7 +186,7 @@ private function calculateQueensBirthday(): void $this->addHoliday(new Holiday( 'queensBirthday', [], - 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 )); } @@ -213,7 +205,6 @@ private function calculateQueensBirthday(): void * * @see https://www.timeanddate.com/holidays/new-zealand/labour-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -224,7 +215,7 @@ private function calculateLabourDay(): void return; } - $date = new DateTime( + $date = new \DateTime( ($this->year < 1910 ? 'second wednesday of october' : 'fourth monday of october')." $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone) ); @@ -242,26 +233,25 @@ private function calculateLabourDay(): void * @see https://www.timeanddate.com/holidays/new-zealand/christmas-day * @see https://www.employment.govt.nz/leave-and-holidays/public-holidays/public-holidays-falling-on-a-weekend/ * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception */ private function calculateChristmasHolidays(): void { - $christmasDay = new DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); - $boxingDay = new DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $christmasDay = new \DateTime("$this->year-12-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $boxingDay = new \DateTime("$this->year-12-26", DateTimeZoneFactory::getDateTimeZone($this->timezone)); switch ($christmasDay->format('w')) { case 0: - $christmasDay->add(new DateInterval('P2D')); + $christmasDay->add(new \DateInterval('P2D')); break; case 5: - $boxingDay->add(new DateInterval('P2D')); + $boxingDay->add(new \DateInterval('P2D')); break; case 6: - $christmasDay->add(new DateInterval('P2D')); - $boxingDay->add(new DateInterval('P2D')); + $christmasDay->add(new \DateInterval('P2D')); + $boxingDay->add(new \DateInterval('P2D')); break; } diff --git a/src/Yasumi/Provider/Norway.php b/src/Yasumi/Provider/Norway.php index f9c9a1bca..733ec26af 100644 --- a/src/Yasumi/Provider/Norway.php +++ b/src/Yasumi/Provider/Norway.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Norway extends AbstractProvider /** * Initialize holidays for Norway. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -85,7 +82,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Norwegian_Constitution_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -96,7 +92,7 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday( 'constitutionDay', ['nb' => 'grunnlovsdagen'], - new DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Poland.php b/src/Yasumi/Provider/Poland.php old mode 100755 new mode 100644 index b0fbdfa9e..e2f0817a2 --- a/src/Yasumi/Provider/Poland.php +++ b/src/Yasumi/Provider/Poland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Poland extends AbstractProvider /** * Initialize holidays for Poland. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -83,7 +80,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/May_3rd_Constitution_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -97,7 +93,7 @@ private function calculateIndependenceDay(): void $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', 'pl' => 'Narodowe Święto Niepodległości', - ], new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } /** @@ -110,7 +106,6 @@ private function calculateIndependenceDay(): void * * @see https://en.wikipedia.org/wiki/National_Independence_Day_(Poland) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -124,6 +119,6 @@ private function calculateConstitutionDay(): void $this->addHoliday(new Holiday('constitutionDay', [ 'en' => 'Constitution Day', 'pl' => 'Święto Narodowe Trzeciego Maja', - ], new DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-5-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } diff --git a/src/Yasumi/Provider/Portugal.php b/src/Yasumi/Provider/Portugal.php index 41e508e29..7ef24e88c 100644 --- a/src/Yasumi/Provider/Portugal.php +++ b/src/Yasumi/Provider/Portugal.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Portugal extends AbstractProvider /** * Initialize holidays for Portugal. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -84,7 +81,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Carnation_Revolution * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -95,7 +91,7 @@ private function calculateCarnationRevolutionDay(): void $this->addHoliday(new Holiday( '25thApril', ['pt' => 'Dia da Liberdade'], - new DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-04-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -106,7 +102,6 @@ private function calculateCarnationRevolutionDay(): void * In Portugal, between 2013 andd 2015 (inclusive) this holiday did not happen due to government deliberation. * It was restored in 2016. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -131,7 +126,6 @@ private function calculateCorpusChristi(): void * * @see https://en.wikipedia.org/wiki/Portugal_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -142,7 +136,7 @@ private function calculatePortugalDay(): void $this->addHoliday(new Holiday( 'portugalDay', ['pt' => 'Dia de Portugal'], - new DateTime("$this->year-06-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-06-10", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -165,7 +159,6 @@ private function calculatePortugalDay(): void * * @see https://en.wikipedia.org/wiki/5_October_1910_revolution * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -176,7 +169,7 @@ private function calculatePortugueseRepublicDay(): void $this->addHoliday(new Holiday( 'portugueseRepublic', ['pt' => 'Implantação da República Portuguesa'], - new DateTime("$this->year-10-05", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-05", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -186,7 +179,6 @@ private function calculatePortugueseRepublicDay(): void * In Portugal, between 2013 and 2015 (inclusive) this holiday did not happen due to government deliberation. * It was restored in 2016. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -220,7 +212,6 @@ private function calculateAllSaintsDay(): void * @see https://pt.wikipedia.org/wiki/Restauração_da_Independência (portuguese link) * @see https://pt.wikipedia.org/wiki/Guerra_da_Restauração (english link) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -232,7 +223,7 @@ private function calculateRestorationOfIndependenceDay(): void $this->addHoliday(new Holiday( 'restorationOfIndependence', ['pt' => 'Restauração da Independência'], - new DateTime("$this->year-12-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-12-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); diff --git a/src/Yasumi/Provider/Romania.php b/src/Yasumi/Provider/Romania.php old mode 100755 new mode 100644 index 6efb5fa0c..9b0a71d69 --- a/src/Yasumi/Provider/Romania.php +++ b/src/Yasumi/Provider/Romania.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -41,7 +39,6 @@ class Romania extends AbstractProvider /** * Initialize holidays for Romania. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -68,10 +65,10 @@ public function initialize(): void } // Add other holidays - $this->calculateDayAfterNewYearsDay(); //2nd of January - $this->calculateUnitedPrincipalitiesDay(); //since 21.12.2014 (Law 171/2014), celebrated on 24th of January - $this->calculateStAndrewDay(); //since 24.07.2012 (Law 147/2012), celebrated on 30th of November - $this->calculateNationalDay(); //after 1990, celebrated on December 1st + $this->calculateDayAfterNewYearsDay(); // 2nd of January + $this->calculateUnitedPrincipalitiesDay(); // since 21.12.2014 (Law 171/2014), celebrated on 24th of January + $this->calculateStAndrewDay(); // since 24.07.2012 (Law 147/2012), celebrated on 30th of November + $this->calculateNationalDay(); // after 1990, celebrated on December 1st $this->calculateConstantinBrancusiDay(); $this->calculateChildrensDay(); // Since 18.11.2016 (Law 220/2016), Celebrated on 1st of June } @@ -85,9 +82,9 @@ public function getSources(): array } /** - * @throws \Exception - * * @return \DateTime|\DateTimeImmutable + * + * @throws \Exception */ protected function calculateEaster(int $year, string $timezone): \DateTimeInterface { @@ -101,7 +98,6 @@ protected function calculateEaster(int $year, string $timezone): \DateTimeInterf * * @see https://en.wikipedia.org/wiki/Public_holidays_in_Romania * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -111,7 +107,7 @@ private function calculateDayAfterNewYearsDay(): void $this->addHoliday(new Holiday( 'dayAfterNewYearsDay', [], - new DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-01-02", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -125,7 +121,6 @@ private function calculateDayAfterNewYearsDay(): void * * @see https://en.wikipedia.org/wiki/United_Principalities * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -137,7 +132,7 @@ private function calculateUnitedPrincipalitiesDay(): void $this->addHoliday(new Holiday('unitedPrincipalitiesDay', [ 'en' => 'Union Day / Small Union', 'ro' => 'Unirea Principatelor Române / Mica Unire', - ], new DateTime("$this->year-01-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-01-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -148,7 +143,6 @@ private function calculateUnitedPrincipalitiesDay(): void * * @see https://en.wikipedia.org/wiki/St._Andrew%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -159,7 +153,7 @@ private function calculateStAndrewDay(): void $this->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 )); } @@ -176,7 +170,6 @@ private function calculateStAndrewDay(): void * @see https://en.wikipedia.org/wiki/Great_Union_Day * @see https://ro.wikipedia.org/wiki/Ziua_na%C8%9Bional%C4%83_a_Rom%C3%A2niei * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -185,7 +178,7 @@ private function calculateNationalDay(): void { $nationalDay = null; - //@link https://en.wikipedia.org/wiki/Great_Union_Day + // @link https://en.wikipedia.org/wiki/Great_Union_Day if ($this->year >= 1990) { $nationalDay = "$this->year-12-01"; } @@ -202,7 +195,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday('nationalDay', [ 'en' => 'National Day', 'ro' => 'Ziua Națională', - ], new DateTime($nationalDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime($nationalDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -213,7 +206,6 @@ private function calculateNationalDay(): void * * @see https://en.wikipedia.org/wiki/Constantin_Br%C3%A2ncu%C8%99i * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -227,7 +219,7 @@ private function calculateConstantinBrancusiDay(): void 'en' => 'Constantin Brâncuși day', 'ro' => 'Ziua Constantin Brâncuși', ], - new DateTime("$this->year-02-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-02-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -242,11 +234,9 @@ private function calculateConstantinBrancusiDay(): void * * @see https://en.wikipedia.org/wiki/Children%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateChildrensDay(): void { @@ -257,7 +247,7 @@ private function calculateChildrensDay(): void 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', ], - new DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -267,7 +257,7 @@ private function calculateChildrensDay(): void $this->addHoliday(new Holiday('childrensDay', [ 'en' => 'International Children’s Day', 'ro' => 'Ziua Copilului', - ], new DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-06-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Russia.php b/src/Yasumi/Provider/Russia.php index 662e92fed..c2d11ac30 100644 --- a/src/Yasumi/Provider/Russia.php +++ b/src/Yasumi/Provider/Russia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Provider/Slovakia.php b/src/Yasumi/Provider/Slovakia.php index 2c5bc2f0e..97b241c63 100644 --- a/src/Yasumi/Provider/Slovakia.php +++ b/src/Yasumi/Provider/Slovakia.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -61,7 +59,6 @@ class Slovakia extends AbstractProvider /** * Initialize holidays for Slovakia. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -120,7 +117,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Public_holidays_in_Slovakia * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -133,7 +129,7 @@ private function calculateSlovakIndependenceDay(): void 'sk' => 'Deň vzniku Slovenskej republiky', 'en' => 'Day of the Establishment of the Slovak Republic', ], - new DateTime($this->year.'-01-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year.'-01-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -145,7 +141,6 @@ private function calculateSlovakIndependenceDay(): void * * Note: this holiday is common for Czech republic and Slovakia. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -159,7 +154,7 @@ private function calculateSaintsCyrilAndMethodiusDay(): void 'cs' => 'Den slovanských věrozvěstů Cyrila a Metoděje', 'en' => 'Saints Cyril and Methodius Day', ], - new DateTime($this->year.'-07-05', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year.'-07-05', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -170,7 +165,6 @@ private function calculateSaintsCyrilAndMethodiusDay(): void * * @see https://en.wikipedia.org/wiki/Slovak_National_Uprising * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -183,7 +177,7 @@ private function calculateSlovakNationalUprisingDay(): void 'sk' => 'Výročie Slovenského národného povstania', 'en' => 'Slovak National Uprising Day', ], - new DateTime($this->year.'-08-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year.'-08-29', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -194,7 +188,6 @@ private function calculateSlovakNationalUprisingDay(): void * * @see https://en.wikipedia.org/wiki/Constitution_of_Slovakia * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -207,7 +200,7 @@ private function calculateSlovakConstitutionDay(): void 'sk' => 'Deň Ústavy Slovenskej republiky', 'en' => 'Day of the Constitution of the Slovak Republic', ], - new DateTime($this->year.'-09-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($this->year.'-09-01', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OFFICIAL )); @@ -222,7 +215,6 @@ private function calculateSlovakConstitutionDay(): void * @see https://en.wikipedia.org/wiki/Our_Lady_of_Sorrows * @see https://sk.wikipedia.org/wiki/Sedembolestn%C3%A1_Panna_M%C3%A1ria * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -232,7 +224,7 @@ private function calculateOurLadyOfSorrowsDay(): void $this->addHoliday(new Holiday('ourLadyOfSorrowsDay', [ 'sk' => 'Sviatok Sedembolestnej Panny Márie', 'en' => 'Our Lady of Sorrows Day', - ], new DateTime($this->year.'-09-15', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); + ], new \DateTime($this->year.'-09-15', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK)); } /** @@ -240,7 +232,6 @@ private function calculateOurLadyOfSorrowsDay(): void * * Note: this national day is common for Czech republic and Slovakia. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -254,7 +245,7 @@ private function calculateStruggleForFreedomAndDemocracyDay(): void 'cs' => 'Den boje za svobodu a demokracii', 'en' => 'Struggle for Freedom and Democracy Day', ], - new DateTime($this->year.'-11-17', 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 d22b8ed48..0be859819 100644 --- a/src/Yasumi/Provider/SouthAfrica.php +++ b/src/Yasumi/Provider/SouthAfrica.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -43,7 +40,6 @@ class SouthAfrica extends AbstractProvider /** * Initialize holidays for South Africa. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -101,7 +97,6 @@ public function getSources(): array * * @see https://www.gov.za/about-sa/public-holidays#21march * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -111,7 +106,7 @@ private function calculateHumanRightsDay(): void $this->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 )); } @@ -123,7 +118,6 @@ private function calculateHumanRightsDay(): void * * @see https://www.gov.za/documents/public-holidays-act * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -133,7 +127,7 @@ private function calculateFamilyDay(): void $this->addHoliday(new Holiday( 'familyDay', ['en' => 'Family Day'], - $this->calculateEaster($this->year, $this->timezone)->add(new DateInterval('P1D')), + $this->calculateEaster($this->year, $this->timezone)->add(new \DateInterval('P1D')), $this->locale )); } @@ -146,7 +140,6 @@ private function calculateFamilyDay(): void * @see https://www.gov.za/documents/public-holidays-act * @see https://www.gov.za/freedom-day-2014 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -156,7 +149,7 @@ private 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 )); } @@ -173,7 +166,6 @@ private function calculateFreedomDay(): void * @see https://www.gov.za/documents/public-holidays-act * @see https://www.gov.za/youth-day-2014 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -183,7 +175,7 @@ private 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 )); } @@ -196,7 +188,6 @@ private function calculateYouthDay(): void * * @see https://www.gov.za/speeches/president-jacob-zuma-declares-3-august-2016-public-holiday-24-jun-2016-0000 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -210,7 +201,7 @@ private function calculate2016MunicipalElectionsDay(): void $this->addHoliday(new Holiday( '2016MunicipalElectionsDay', ['en' => '2016 Municipal Elections Day'], - new DateTime('2016-8-3', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('2016-8-3', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -225,7 +216,6 @@ private function calculate2016MunicipalElectionsDay(): void * @see https://www.gov.za/about-sa/public-holidays#women * @see https://www.gov.za/womens-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -235,7 +225,7 @@ private 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 )); } @@ -250,7 +240,6 @@ private function calculateNationalWomensDay(): void * @see https://www.gov.za/documents/public-holidays-act * @see https://www.gov.za/heritage-day-2014 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -260,7 +249,7 @@ private 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 )); } @@ -277,7 +266,6 @@ private function calculateHeritageDay(): void * @see https://www.gov.za/documents/public-holidays-act * @see https://www.gov.za/day-reconciliation-2014 * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -287,7 +275,7 @@ private 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 )); } @@ -303,7 +291,6 @@ private function calculateDayOfReconciliation(): void * * @see https://www.gov.za/documents/public-holidays-act * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -317,7 +304,7 @@ private function calculateSubstituteDayOfGoodwill(): void $this->addHoliday(new Holiday( 'substituteDayOfGoodwill', ['en' => 'Day of Goodwill observed'], - new DateTime('2016-12-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime('2016-12-27', DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -328,7 +315,6 @@ private function calculateSubstituteDayOfGoodwill(): void * The Public Holidays Act (Act No 36 of 1994) determines whenever any public holiday falls on a Sunday, the Monday * following on it shall be a public holiday. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -337,10 +323,14 @@ private function calculateSubstituteHolidays(): void { // Loop through all defined holidays foreach ($this->getHolidays() as $holiday) { + if (!$holiday instanceof Holiday) { + continue; + } + // Substitute holiday is on a Monday in case the holiday falls on a Sunday if (0 === (int) $holiday->format('w')) { $date = clone $holiday; - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->addHoliday(new SubstituteHoliday( $holiday, diff --git a/src/Yasumi/Provider/SouthKorea.php b/src/Yasumi/Provider/SouthKorea.php index 805d2e98e..8570ebcf2 100644 --- a/src/Yasumi/Provider/SouthKorea.php +++ b/src/Yasumi/Provider/SouthKorea.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -119,7 +116,6 @@ class SouthKorea extends AbstractProvider /** * Initialize holidays for South Korea. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -177,7 +173,7 @@ private function calculateNewYearsDay(): void $this->addHoliday(new Holiday( 'dayAfterNewYearsDay', [], - new DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -185,7 +181,7 @@ private function calculateNewYearsDay(): void $this->addHoliday(new Holiday( 'twoDaysLaterNewYearsDay', ['en' => 'Two Days Later New Year’s Day', 'ko' => '새해 연휴'], - new DateTime("$this->year-1-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-1-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -203,7 +199,7 @@ private function calculateNewYearsDay(): void private function calculateSeollal(): void { if ($this->year >= 1985 && isset(self::LUNAR_HOLIDAY['seollal'][$this->year])) { - $seollal = new DateTime(self::LUNAR_HOLIDAY['seollal'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $seollal = new \DateTime(self::LUNAR_HOLIDAY['seollal'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'seollal', ['en' => 'Seollal', 'ko' => '설날'], @@ -212,7 +208,7 @@ private function calculateSeollal(): void )); if ($this->year > 1989) { $dayBeforeSeollal = clone $seollal; - $dayBeforeSeollal->sub(new DateInterval('P1D')); + $dayBeforeSeollal->sub(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'dayBeforeSeollal', ['en' => 'Day before Seollal', 'ko' => '설날 연휴'], @@ -220,7 +216,7 @@ private function calculateSeollal(): void $this->locale )); $dayAfterSeollal = clone $seollal; - $dayAfterSeollal->add(new DateInterval('P1D')); + $dayAfterSeollal->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'dayAfterSeollal', ['en' => 'Day after Seollal', 'ko' => '설날 연휴'], @@ -240,14 +236,20 @@ private function calculateSeollal(): void */ private function calculateBuddhasBirthday(): void { - if ($this->year >= 1975 && isset(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year])) { - $this->addHoliday(new Holiday( - 'buddhasBirthday', - ['en' => 'Buddha’s Birthday', 'ko' => '부처님오신날'], - new DateTime(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale - )); + if ($this->year < 1975) { + return; } + + if (!isset(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year])) { + return; + } + + $this->addHoliday(new Holiday( + 'buddhasBirthday', + ['en' => 'Buddha’s Birthday', 'ko' => '부처님오신날'], + new \DateTime(self::LUNAR_HOLIDAY['buddhasBirthday'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); } /** @@ -267,7 +269,7 @@ private function calculateChuseok(): void $chuseok = new Holiday( 'chuseok', ['en' => 'Chuseok', 'ko' => '추석'], - new DateTime(self::LUNAR_HOLIDAY['chuseok'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime(self::LUNAR_HOLIDAY['chuseok'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale ); $this->addHoliday($chuseok); @@ -277,7 +279,7 @@ private function calculateChuseok(): void $this->addHoliday(new Holiday( 'dayAfterChuseok', ['en' => 'Day after Chuseok', 'ko' => '추석 연휴'], - (clone $chuseok)->add(new DateInterval('P1D')), + (clone $chuseok)->add(new \DateInterval('P1D')), $this->locale )); } @@ -287,7 +289,7 @@ private function calculateChuseok(): void $this->addHoliday(new Holiday( 'dayBeforeChuseok', ['en' => 'Day before Chuseok', 'ko' => '추석 연휴'], - (clone $chuseok)->sub(new DateInterval('P1D')), + (clone $chuseok)->sub(new \DateInterval('P1D')), $this->locale )); } @@ -307,7 +309,7 @@ private function calculateIndependenceMovementDay(): void $this->addHoliday(new Holiday( 'independenceMovementDay', ['en' => 'Independence Movement Day', 'ko' => '삼일절'], - new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -326,7 +328,7 @@ private function calculateArborDay(): void $this->addHoliday(new Holiday( 'arborDay', ['en' => 'Arbor Day', 'ko' => '식목일'], - new DateTime("$this->year-4-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-4-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -345,7 +347,7 @@ private function calculateChildrensDay(): void $this->addHoliday(new Holiday( 'childrensDay', ['en' => 'Children’s Day', 'ko' => '어린이날'], - new DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -364,7 +366,7 @@ private function calculateMemorialDay(): void $this->addHoliday(new Holiday( 'memorialDay', ['en' => 'Memorial Day', 'ko' => '현충일'], - new DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -382,14 +384,20 @@ private function calculateMemorialDay(): void */ private function calculateConstitutionDay(): void { - if ($this->year >= 1949 && $this->year < 2008) { - $this->addHoliday(new Holiday( - 'constitutionDay', - ['en' => 'Constitution Day', 'ko' => '제헌절'], - new DateTime("$this->year-7-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale - )); + if ($this->year < 1949) { + return; + } + + if ($this->year >= 2008) { + return; } + + $this->addHoliday(new Holiday( + 'constitutionDay', + ['en' => 'Constitution Day', 'ko' => '제헌절'], + new \DateTime("$this->year-7-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); } /** @@ -405,7 +413,7 @@ private function calculateLiberationDay(): void $this->addHoliday(new Holiday( 'liberationDay', ['en' => 'Liberation Day', 'ko' => '광복절'], - new DateTime("$this->year-8-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-8-15", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -420,14 +428,20 @@ private function calculateLiberationDay(): void */ private function calculateArmedForcesDay(): void { - if ($this->year >= 1956 && $this->year <= 1990) { - $this->addHoliday(new Holiday( - 'armedForcesDay', - ['en' => 'Armed Forces Day', 'ko' => '국군의 날'], - new DateTime("$this->year-10-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale - )); + if ($this->year < 1956) { + return; + } + + if ($this->year > 1990) { + return; } + + $this->addHoliday(new Holiday( + 'armedForcesDay', + ['en' => 'Armed Forces Day', 'ko' => '국군의 날'], + new \DateTime("$this->year-10-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); } /** @@ -443,7 +457,7 @@ private function calculateNationalFoundationDay(): void $this->addHoliday(new Holiday( 'nationalFoundationDay', ['en' => 'National Foundation Day', 'ko' => '개천절'], - new DateTime("$this->year-10-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -462,7 +476,7 @@ private function calculateHangulDay(): void $this->addHoliday(new Holiday( 'hangulDay', ['en' => 'Hangul Day', 'ko' => '한글날'], - new DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -557,7 +571,7 @@ private function calculateSubstituteHolidays(): void // Step 1. Build a temporary table that aggregates holidays by date. $dates = []; foreach ($this->getHolidayDates() as $name => $day) { - $holiday = $this->getHoliday($name); + $holiday = $this->getHoliday((string) $name); $dates[$day][] = $name; if (!isset($acceptedHolidays[$name])) { @@ -585,9 +599,9 @@ private function calculateSubstituteHolidays(): void // In a temporary table, public holidays are keyed by numeric number. // And weekends are keyed by string start with 'weekend:'. // For the substitute, we will use first item in queue. - $origin = $this->getHoliday($names[0]); - $nextWorkingDay = DateTime::createFromFormat('Y-m-d', $day, $tz); - if ($nextWorkingDay instanceof DateTime) { + $origin = $this->getHoliday((string) $names[0]); + $nextWorkingDay = \DateTime::createFromFormat('Y-m-d', $day, $tz); + if ($nextWorkingDay instanceof \DateTime) { $workDay = $this->nextWorkingDay($nextWorkingDay); $this->addSubstituteHoliday($origin, $workDay->format('Y-m-d')); } @@ -597,9 +611,9 @@ private function calculateSubstituteHolidays(): void /** * Helper method to find a first working day after specific date. */ - private function nextWorkingDay(DateTime $date): DateTime + private function nextWorkingDay(\DateTime $date): \DateTime { - $interval = new DateInterval('P1D'); + $interval = new \DateInterval('P1D'); $next = clone $date; do { $next->add($interval); @@ -624,7 +638,7 @@ private function addSubstituteHoliday(?Holiday $origin, string $date_str): void $this->addHoliday(new SubstituteHoliday( $origin, [], - new DateTime($date_str, DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime($date_str, DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain.php b/src/Yasumi/Provider/Spain.php old mode 100755 new mode 100644 index e48845242..e7e1d94aa --- a/src/Yasumi/Provider/Spain.php +++ b/src/Yasumi/Provider/Spain.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -36,7 +34,6 @@ class Spain extends AbstractProvider /** * Initialize holidays for Spain. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -82,7 +79,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Fiesta_Nacional_de_España * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -96,7 +92,7 @@ private function calculateNationalDay(): void 'ca' => 'Festa Nacional d’Espanya', 'es' => 'Fiesta Nacional de España', ], - new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -111,7 +107,6 @@ private function calculateNationalDay(): void * * @see https://www.timeanddate.com/holidays/spain/constitution-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -125,7 +120,7 @@ private function calculateConstitutionDay(): void 'ca' => 'Dia de la Constitució', 'es' => 'Día de la Constitución', ], - new DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-12-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Andalusia.php b/src/Yasumi/Provider/Spain/Andalusia.php old mode 100755 new mode 100644 index 0fc1361ca..bea9bbea1 --- a/src/Yasumi/Provider/Spain/Andalusia.php +++ b/src/Yasumi/Provider/Spain/Andalusia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +42,6 @@ class Andalusia extends Spain /** * Initialize holidays for Andalusia (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -70,7 +67,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/D%C3%ADa_de_Andaluc%C3%ADa * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -81,7 +77,7 @@ private function calculateAndalusiaDay(): void $this->addHoliday(new Holiday( 'andalusiaDay', ['es' => 'Día de Andalucía'], - new DateTime("$this->year-2-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-2-28", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Aragon.php b/src/Yasumi/Provider/Spain/Aragon.php old mode 100755 new mode 100644 index b3bbc7053..16a9f31ef --- a/src/Yasumi/Provider/Spain/Aragon.php +++ b/src/Yasumi/Provider/Spain/Aragon.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Spain; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -43,7 +42,6 @@ class Aragon extends Spain /** * Initialize holidays for Aragon (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Spain/Asturias.php b/src/Yasumi/Provider/Spain/Asturias.php old mode 100755 new mode 100644 index 85beca4fd..912ce2cfd --- a/src/Yasumi/Provider/Spain/Asturias.php +++ b/src/Yasumi/Provider/Spain/Asturias.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -45,7 +43,6 @@ class Asturias extends Spain /** * Initialize holidays for Asturias (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +69,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/asturias-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -83,7 +79,7 @@ private function calculateAsturiasDay(): void $this->addHoliday(new Holiday( 'asturiasDay', ['es' => 'Día de Asturias'], - new DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/BalearicIslands.php b/src/Yasumi/Provider/Spain/BalearicIslands.php old mode 100755 new mode 100644 index 1f3cc75d6..5535ad935 --- a/src/Yasumi/Provider/Spain/BalearicIslands.php +++ b/src/Yasumi/Provider/Spain/BalearicIslands.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +42,6 @@ class BalearicIslands extends Spain /** * Initialize holidays for Balearic Islands (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +69,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/the-balearic-islands-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -86,7 +82,7 @@ private function calculateBalearicIslandsDay(): void 'ca' => 'Diada de les Illes Balears', 'es' => 'Día de les Illes Balears', ], - new DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-3-1", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/BasqueCountry.php b/src/Yasumi/Provider/Spain/BasqueCountry.php old mode 100755 new mode 100644 index 519b74a3f..78f6d5190 --- a/src/Yasumi/Provider/Spain/BasqueCountry.php +++ b/src/Yasumi/Provider/Spain/BasqueCountry.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -43,7 +41,6 @@ class BasqueCountry extends Spain /** * Initialize holidays for Basque Country (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,20 +69,25 @@ public function initialize(): void * * @see https://www.officeholidays.com/holidays/day-of-the-basque-country * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception */ private function calculateBasqueCountryDay(): void { - if ($this->year >= 2011 && $this->year <= 2013) { - $this->addHoliday(new Holiday( - 'basqueCountryDay', - ['es' => 'Euskadi Eguna'], - new DateTime("$this->year-10-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), - $this->locale - )); + if ($this->year < 2011) { + return; } + + if ($this->year > 2013) { + return; + } + + $this->addHoliday(new Holiday( + 'basqueCountryDay', + ['es' => 'Euskadi Eguna'], + new \DateTime("$this->year-10-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale + )); } } diff --git a/src/Yasumi/Provider/Spain/CanaryIslands.php b/src/Yasumi/Provider/Spain/CanaryIslands.php old mode 100755 new mode 100644 index ef1c0bd3c..24ea194d2 --- a/src/Yasumi/Provider/Spain/CanaryIslands.php +++ b/src/Yasumi/Provider/Spain/CanaryIslands.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -45,7 +43,6 @@ class CanaryIslands extends Spain /** * Initialize holidays for Canary Islands (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -71,7 +68,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/canaries-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -82,7 +78,7 @@ private function calculateCanaryIslandsDay(): void $this->addHoliday(new Holiday( 'canaryIslandsDay', ['es' => 'Día de las Canarias'], - new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Cantabria.php b/src/Yasumi/Provider/Spain/Cantabria.php old mode 100755 new mode 100644 index 492d9f4c2..9bc36940c --- a/src/Yasumi/Provider/Spain/Cantabria.php +++ b/src/Yasumi/Provider/Spain/Cantabria.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -45,7 +43,6 @@ class Cantabria extends Spain /** * Initialize holidays for Cantabria (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +72,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/cantabria-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -86,7 +82,7 @@ private function calculateCantabriaDay(): void $this->addHoliday(new Holiday( 'cantabriaDay', ['es' => 'Día de Cantabria'], - new DateTime("second sunday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("second sunday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CastileAndLeon.php b/src/Yasumi/Provider/Spain/CastileAndLeon.php old mode 100755 new mode 100644 index 2ee3254ca..e92879dbb --- a/src/Yasumi/Provider/Spain/CastileAndLeon.php +++ b/src/Yasumi/Provider/Spain/CastileAndLeon.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -46,7 +44,6 @@ class CastileAndLeon extends Spain /** * Initialize holidays for Castile and León (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +69,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Castile_and_León_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -83,7 +79,7 @@ private function calculateCastileAndLeonDay(): void $this->addHoliday(new Holiday( 'castileAndLeonDay', ['es' => 'Día de Castilla y León'], - new DateTime("$this->year-4-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-4-23", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CastillaLaMancha.php b/src/Yasumi/Provider/Spain/CastillaLaMancha.php old mode 100755 new mode 100644 index 647ad8fd2..b5f415f35 --- a/src/Yasumi/Provider/Spain/CastillaLaMancha.php +++ b/src/Yasumi/Provider/Spain/CastillaLaMancha.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -46,7 +44,6 @@ class CastillaLaMancha extends Spain /** * Initialize holidays for Castilla-La Mancha (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +72,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/castile-la-mancha-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -86,7 +82,7 @@ private function calculateCastillaLaManchaDay(): void $this->addHoliday(new Holiday( 'castillaLaManchaDay', ['es' => 'Día de la Región Castilla-La Mancha'], - new DateTime("$this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-31", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Catalonia.php b/src/Yasumi/Provider/Spain/Catalonia.php old mode 100755 new mode 100644 index 8961f651c..f95d4ec65 --- a/src/Yasumi/Provider/Spain/Catalonia.php +++ b/src/Yasumi/Provider/Spain/Catalonia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -47,7 +45,6 @@ class Catalonia extends Spain /** * Initialize holidays for Catalonia (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,7 +72,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/National_Day_of_Catalonia * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -89,7 +85,7 @@ private function calculateNationalDayOfCatalonia(): void 'ca' => 'Diada Nacional de Catalunya', 'es' => 'Diada Nacional de Cataluña', ], - new DateTime("$this->year-9-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-9-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Ceuta.php b/src/Yasumi/Provider/Spain/Ceuta.php old mode 100755 new mode 100644 index 94270a405..9020e3264 --- a/src/Yasumi/Provider/Spain/Ceuta.php +++ b/src/Yasumi/Provider/Spain/Ceuta.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +42,6 @@ class Ceuta extends Spain /** * Initialize holidays for Ceuta (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -69,7 +66,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/the-independent-city-ceuta-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -80,7 +76,7 @@ private function calculateDayOfCeuta(): void $this->addHoliday(new Holiday( 'ceutaDay', ['es' => 'Día de Ceuta'], - new DateTime("$this->year-9-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-9-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/CommunityOfMadrid.php b/src/Yasumi/Provider/Spain/CommunityOfMadrid.php old mode 100755 new mode 100644 index 2417a8a2f..117064cd2 --- a/src/Yasumi/Provider/Spain/CommunityOfMadrid.php +++ b/src/Yasumi/Provider/Spain/CommunityOfMadrid.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -46,7 +44,6 @@ class CommunityOfMadrid extends Spain /** * Initialize holidays for the Community Of Madrid (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -76,7 +73,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Dos_de_Mayo_Uprising * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -86,7 +82,7 @@ private function calculateDosdeMayoUprisingDay(): void $this->addHoliday(new Holiday( 'dosdeMayoUprisingDay', ['es' => 'Fiesta de la Comunidad de Madrid'], - new DateTime("$this->year-5-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Extremadura.php b/src/Yasumi/Provider/Spain/Extremadura.php old mode 100755 new mode 100644 index fed1a1326..c8abddb4d --- a/src/Yasumi/Provider/Spain/Extremadura.php +++ b/src/Yasumi/Provider/Spain/Extremadura.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -45,7 +43,6 @@ class Extremadura extends Spain /** * Initialize holidays for Extremadura (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +69,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/extremadura-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -83,7 +79,7 @@ private function calculateDayOfExtremadura(): void $this->addHoliday(new Holiday( 'extremaduraDay', ['es' => 'Día de Extremadura'], - new DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-9-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Spain/Galicia.php b/src/Yasumi/Provider/Spain/Galicia.php old mode 100755 new mode 100644 index b2127147e..e1045fc6e --- a/src/Yasumi/Provider/Spain/Galicia.php +++ b/src/Yasumi/Provider/Spain/Galicia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -45,7 +43,6 @@ class Galicia extends Spain /** * Initialize holidays for Galicia (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -73,7 +70,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Galician_Literature_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -84,7 +80,7 @@ private function calculateGalicianLiteratureDay(): void $this->addHoliday(new Holiday('galicianLiteratureDay', [ 'es' => 'Día de las Letras Gallegas', 'gl' => 'Día das Letras Galegas', - ], new DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-5-17", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -101,7 +97,6 @@ private function calculateGalicianLiteratureDay(): void * * @see https://www.timeanddate.com/holidays/spain/santiago-apostle * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -111,7 +106,7 @@ private function calculateStJamesDay(): void if ($this->year >= 2000) { $this->addHoliday(new Holiday('stJamesDay', [ 'es' => 'Santiago Apostol', - ], new DateTime("$this->year-7-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-7-25", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/LaRioja.php b/src/Yasumi/Provider/Spain/LaRioja.php old mode 100755 new mode 100644 index d4e9f88ea..7d5f19434 --- a/src/Yasumi/Provider/Spain/LaRioja.php +++ b/src/Yasumi/Provider/Spain/LaRioja.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +42,6 @@ class LaRioja extends Spain /** * Initialize holidays for La Rioja (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -69,7 +66,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/rioja-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -79,7 +75,7 @@ private function calculateLaRiojaDay(): void if ($this->year >= 1983) { $this->addHoliday(new Holiday('laRiojaDay', [ 'es' => 'Día de La Rioja', - ], new DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/Melilla.php b/src/Yasumi/Provider/Spain/Melilla.php old mode 100755 new mode 100644 index 430c1bf4f..d0ae53f40 --- a/src/Yasumi/Provider/Spain/Melilla.php +++ b/src/Yasumi/Provider/Spain/Melilla.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Spain; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -42,7 +41,6 @@ class Melilla extends Spain /** * Initialize holidays for Melilla (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Spain/Navarre.php b/src/Yasumi/Provider/Spain/Navarre.php old mode 100755 new mode 100644 index f183c8f57..39c0eec6e --- a/src/Yasumi/Provider/Spain/Navarre.php +++ b/src/Yasumi/Provider/Spain/Navarre.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Spain; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -42,7 +41,6 @@ class Navarre extends Spain /** * Initialize holidays for Navarre (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Spain/RegionOfMurcia.php b/src/Yasumi/Provider/Spain/RegionOfMurcia.php old mode 100755 new mode 100644 index a9dd42559..dfa2ad2dd --- a/src/Yasumi/Provider/Spain/RegionOfMurcia.php +++ b/src/Yasumi/Provider/Spain/RegionOfMurcia.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +42,6 @@ class RegionOfMurcia extends Spain /** * Initialize holidays for the Region of Murcia (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -70,7 +67,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/murcia-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -80,7 +76,7 @@ private function calculateDayOfMurcia(): void if ($this->year >= 1983) { $this->addHoliday(new Holiday('murciaDay', [ 'es' => 'Día de la Región de Murcia', - ], new DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-6-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } } diff --git a/src/Yasumi/Provider/Spain/ValencianCommunity.php b/src/Yasumi/Provider/Spain/ValencianCommunity.php old mode 100755 new mode 100644 index 9981f605e..4f4d44e7b --- a/src/Yasumi/Provider/Spain/ValencianCommunity.php +++ b/src/Yasumi/Provider/Spain/ValencianCommunity.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Spain; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -47,7 +45,6 @@ class ValencianCommunity extends Spain /** * Initialize holidays for the Valencian Community (Spain). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -77,7 +74,6 @@ public function initialize(): void * * @see https://www.timeanddate.com/holidays/spain/the-valencian-community-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -91,7 +87,7 @@ private function calculateValencianCommunityDay(): void 'ca' => 'Diada Nacional del País Valencià', 'es' => 'Día de la Comunidad Valenciana', ], - new DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-10-9", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Sweden.php b/src/Yasumi/Provider/Sweden.php index 6474af36f..880fae16e 100644 --- a/src/Yasumi/Provider/Sweden.php +++ b/src/Yasumi/Provider/Sweden.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class Sweden extends AbstractProvider /** * Initialize holidays for Sweden. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -90,7 +86,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Twelfth_Night_(holiday) * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -100,7 +95,7 @@ private function calculateEpiphanyEve(): void $this->addHoliday(new Holiday( 'epiphanyEve', [], - new DateTime("$this->year-1-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-1-5", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -117,7 +112,6 @@ private function calculateEpiphanyEve(): void * * @see https://en.wikipedia.org/wiki/Walpurgis_Night * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -127,7 +121,7 @@ private function calculateWalpurgisEve(): void $this->addHoliday(new Holiday( 'walpurgisEve', [], - new DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-4-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_OBSERVANCE )); @@ -147,14 +141,13 @@ private function calculateWalpurgisEve(): void * * @see https://en.wikipedia.org/wiki/Midsummer#Sweden * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception */ private function calculateStJohnsHolidays(): void { - $date = new DateTime("$this->year-6-20 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-6-20 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'stJohnsDay', [], @@ -162,7 +155,7 @@ private function calculateStJohnsHolidays(): void $this->locale )); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'stJohnsEve', [], @@ -188,14 +181,13 @@ private function calculateStJohnsHolidays(): void * @see https://en.wikipedia.org/wiki/All_Saints%27_Day * @see https://www.timeanddate.com/holidays/sweden/all-saints-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception */ private function calculateAllSaintsHolidays(): void { - $date = new DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-10-31 this saturday", DateTimeZoneFactory::getDateTimeZone($this->timezone)); $this->addHoliday(new Holiday( 'allSaintsDay', [], @@ -203,7 +195,7 @@ private function calculateAllSaintsHolidays(): void $this->locale )); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $this->addHoliday(new Holiday( 'allSaintsEve', [], @@ -222,7 +214,6 @@ private function calculateAllSaintsHolidays(): void * Olympic Stadium, in honour of the election of King Gustav Vasa in 1523, as this was considered the foundation of * modern Sweden. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -243,7 +234,7 @@ private function calculateNationalDay(): void $this->addHoliday(new Holiday( 'nationalDay', ['sv' => $holidayName], - new DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-6", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } diff --git a/src/Yasumi/Provider/Switzerland.php b/src/Yasumi/Provider/Switzerland.php index 0231035bb..ed3f5f7ab 100644 --- a/src/Yasumi/Provider/Switzerland.php +++ b/src/Yasumi/Provider/Switzerland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -37,7 +34,6 @@ class Switzerland extends AbstractProvider /** * Initialize holidays for Switzerland. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -67,7 +63,6 @@ public function getSources(): array * * @see https://en.wikipedia.org/wiki/Berchtoldstag * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -81,7 +76,7 @@ protected function calculateBerchtoldsTag(): void 'fr' => '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 )); @@ -97,7 +92,6 @@ protected function calculateBerchtoldsTag(): void * * @see https://en.wikipedia.org/wiki/Federal_Day_of_Thanksgiving,_Repentance_and_Prayer * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -106,9 +100,9 @@ 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')); + $date->add(new \DateInterval('P1D')); $this->addHoliday(new Holiday('bettagsMontag', [ 'fr' => 'Jeûne fédéral', @@ -127,7 +121,6 @@ protected function calculateBettagsMontag(): void * * @see https://en.wikipedia.org/wiki/Swiss_National_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -145,7 +138,7 @@ private 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 )); @@ -153,7 +146,7 @@ private 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 1ab767a0d..fde079ee0 100644 --- a/src/Yasumi/Provider/Switzerland/Aargau.php +++ b/src/Yasumi/Provider/Switzerland/Aargau.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Aargau extends Switzerland /** * Initialize holidays for Aargau (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/AppenzellAusserrhoden.php b/src/Yasumi/Provider/Switzerland/AppenzellAusserrhoden.php index 621a26066..310455781 100644 --- a/src/Yasumi/Provider/Switzerland/AppenzellAusserrhoden.php +++ b/src/Yasumi/Provider/Switzerland/AppenzellAusserrhoden.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class AppenzellAusserrhoden extends Switzerland /** * Initialize holidays for Appenzell Ausserrhoden (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/AppenzellInnerrhoden.php b/src/Yasumi/Provider/Switzerland/AppenzellInnerrhoden.php index 9bf356e29..f3e8251a4 100644 --- a/src/Yasumi/Provider/Switzerland/AppenzellInnerrhoden.php +++ b/src/Yasumi/Provider/Switzerland/AppenzellInnerrhoden.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class AppenzellInnerrhoden extends Switzerland /** * Initialize holidays for Appenzell Innerrhoden (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/BaselLandschaft.php b/src/Yasumi/Provider/Switzerland/BaselLandschaft.php index 948261d99..6cf722c24 100644 --- a/src/Yasumi/Provider/Switzerland/BaselLandschaft.php +++ b/src/Yasumi/Provider/Switzerland/BaselLandschaft.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class BaselLandschaft extends Switzerland /** * Initialize holidays for Basel-Landschaft (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/BaselStadt.php b/src/Yasumi/Provider/Switzerland/BaselStadt.php index f1f9a29dd..f009c2c4c 100644 --- a/src/Yasumi/Provider/Switzerland/BaselStadt.php +++ b/src/Yasumi/Provider/Switzerland/BaselStadt.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class BaselStadt extends Switzerland /** * Initialize holidays for Basel-Stadt (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Bern.php b/src/Yasumi/Provider/Switzerland/Bern.php index 5ab6d14d3..547e417a8 100644 --- a/src/Yasumi/Provider/Switzerland/Bern.php +++ b/src/Yasumi/Provider/Switzerland/Bern.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -39,7 +38,6 @@ class Bern extends Switzerland /** * Initialize holidays for Bern (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Fribourg.php b/src/Yasumi/Provider/Switzerland/Fribourg.php index 59d04311a..8e10ad923 100644 --- a/src/Yasumi/Provider/Switzerland/Fribourg.php +++ b/src/Yasumi/Provider/Switzerland/Fribourg.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -41,7 +39,6 @@ class Fribourg extends Switzerland /** * Initialize holidays for Fribourg (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +69,6 @@ public function initialize(): void /** * December 26th. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -85,7 +81,7 @@ private 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/Geneva.php b/src/Yasumi/Provider/Switzerland/Geneva.php index 970f70167..9857b2d76 100644 --- a/src/Yasumi/Provider/Switzerland/Geneva.php +++ b/src/Yasumi/Provider/Switzerland/Geneva.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -44,7 +41,6 @@ class Geneva extends Switzerland /** * Initialize holidays for Geneva (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -72,7 +68,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Je%C3%BBne_genevois * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -84,9 +79,9 @@ private function calculateJeuneGenevois(): void } // Find first Sunday of September - $date = new DateTime('First Sunday of '.$this->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')); + $date->add(new \DateInterval('P4D')); $type = Holiday::TYPE_OTHER; if ($this->year > 1869 && $this->year < 1966) { @@ -108,7 +103,6 @@ private function calculateJeuneGenevois(): void * * @see https://fr.wikipedia.org/wiki/Restauration_genevoise * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -121,7 +115,7 @@ private 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 16870ca30..579a2d36c 100644 --- a/src/Yasumi/Provider/Switzerland/Glarus.php +++ b/src/Yasumi/Provider/Switzerland/Glarus.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -40,7 +38,6 @@ class Glarus extends Switzerland /** * Initialize holidays for Glarus (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -71,7 +68,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Battle_of_N%C3%A4fels * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -79,7 +75,7 @@ public function initialize(): void private function calculateNafelserFahrt(): void { if ($this->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 ff7c18e98..531348c2a 100644 --- a/src/Yasumi/Provider/Switzerland/Grisons.php +++ b/src/Yasumi/Provider/Switzerland/Grisons.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Grisons extends Switzerland /** * Initialize holidays for Grisons (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Jura.php b/src/Yasumi/Provider/Switzerland/Jura.php index 50842acdb..339457c71 100644 --- a/src/Yasumi/Provider/Switzerland/Jura.php +++ b/src/Yasumi/Provider/Switzerland/Jura.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -41,7 +39,6 @@ class Jura extends Switzerland /** * Initialize holidays for Jura (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -78,7 +75,6 @@ public function initialize(): void * * @see https://fr.wikipedia.org/wiki/Pl%C3%A9biscite_jurassien * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -91,7 +87,7 @@ private function calculatePlebisciteJurassien(): void [ 'fr' => '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 63d4a3cb8..f3e4c6403 100644 --- a/src/Yasumi/Provider/Switzerland/Lucerne.php +++ b/src/Yasumi/Provider/Switzerland/Lucerne.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Lucerne extends Switzerland /** * Initialize holidays for Lucerne (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Neuchatel.php b/src/Yasumi/Provider/Switzerland/Neuchatel.php index f01e0786d..4a4f07574 100644 --- a/src/Yasumi/Provider/Switzerland/Neuchatel.php +++ b/src/Yasumi/Provider/Switzerland/Neuchatel.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -42,7 +40,6 @@ class Neuchatel extends Switzerland /** * Initialize holidays for Neuchâtel (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -85,7 +82,6 @@ public function initialize(): void * * @see https://www.feiertagskalender.ch/feiertag.php?ft_id=11&geo=3056&hl=fr * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -98,7 +94,7 @@ private function calculateInstaurationRepublique(): void [ 'fr' => '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 )); @@ -108,7 +104,6 @@ private function calculateInstaurationRepublique(): void /** * January 2nd. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -121,7 +116,7 @@ private 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 )); @@ -130,7 +125,6 @@ private function calculateJanuary2nd(): void /** * December 26th. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -143,7 +137,7 @@ private 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 12c7f3f2d..09d3e643e 100644 --- a/src/Yasumi/Provider/Switzerland/Nidwalden.php +++ b/src/Yasumi/Provider/Switzerland/Nidwalden.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Nidwalden extends Switzerland /** * Initialize holidays for Nidwalden (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Obwalden.php b/src/Yasumi/Provider/Switzerland/Obwalden.php index a04ec8e97..ca312774f 100644 --- a/src/Yasumi/Provider/Switzerland/Obwalden.php +++ b/src/Yasumi/Provider/Switzerland/Obwalden.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -40,7 +38,6 @@ class Obwalden extends Switzerland /** * Initialize holidays for Obwalden (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -75,11 +72,9 @@ public function initialize(): void * * @see http://www.lebendigetraditionen.ch/traditionen/00210/index.html?lang=en * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateBruderKlausenFest(): void { @@ -89,7 +84,7 @@ private function calculateBruderKlausenFest(): void [ 'de' => '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 )); @@ -99,7 +94,7 @@ private 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 db2a0b2dc..157cd286d 100644 --- a/src/Yasumi/Provider/Switzerland/Schaffhausen.php +++ b/src/Yasumi/Provider/Switzerland/Schaffhausen.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Schaffhausen extends Switzerland /** * Initialize holidays for Schaffhausen (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Schwyz.php b/src/Yasumi/Provider/Switzerland/Schwyz.php index fa2bb381a..c71bddcb9 100644 --- a/src/Yasumi/Provider/Switzerland/Schwyz.php +++ b/src/Yasumi/Provider/Switzerland/Schwyz.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Schwyz extends Switzerland /** * Initialize holidays for Schwyz (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Solothurn.php b/src/Yasumi/Provider/Switzerland/Solothurn.php index 51d43182d..a6e189938 100644 --- a/src/Yasumi/Provider/Switzerland/Solothurn.php +++ b/src/Yasumi/Provider/Switzerland/Solothurn.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Solothurn extends Switzerland /** * Initialize holidays for Solothurn (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/StGallen.php b/src/Yasumi/Provider/Switzerland/StGallen.php index ca89514cd..049211d97 100644 --- a/src/Yasumi/Provider/Switzerland/StGallen.php +++ b/src/Yasumi/Provider/Switzerland/StGallen.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class StGallen extends Switzerland /** * Initialize holidays for St. Gallen (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Thurgau.php b/src/Yasumi/Provider/Switzerland/Thurgau.php index 5f44e2f8f..e783da002 100644 --- a/src/Yasumi/Provider/Switzerland/Thurgau.php +++ b/src/Yasumi/Provider/Switzerland/Thurgau.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Thurgau extends Switzerland /** * Initialize holidays for Thurgau (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Ticino.php b/src/Yasumi/Provider/Switzerland/Ticino.php index 7a3ae0265..73dd80760 100644 --- a/src/Yasumi/Provider/Switzerland/Ticino.php +++ b/src/Yasumi/Provider/Switzerland/Ticino.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -40,7 +38,6 @@ class Ticino extends Switzerland /** * Initialize holidays for Ticino (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -81,7 +78,6 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Feast_of_Saints_Peter_and_Paul * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -96,7 +92,7 @@ private function calculateStPeterPaul(): void 'fr' => '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 d306705fc..e46bcdac8 100644 --- a/src/Yasumi/Provider/Switzerland/Uri.php +++ b/src/Yasumi/Provider/Switzerland/Uri.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Uri extends Switzerland /** * Initialize holidays for Uri (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Valais.php b/src/Yasumi/Provider/Switzerland/Valais.php index 6f0a864dd..ff1212079 100644 --- a/src/Yasumi/Provider/Switzerland/Valais.php +++ b/src/Yasumi/Provider/Switzerland/Valais.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -39,7 +38,6 @@ class Valais extends Switzerland /** * Initialize holidays for Valais (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Vaud.php b/src/Yasumi/Provider/Switzerland/Vaud.php index 6c29b5cb7..4a4106ca1 100644 --- a/src/Yasumi/Provider/Switzerland/Vaud.php +++ b/src/Yasumi/Provider/Switzerland/Vaud.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -39,7 +38,6 @@ class Vaud extends Switzerland /** * Initialize holidays for Vaud (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Zug.php b/src/Yasumi/Provider/Switzerland/Zug.php index 79c46feb1..78296a2cf 100644 --- a/src/Yasumi/Provider/Switzerland/Zug.php +++ b/src/Yasumi/Provider/Switzerland/Zug.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -38,7 +37,6 @@ class Zug extends Switzerland /** * Initialize holidays for Zug (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Switzerland/Zurich.php b/src/Yasumi/Provider/Switzerland/Zurich.php index e1904e176..6b8751c84 100644 --- a/src/Yasumi/Provider/Switzerland/Zurich.php +++ b/src/Yasumi/Provider/Switzerland/Zurich.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider\Switzerland; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; @@ -39,7 +38,6 @@ class Zurich extends Switzerland /** * Initialize holidays for Zürich (Switzerland). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/Turkey.php b/src/Yasumi/Provider/Turkey.php old mode 100755 new mode 100644 index 19494bc19..349e1bf4b --- a/src/Yasumi/Provider/Turkey.php +++ b/src/Yasumi/Provider/Turkey.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\Provider; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -30,7 +29,6 @@ class Turkey extends AbstractProvider public const ID = 'TR'; /** - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -49,7 +47,6 @@ public function initialize(): void $this->addRepublicDay(); } - /** {@inheritdoc} */ public function getSources(): array { return [ @@ -176,7 +173,7 @@ private function addVictoryDay(): void */ private function addRepublicDay(): void { - if (1923 > $this->year) { + if (1924 > $this->year) { return; } diff --git a/src/Yasumi/Provider/USA.php b/src/Yasumi/Provider/USA.php old mode 100755 new mode 100644 index 3153f62be..5132bed4f --- a/src/Yasumi/Provider/USA.php +++ b/src/Yasumi/Provider/USA.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -38,7 +35,6 @@ class USA extends AbstractProvider /** * Initialize holidays for the USA. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -89,7 +85,7 @@ private function calculateMartinLutherKingday(): void if ($this->year >= 1986) { $this->addHoliday(new Holiday('martinLutherKingDay', [ 'en' => 'Dr. Martin Luther King Jr’s Birthday', - ], new DateTime("third monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("third monday of january $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -111,9 +107,9 @@ private function calculateMartinLutherKingday(): void private function calculateWashingtonsBirthday(): void { if ($this->year >= 1879) { - $date = new DateTime("$this->year-2-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-2-22", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1968) { - $date = new DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("third monday of february $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('washingtonsBirthday', [ 'en' => 'Washington’s Birthday', @@ -136,9 +132,9 @@ private function calculateWashingtonsBirthday(): void private function calculateMemorialDay(): void { if ($this->year >= 1865) { - $date = new DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-5-30", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1968) { - $date = new DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('memorialDay', [ 'en' => 'Memorial Day', @@ -161,9 +157,33 @@ private function calculateMemorialDay(): void private function calculateJuneteenth(): void { if ($this->year >= 2021) { - $this->addHoliday(new Holiday('juneteenth', [ - 'en' => 'Juneteenth', - ], new DateTime("$this->year-6-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + $date = new \DateTime("$this->year-6-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $label = 'Juneteenth'; + + $holiday = new Holiday('juneteenth', [ + 'en' => $label, + ], $date, $this->locale); + $this->addHoliday($holiday); + + $day_of_week = (int) $date->format('w'); + + if (0 === $day_of_week || 6 === $day_of_week) { + $date = clone $holiday; + $date->modify('previous friday'); + + if (0 === $day_of_week) { + $date->modify('next monday'); + } + + $this->addHoliday(new SubstituteHoliday( + $holiday, + [ + 'en' => $label.' (observed)', + ], + $date, + $this->locale + )); + } } } @@ -184,7 +204,7 @@ private function calculateIndependenceDay(): void if ($this->year >= 1776) { $this->addHoliday(new Holiday('independenceDay', [ 'en' => 'Independence Day', - ], new DateTime("$this->year-7-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-7-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -206,7 +226,7 @@ private function calculateLabourDay(): void [ 'en' => 'Labour Day', ], - new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -228,9 +248,9 @@ private function calculateLabourDay(): void private function calculateColumbusDay(): void { if ($this->year >= 1937) { - $date = new DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("$this->year-10-12", DateTimeZoneFactory::getDateTimeZone($this->timezone)); if ($this->year >= 1970) { - $date = new DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $date = new \DateTime("second monday of october $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)); } $this->addHoliday(new Holiday('columbusDay', [ 'en' => 'Columbus Day', @@ -256,7 +276,7 @@ private function calculateVeteransDay(): void $this->addHoliday(new Holiday('veteransDay', [ 'en' => $name, - ], new DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); + ], new \DateTime("$this->year-11-11", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } } @@ -280,7 +300,7 @@ private function calculateThanksgivingDay(): void [ 'en' => 'Thanksgiving Day', ], - new DateTime("fourth thursday of november $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("fourth thursday of november $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale )); } @@ -292,7 +312,6 @@ private function calculateThanksgivingDay(): void * When New Year's Day, Independence Day, or Christmas Day falls on a Saturday, the previous day is also a holiday. * When one of these holidays fall on a Sunday, the next day is also a holiday. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -301,18 +320,22 @@ private function calculateSubstituteHolidays(): void { // Loop through all defined holidays foreach ($this->getHolidays() as $holiday) { + if (!$holiday instanceof Holiday) { + continue; + } + $date = null; // Substitute holiday is on a Monday in case the holiday falls on a Sunday if (0 === (int) $holiday->format('w')) { $date = clone $holiday; - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } // Substitute holiday is on a Friday in case the holiday falls on a Saturday if (6 === (int) $holiday->format('w')) { $date = clone $holiday; - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); } // Add substitute holiday diff --git a/src/Yasumi/Provider/Ukraine.php b/src/Yasumi/Provider/Ukraine.php index 1ab5a440a..34e41fe81 100644 --- a/src/Yasumi/Provider/Ukraine.php +++ b/src/Yasumi/Provider/Ukraine.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\Provider; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -41,7 +40,6 @@ class Ukraine extends AbstractProvider /** * Initialize holidays for Ukraine. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -85,7 +83,6 @@ public function getSources(): array * of holidays of this country * @param bool $substitutable holidays on a weekend will be substituted to the next monday * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception @@ -114,9 +111,9 @@ public function addHoliday(Holiday $holiday, bool $substitutable = true): void } /** - * @throws \Exception - * * @return \DateTime|\DateTimeImmutable + * + * @throws \Exception */ protected function calculateEaster(int $year, string $timezone): \DateTimeInterface { @@ -126,7 +123,6 @@ protected function calculateEaster(int $year, string $timezone): \DateTimeInterf /** * Christmas Day. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -147,7 +143,6 @@ private function calculateChristmasDay(): void * * @see https://en.wikipedia.org/wiki/International_Workers%27_Day#Ukraine * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -175,7 +170,6 @@ private function calculateSecondInternationalWorkersDay(): void * * @see https://en.wikipedia.org/wiki/Victory_Day_over_Nazism_in_World_War_II * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -197,7 +191,6 @@ private function calculateVictoryDay(): void * * @see https://en.wikipedia.org/wiki/Constitution_Day_(Ukraine) * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -225,7 +218,6 @@ private function calculateConstitutionDay(): void * * @see https://en.wikipedia.org/wiki/Declaration_of_Independence_of_Ukraine * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -254,7 +246,6 @@ private function calculateIndependenceDay(): void * * @see https://en.wikipedia.org/wiki/Defender_of_Ukraine_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -279,7 +270,6 @@ private function calculateDefenderOfUkraineDay(): void * * @see https://en.wikipedia.org/wiki/Christmas_in_Ukraine * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception diff --git a/src/Yasumi/Provider/UnitedKingdom.php b/src/Yasumi/Provider/UnitedKingdom.php index 9d58ffc73..e886a3fe7 100644 --- a/src/Yasumi/Provider/UnitedKingdom.php +++ b/src/Yasumi/Provider/UnitedKingdom.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; @@ -41,7 +38,6 @@ class UnitedKingdom extends AbstractProvider /** * Initialize holidays for the United Kingdom. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -62,6 +58,8 @@ public function initialize(): void // Add any other holidays $this->calculatePlatinumJubileeBankHoliday(); $this->calculateMotheringSunday(); + $this->calculateQueenElizabethFuneralBankHoliday(); + $this->calculateKingCharlesCoronationBankHoliday(); } public function getSources(): array @@ -83,7 +81,6 @@ public function getSources(): array * * @see https://www.timeanddate.com/holidays/uk/early-may-bank-holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -100,7 +97,7 @@ protected function calculateMayDayBankHoliday(): void $this->addHoliday(new Holiday( 'mayDayBankHoliday', ['en' => 'May Day Bank Holiday'], - new DateTime("$this->year-5-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-5-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -111,7 +108,7 @@ protected function calculateMayDayBankHoliday(): void $this->addHoliday(new Holiday( 'mayDayBankHoliday', ['en' => 'May Day Bank Holiday'], - new DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("first monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -128,7 +125,6 @@ protected function calculateMayDayBankHoliday(): void * @see https://www.timeanddate.com/holidays/uk/spring-bank-holiday * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -146,7 +142,7 @@ protected function calculateSpringBankHoliday(): void $this->addHoliday(new Holiday( 'springBankHoliday', ['en' => 'Spring Bank Holiday'], - new DateTime("$this->year-6-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-4", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -159,7 +155,7 @@ protected function calculateSpringBankHoliday(): void $this->addHoliday(new Holiday( 'springBankHoliday', ['en' => 'Spring Bank Holiday'], - new DateTime("$this->year-6-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -170,7 +166,7 @@ protected function calculateSpringBankHoliday(): void $this->addHoliday(new Holiday( 'springBankHoliday', ['en' => 'Spring Bank Holiday'], - new DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("last monday of may $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -183,7 +179,6 @@ protected function calculateSpringBankHoliday(): void * @see https://www.timeanddate.com/holidays/uk/queen-platinum-jubilee * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom#Special_holidays * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -197,7 +192,59 @@ protected function calculatePlatinumJubileeBankHoliday(): void $this->addHoliday(new Holiday( 'platinumJubileeBankHoliday', ['en' => 'Platinum Jubilee Bank Holiday'], - new DateTime("$this->year-6-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-6-3", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_BANK + )); + } + + /** + * Queen Elizabeth II’s funeral is an extra bank holiday added on 10 September 2022 + * to mark the last day of the period of national mourning. + * + * @see https://www.timeanddate.com/holidays/uk/queen-elizabeth-funeral + * @see https://www.gov.uk/government/news/bank-holiday-announced-for-her-majesty-queen-elizabeth-iis-state-funeral-on-monday-19-september + * + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateQueenElizabethFuneralBankHoliday(): void + { + if (2022 !== $this->year) { + return; + } + + $this->addHoliday(new Holiday( + 'queenElizabethFuneralBankHoliday', + ['en' => 'Queen Elizabeth II’s State Funeral Bank Holiday'], + new \DateTime("$this->year-9-19", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + $this->locale, + Holiday::TYPE_BANK + )); + } + + /** + * The coronation of King Charles III is an extra bank holiday added on 6 November 2022 + * to mark the Coronation of His Majesty King Charles III. + * + * @see https://www.timeanddate.com/holidays/uk/king-coronation-day-holiday + * @see https://www.gov.uk/government/news/bank-holiday-proclaimed-in-honour-of-the-coronation-of-his-majesty-king-charles-iii + * + * @throws \InvalidArgumentException + * @throws UnknownLocaleException + * @throws \Exception + */ + protected function calculateKingCharlesCoronationBankHoliday(): void + { + if (2023 !== $this->year) { + return; + } + + $this->addHoliday(new Holiday( + 'kingCharlesCoronationBankHoliday', + ['en' => 'King Charles III’s Coronation Bank Holiday'], + new \DateTime("$this->year-5-8", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -234,7 +281,7 @@ protected function calculateChristmasHolidays(?string $type = null): void if (\in_array((int) $christmasDay->format('w'), [0, 6], true)) { $date = clone $christmasDay; - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( $christmasDay, [], @@ -246,7 +293,7 @@ protected function calculateChristmasHolidays(?string $type = null): void if (\in_array((int) $secondChristmasDay->format('w'), [0, 6], true)) { $date = clone $secondChristmasDay; - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( $secondChristmasDay, [], @@ -269,7 +316,6 @@ protected function calculateChristmasHolidays(?string $type = null): void * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom * @see https://www.timeanddate.com/holidays/uk/new-year-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -286,7 +332,7 @@ private function calculateNewYearsDay(): void $type = Holiday::TYPE_OBSERVANCE; } - $newYearsDay = new DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); + $newYearsDay = new \DateTime("$this->year-01-01", DateTimeZoneFactory::getDateTimeZone($this->timezone)); // If New Years Day falls on a Saturday or Sunday, it is observed the next Monday (January 2nd or 3rd) if (\in_array((int) $newYearsDay->format('w'), [0, 6], true)) { @@ -307,7 +353,6 @@ private function calculateNewYearsDay(): void * @see https://www.timeanddate.com/holidays/uk/summer-bank-holiday * @see https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -322,7 +367,7 @@ private function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'August 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 )); @@ -337,7 +382,7 @@ private function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'Summer Bank Holiday'], - new DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("first monday of september $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -348,7 +393,7 @@ private function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'Summer Bank Holiday'], - new DateTime("last monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("last monday of august $this->year", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, Holiday::TYPE_BANK )); @@ -366,7 +411,7 @@ private function calculateSummerBankHoliday(): void private function calculateMotheringSunday(): void { $date = $this->calculateEaster($this->year, $this->timezone); - $date->sub(new DateInterval('P3W')); + $date->sub(new \DateInterval('P3W')); $this->addHoliday(new Holiday( 'motheringSunday', diff --git a/src/Yasumi/Provider/UnitedKingdom/England.php b/src/Yasumi/Provider/UnitedKingdom/England.php index d6e44f88d..03c0b7e70 100644 --- a/src/Yasumi/Provider/UnitedKingdom/England.php +++ b/src/Yasumi/Provider/UnitedKingdom/England.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php index 93ad7bf95..9a9570195 100644 --- a/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php +++ b/src/Yasumi/Provider/UnitedKingdom/NorthernIreland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\Provider\UnitedKingdom; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\DateTimeZoneFactory; @@ -42,7 +40,6 @@ class NorthernIreland extends UnitedKingdom /** * Initialize holidays for Northern Ireland (United Kingdom). * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -66,11 +63,9 @@ public function initialize(): void * * @see https://en.wikipedia.org/wiki/Saint_Patrick%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateStPatricksDay(): void { @@ -81,7 +76,7 @@ private function calculateStPatricksDay(): void $holiday = new Holiday( 'stPatricksDay', ['en' => '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 ); @@ -112,11 +107,9 @@ private function calculateStPatricksDay(): void * * @see https://en.wikipedia.org/wiki/The_Twelfth * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateBattleOfTheBoyne(): void { @@ -127,7 +120,7 @@ private 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 af5ee863d..b0583256d 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Scotland.php +++ b/src/Yasumi/Provider/UnitedKingdom/Scotland.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\Provider\UnitedKingdom; -use DateInterval; -use DateTime; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\Provider\DateTimeZoneFactory; @@ -48,7 +45,6 @@ class Scotland extends UnitedKingdom /** * Initialize holidays for the United Kingdom. * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -80,7 +76,6 @@ public function getSources(): array * * @see https://www.timeanddate.com/holidays/uk/summer-bank-holiday * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -94,7 +89,7 @@ private function calculateSummerBankHoliday(): void $this->addHoliday(new Holiday( 'summerBankHoliday', ['en' => 'August 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 )); @@ -110,7 +105,6 @@ private function calculateSummerBankHoliday(): void * * @see https://www.timeanddate.com/holidays/uk/new-year-day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception @@ -131,7 +125,7 @@ private function calculateNewYearsHolidays(): void $secondNewYearsDay = new Holiday( 'secondNewYearsDay', [], - new DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), + new \DateTime("$this->year-1-2", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale, $type ); @@ -141,7 +135,7 @@ private function calculateNewYearsHolidays(): void if (\in_array((int) $newYearsDay->format('w'), [0, 6], true)) { $date = clone $newYearsDay; - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( $newYearsDay, [], @@ -153,7 +147,7 @@ private function calculateNewYearsHolidays(): void if (\in_array((int) $secondNewYearsDay->format('w'), [0, 6], true)) { $date = clone $secondNewYearsDay; - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->addHoliday(new SubstituteHoliday( $secondNewYearsDay, [], @@ -171,11 +165,9 @@ private function calculateNewYearsHolidays(): void * * @see https://en.wikipedia.org/wiki/Saint_Andrew%27s_Day * - * @throws InvalidDateException * @throws \InvalidArgumentException * @throws UnknownLocaleException * @throws \Exception - * @throws \Exception */ private function calculateStAndrewsDay(): void { @@ -185,7 +177,7 @@ private function calculateStAndrewsDay(): void $holiday = 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, Holiday::TYPE_BANK ); diff --git a/src/Yasumi/Provider/UnitedKingdom/Wales.php b/src/Yasumi/Provider/UnitedKingdom/Wales.php index 793fad825..fefbb6b6b 100644 --- a/src/Yasumi/Provider/UnitedKingdom/Wales.php +++ b/src/Yasumi/Provider/UnitedKingdom/Wales.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/ProviderInterface.php b/src/Yasumi/ProviderInterface.php old mode 100755 new mode 100644 index 73754848e..693aab7c2 --- a/src/Yasumi/ProviderInterface.php +++ b/src/Yasumi/ProviderInterface.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,9 @@ namespace Yasumi; -use Yasumi\Exception\InvalidDateException; +use Yasumi\Exception\UnknownLocaleException; +use Yasumi\Filters\BetweenFilter; +use Yasumi\Filters\OnFilter; /** * Interface ProviderInterface - Holiday provider interface. @@ -23,11 +25,9 @@ * * @see AbstractProvider */ -interface ProviderInterface +interface ProviderInterface extends \Countable { - /** - * Initialize country holidays. - */ + /** Initialize country holidays */ public function initialize(): void; /** @@ -55,8 +55,6 @@ public function getYear(): int; * \DateTime) * * @return bool true if date represents a working day, otherwise false - * - * @throws InvalidDateException */ public function isWorkingDay(\DateTimeInterface $date): bool; @@ -70,4 +68,164 @@ public function isWorkingDay(\DateTimeInterface $date): bool; * @throws \InvalidArgumentException when the given name is blank or empty */ public function getHoliday(string $key): ?Holiday; + + /** + * Gets all the holidays defined by this holiday provider (for the given year). + * + * @return Holiday[] list of all holidays defined for the given year + */ + public function getHolidays(): array; + + /** + * Determines whether a date represents a holiday or not. + * + * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, + * \DateTime) + * + * @return bool true if date represents a holiday, otherwise false + */ + public function isHoliday(\DateTimeInterface $date): bool; + + /** + * Get an iterator for the holidays. + * + * @return \ArrayIterator iterator for the holidays of this calendar + */ + public function getIterator(): \ArrayIterator; + + /** + * Adds a holiday to the holidays providers (i.e. country/state) list of holidays. + * + * @param Holiday $holiday holiday instance (representing a holiday) to be added to the internal list + * of holidays of this country + */ + public function addHoliday(Holiday $holiday): void; + + /** + * Removes a holiday from the holidays providers (i.e. country/state) list of holidays. + * + * This function can be helpful in cases where an existing holiday provider class can be extended but some holidays + * are not part of the original (extended) provider. + * + * @param string $key holiday key + */ + public function removeHoliday(string $key): void; + + /** + * Determines whether a date represents a weekend day or not. + * + * @param \DateTimeInterface $date any date object that implements the DateTimeInterface (e.g. Yasumi\Holiday, + * \DateTime) + * + * @return bool true if date represents a weekend day, otherwise false + */ + public function isWeekendDay(\DateTimeInterface $date): bool; + + /** + * On what date is the given holiday? + * + * @param string $key holiday key + * + * @return string the date of the requested holiday + * + * @throws \InvalidArgumentException when the given name is blank or empty + */ + public function whenIs(string $key): string; + + /** + * On what day of the week is the given holiday? + * + * This function returns the index number for the day of the week on which the given holiday falls. + * The index number is an integer starting with 0 being Sunday, 1 = Monday, etc. + * + * @param string $key key of the holiday + * + * @return int the index of the weekdays of the requested holiday (0 = Sunday, 1 = Monday, etc.) + * + * @throws \InvalidArgumentException when the given name is blank or empty + */ + public function whatWeekDayIs(string $key): int; + + /** + * Gets all the holiday names defined by this holiday provider (for the given year). + * + * @return array|array list of all holiday names defined for the given year + */ + public function getHolidayNames(): array; + + /** + * Retrieves the next date (year) the given holiday is going to take place. + * + * @param string $key key of the holiday for which the next occurrence need to be retrieved + * + * @return Holiday|null a Holiday instance for the given holiday + * + * @throws UnknownLocaleException + * @throws \RuntimeException + * @throws \InvalidArgumentException + * + * @covers AbstractProvider::anotherTime + */ + public function next(string $key): ?Holiday; + + /** + * Retrieves the previous date (year) the given holiday took place. + * + * @param string $key key of the holiday for which the previous occurrence need to be retrieved + * + * @return Holiday|null a Holiday instance for the given holiday + * + * @throws UnknownLocaleException + * @throws \RuntimeException + * @throws \InvalidArgumentException + * + * @covers AbstractProvider::anotherTime + */ + public function previous(string $key): ?Holiday; + + /** + * Retrieves a list of all holidays between the given start and end date. + * + * Yasumi only calculates holidays for a single year, so a start date or end date beyond the given year will only + * return holidays for the given year. For example, holidays calculated for the year 2016, will only return 2016 + * holidays if the provided period is for example 01/01/2012 - 31/12/2017. + * + * Please take care to use the appropriate timezone for the start and end date parameters. In case you use + * different + * timezone for these parameters versus the instantiated Holiday Provider, the outcome might be unexpected (but + * correct). + * + * @param \DateTimeInterface $startDate Start date of the time frame to check against + * @param \DateTimeInterface $endDate End date of the time frame to check against + * @param ?bool $equals indicate whether the start and end dates should be included in the + * comparison + * + * @throws \InvalidArgumentException an InvalidArgumentException is thrown if the start date is set after the end + * date + */ + public function between( + \DateTimeInterface $startDate, + \DateTimeInterface $endDate, + ?bool $equals = null + ): BetweenFilter; + + /** + * Retrieves a list of all holidays that happen on the given date. + * + * Yasumi only calculates holidays for a single year, so a date outside the given year will not appear to + * contain any holidays. + * + * Please take care to use the appropriate timezone for the date parameters. If there is a different timezone used + * for these parameters versus the instantiated Holiday Provider, the outcome might be unexpected (but correct). + * + * @param \DateTimeInterface $date date to check for holidays on + */ + public function on(\DateTimeInterface $date): OnFilter; + + /** + * Gets all the holiday dates defined by this holiday provider (for the given year). + * + * @return array list of all holiday dates defined for the given year + */ + public function getHolidayDates(): array; } diff --git a/src/Yasumi/SubstituteHoliday.php b/src/Yasumi/SubstituteHoliday.php old mode 100755 new mode 100644 index 4eeee819f..45657881a --- a/src/Yasumi/SubstituteHoliday.php +++ b/src/Yasumi/SubstituteHoliday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; @@ -56,7 +55,6 @@ class SubstituteHoliday extends Holiday * TYPE_OBSERVANCE, TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default, * an official holiday is considered. * - * @throws InvalidDateException * @throws UnknownLocaleException * @throws \InvalidArgumentException * @throws \Exception diff --git a/src/Yasumi/Translations.php b/src/Yasumi/Translations.php index 9717e592c..333d3b231 100644 --- a/src/Yasumi/Translations.php +++ b/src/Yasumi/Translations.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi; -use DirectoryIterator; -use InvalidArgumentException; use Yasumi\Exception\UnknownLocaleException; /** @@ -25,7 +23,7 @@ class Translations implements TranslationsInterface { /** - * @var array translations array: ['' => ['' => 'translation', ...], ... ] + * @var array> translations array: ['' => ['' => 'translation', ...], ... ] */ public array $translations = []; @@ -50,19 +48,23 @@ public function __construct(array $availableLocales) * @param string $directoryPath directory path for translation files * * @throws UnknownLocaleException - * @throws InvalidArgumentException + * @throws \InvalidArgumentException */ public function loadTranslations(string $directoryPath): void { if (!file_exists($directoryPath)) { - throw new InvalidArgumentException('Directory with translations not found'); + throw new \InvalidArgumentException('Directory with translations not found'); } $directoryPath = rtrim($directoryPath, '/\\').DIRECTORY_SEPARATOR; $extension = 'php'; - foreach (new DirectoryIterator($directoryPath) as $file) { - if ($file->isDot() || $file->isDir()) { + foreach (new \DirectoryIterator($directoryPath) as $file) { + if ($file->isDot()) { + continue; + } + + if ($file->isDir()) { continue; } @@ -115,8 +117,11 @@ public function addTranslation(string $key, string $locale, string $translation) */ public function getTranslation(string $key, string $locale): ?string { - if (!\array_key_exists($key, $this->translations) - || !\array_key_exists($locale, $this->translations[$key])) { + if (!\array_key_exists($key, $this->translations)) { + return null; + } + + if (!\array_key_exists($locale, $this->translations[$key])) { return null; } diff --git a/src/Yasumi/TranslationsInterface.php b/src/Yasumi/TranslationsInterface.php index b20abe1c8..3d11bee82 100644 --- a/src/Yasumi/TranslationsInterface.php +++ b/src/Yasumi/TranslationsInterface.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi; -/** - * Interface TranslationsInterface. - */ interface TranslationsInterface { /** diff --git a/src/Yasumi/Yasumi.php b/src/Yasumi/Yasumi.php old mode 100755 new mode 100644 index fbefba16e..d396f8a99 --- a/src/Yasumi/Yasumi.php +++ b/src/Yasumi/Yasumi.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,13 +14,6 @@ namespace Yasumi; -use FilesystemIterator; -use InvalidArgumentException; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; -use ReflectionClass; -use RuntimeException; -use Yasumi\Exception\InvalidDateException; use Yasumi\Exception\InvalidYearException; use Yasumi\Exception\ProviderNotFoundException; use Yasumi\Exception\UnknownLocaleException; @@ -68,10 +61,9 @@ class Yasumi * @param int $workingDays Number of days to look ahead for the (first) next working day * * @throws UnknownLocaleException - * @throws RuntimeException - * @throws InvalidArgumentException + * @throws \RuntimeException + * @throws \InvalidArgumentException * @throws \Exception - * @throws InvalidDateException * * @TODO we should accept a timezone so we can accept int/string for $startDate */ @@ -80,8 +72,8 @@ public static function nextWorkingDay( \DateTimeInterface $startDate, int $workingDays = 1 ): \DateTimeInterface { - // Setup start date, if it's an instance of \DateTime, clone to prevent modification to original - $date = $startDate instanceof \DateTime ? clone $startDate : $startDate; + // convert to immutable date to prevent modification of the original + $date = $startDate instanceof \DateTime ? \DateTimeImmutable::createFromMutable($startDate) : $startDate; $provider = null; @@ -90,7 +82,7 @@ public static function nextWorkingDay( if (!$provider instanceof ProviderInterface) { $provider = self::create($class, (int) $date->format('Y')); - } elseif ($provider->getYear() !== $date->format('Y')) { + } elseif ($provider->getYear() !== (int) $date->format('Y')) { $provider = self::create($class, (int) $date->format('Y')); } @@ -116,7 +108,7 @@ public static function nextWorkingDay( * * @return ProviderInterface An instance of class $class is created and returned * - * @throws RuntimeException If no such holiday provider is found + * @throws \RuntimeException If no such holiday provider is found * @throws InvalidYearException if the year parameter is not between the defined lower and upper bounds * @throws UnknownLocaleException if the locale parameter is invalid * @throws ProviderNotFoundException if the holiday provider for the given country does not exist @@ -126,7 +118,7 @@ public static function create(string $class, int $year = self::YEAR_LOWER_BOUND, // Find and return holiday provider instance $providerClass = sprintf('Yasumi\Provider\%s', str_replace('/', '\\', $class)); - if (class_exists($class) && (new ReflectionClass($class))->implementsInterface(ProviderInterface::class)) { + if (class_exists($class) && (new \ReflectionClass($class))->implementsInterface(ProviderInterface::class)) { $providerClass = $class; } @@ -140,7 +132,7 @@ public static function create(string $class, int $year = self::YEAR_LOWER_BOUND, } // Load internal locales variable - if (empty(self::$locales)) { + if ([] === self::$locales) { self::$locales = self::getAvailableLocales(); } @@ -182,8 +174,8 @@ public static function getAvailableLocales(): array * * @return ProviderInterface An instance of class $class is created and returned * - * @throws RuntimeException If no such holiday provider is found - * @throws InvalidArgumentException if the year parameter is not between the defined lower and upper bounds + * @throws \RuntimeException If no such holiday provider is found + * @throws \InvalidArgumentException if the year parameter is not between the defined lower and upper bounds * @throws UnknownLocaleException if the locale parameter is invalid * @throws ProviderNotFoundException if the holiday provider for the given ISO3166-2 code does not exist * @throws \ReflectionException @@ -218,24 +210,31 @@ public static function getProviders(): array } $providers = []; - $filesIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator( + $filesIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( __DIR__.DIRECTORY_SEPARATOR.'Provider', - FilesystemIterator::SKIP_DOTS - ), RecursiveIteratorIterator::SELF_FIRST); + \FilesystemIterator::SKIP_DOTS + ), \RecursiveIteratorIterator::SELF_FIRST); foreach ($filesIterator as $file) { - if ($file->isDir() || 'php' !== $file->getExtension() || \in_array( - $file->getBasename('.php'), - self::$ignoredProvider, - true - )) { + if ($file->isDir()) { continue; } + if ('php' !== $file->getExtension()) { + continue; + } + + if (\in_array( + $file->getBasename('.php'), + self::$ignoredProvider, + true + )) { + continue; + } $quotedDs = preg_quote(DIRECTORY_SEPARATOR, ''); $provider = preg_replace("#^.+{$quotedDs}Provider$quotedDs(.+)\\.php$#", '$1', $file->getPathName()); - $class = new ReflectionClass(sprintf('Yasumi\Provider\%s', str_replace('/', '\\', $provider))); + $class = new \ReflectionClass(sprintf('Yasumi\Provider\%s', str_replace('/', '\\', $provider))); $key = 'ID'; if ($class->isSubclassOf(AbstractProvider::class) && $class->hasConstant($key)) { @@ -258,10 +257,9 @@ public static function getProviders(): array * @param int $workingDays Number of days to look back for the (first) previous working day * * @throws UnknownLocaleException - * @throws RuntimeException - * @throws InvalidArgumentException + * @throws \RuntimeException + * @throws \InvalidArgumentException * @throws \Exception - * @throws InvalidDateException * * @TODO we should accept a timezone so we can accept int/string for $startDate */ @@ -270,17 +268,21 @@ public static function prevWorkingDay( \DateTimeInterface $startDate, int $workingDays = 1 ): \DateTimeInterface { - // Setup start date, if it's an instance of \DateTime, clone to prevent modification to original - $date = $startDate instanceof \DateTime ? clone $startDate : $startDate; + // convert to immutable date to prevent modification of the original + $date = $startDate instanceof \DateTime ? \DateTimeImmutable::createFromMutable($startDate) : $startDate; $provider = null; while ($workingDays > 0) { $date = $date->sub(new \DateInterval('P1D')); + if (!$date instanceof \DateTimeImmutable) { + throw new \RuntimeException('unable to perform date interval subtraction'); + } + if (!$provider instanceof ProviderInterface) { $provider = self::create($class, (int) $date->format('Y')); - } elseif ($provider->getYear() !== $date->format('Y')) { + } elseif ($provider->getYear() !== (int) $date->format('Y')) { $provider = self::create($class, (int) $date->format('Y')); } diff --git a/src/Yasumi/data/locales.php b/src/Yasumi/data/locales.php index 73f503cab..4ee6c4884 100644 --- a/src/Yasumi/data/locales.php +++ b/src/Yasumi/data/locales.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/allSaintsDay.php b/src/Yasumi/data/translations/allSaintsDay.php old mode 100755 new mode 100644 index 924da6dfb..702aaf700 --- a/src/Yasumi/data/translations/allSaintsDay.php +++ b/src/Yasumi/data/translations/allSaintsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -21,8 +21,8 @@ 'en' => 'All Saints’ Day', 'es' => 'Día de todos los Santos', 'fi' => 'Pyhäinpäivä', - 'fr_BE' => 'La Toussaint', 'fr' => 'Toussaint', + 'fr_BE' => 'La Toussaint', 'hr' => 'Dan svih svetih', 'hu' => 'Mindenszentek', 'it' => 'Festa di Tutti i Santi', diff --git a/src/Yasumi/data/translations/allSaintsEve.php b/src/Yasumi/data/translations/allSaintsEve.php old mode 100755 new mode 100644 index 0d91a9139..665e6a447 --- a/src/Yasumi/data/translations/allSaintsEve.php +++ b/src/Yasumi/data/translations/allSaintsEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/allSoulsDay.php b/src/Yasumi/data/translations/allSoulsDay.php index 05425ce22..1fd96eabe 100644 --- a/src/Yasumi/data/translations/allSoulsDay.php +++ b/src/Yasumi/data/translations/allSoulsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/annunciation.php b/src/Yasumi/data/translations/annunciation.php index f0958bc3b..e7419c69e 100644 --- a/src/Yasumi/data/translations/annunciation.php +++ b/src/Yasumi/data/translations/annunciation.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/anzacDay.php b/src/Yasumi/data/translations/anzacDay.php index d25bb015d..a01757470 100644 --- a/src/Yasumi/data/translations/anzacDay.php +++ b/src/Yasumi/data/translations/anzacDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/armisticeDay.php b/src/Yasumi/data/translations/armisticeDay.php index b47601e5d..9d06c6f65 100644 --- a/src/Yasumi/data/translations/armisticeDay.php +++ b/src/Yasumi/data/translations/armisticeDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/ascensionDay.php b/src/Yasumi/data/translations/ascensionDay.php index 9d6413228..f8556dcce 100644 --- a/src/Yasumi/data/translations/ascensionDay.php +++ b/src/Yasumi/data/translations/ascensionDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -25,5 +25,6 @@ 'it' => 'Ascensione', 'nb' => 'Kristi himmelfartsdag', 'nl' => 'Hemelvaart', + 'sk' => 'Nanebovstúpenie Pána', 'sv' => 'Kristi himmelsfärdsdag', ]; diff --git a/src/Yasumi/data/translations/ashWednesday.php b/src/Yasumi/data/translations/ashWednesday.php index d145ae215..db4d14c1b 100644 --- a/src/Yasumi/data/translations/ashWednesday.php +++ b/src/Yasumi/data/translations/ashWednesday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -22,4 +22,5 @@ 'it' => 'Mercoledi delle Ceneri', 'nl' => 'Aswoensdag', 'pt' => 'Quarta-feira de Cinzas', + 'sk' => 'Popolcová streda', ]; diff --git a/src/Yasumi/data/translations/assumptionOfMary.php b/src/Yasumi/data/translations/assumptionOfMary.php old mode 100755 new mode 100644 index 3795ca906..d3b7a2f3f --- a/src/Yasumi/data/translations/assumptionOfMary.php +++ b/src/Yasumi/data/translations/assumptionOfMary.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/australiaDay.php b/src/Yasumi/data/translations/australiaDay.php index fe72f966f..b46cf4c66 100644 --- a/src/Yasumi/data/translations/australiaDay.php +++ b/src/Yasumi/data/translations/australiaDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/canadaDay.php b/src/Yasumi/data/translations/canadaDay.php index f116a3679..1d22d49c0 100644 --- a/src/Yasumi/data/translations/canadaDay.php +++ b/src/Yasumi/data/translations/canadaDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/carnationRevolutionDay.php b/src/Yasumi/data/translations/carnationRevolutionDay.php index 6d1c6fb8e..ae3e23a32 100644 --- a/src/Yasumi/data/translations/carnationRevolutionDay.php +++ b/src/Yasumi/data/translations/carnationRevolutionDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/christmasDay.php b/src/Yasumi/data/translations/christmasDay.php old mode 100755 new mode 100644 index 22016e818..d3c975e8c --- a/src/Yasumi/data/translations/christmasDay.php +++ b/src/Yasumi/data/translations/christmasDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/christmasEve.php b/src/Yasumi/data/translations/christmasEve.php old mode 100755 new mode 100644 index 3589b410c..08769690e --- a/src/Yasumi/data/translations/christmasEve.php +++ b/src/Yasumi/data/translations/christmasEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/civicHoliday.php b/src/Yasumi/data/translations/civicHoliday.php index 5a945f994..9cd417e41 100644 --- a/src/Yasumi/data/translations/civicHoliday.php +++ b/src/Yasumi/data/translations/civicHoliday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/corpusChristi.php b/src/Yasumi/data/translations/corpusChristi.php index f46c60cb0..64858018b 100644 --- a/src/Yasumi/data/translations/corpusChristi.php +++ b/src/Yasumi/data/translations/corpusChristi.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -23,4 +23,5 @@ 'pl' => 'Boże Ciało', 'pt' => 'Corpus Christi', 'pt_PT' => 'Corpo de Deus', + 'sk' => 'Božie Telo', ]; diff --git a/src/Yasumi/data/translations/dayAfterNewYearsDay.php b/src/Yasumi/data/translations/dayAfterNewYearsDay.php index ee2b40e78..16dd14524 100644 --- a/src/Yasumi/data/translations/dayAfterNewYearsDay.php +++ b/src/Yasumi/data/translations/dayAfterNewYearsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/dayOfLiberation.php b/src/Yasumi/data/translations/dayOfLiberation.php index 0fdb14c9e..bca174713 100644 --- a/src/Yasumi/data/translations/dayOfLiberation.php +++ b/src/Yasumi/data/translations/dayOfLiberation.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/dayOfReformation.php b/src/Yasumi/data/translations/dayOfReformation.php old mode 100755 new mode 100644 index 12da77782..0975b75ae --- a/src/Yasumi/data/translations/dayOfReformation.php +++ b/src/Yasumi/data/translations/dayOfReformation.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/discoveryDay.php b/src/Yasumi/data/translations/discoveryDay.php index 23d583c13..02b098e1d 100644 --- a/src/Yasumi/data/translations/discoveryDay.php +++ b/src/Yasumi/data/translations/discoveryDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/easter.php b/src/Yasumi/data/translations/easter.php index 65b4961b0..9804b03c6 100644 --- a/src/Yasumi/data/translations/easter.php +++ b/src/Yasumi/data/translations/easter.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/easterMonday.php b/src/Yasumi/data/translations/easterMonday.php index 868b05ef1..6c678dfc6 100644 --- a/src/Yasumi/data/translations/easterMonday.php +++ b/src/Yasumi/data/translations/easterMonday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -33,8 +33,8 @@ 'lt' => 'Antroji Velykų diena', 'lv' => 'Otrās Lieldienas', 'nb' => 'andre påskedag', - 'nl_BE' => 'paasmaandag', 'nl' => 'tweede paasdag', + 'nl_BE' => 'paasmaandag', 'pl' => 'Poniedziałek Wielkanocny', 'ro' => 'A doua zi de Paște', 'sk' => 'Veľkonočný pondelok', diff --git a/src/Yasumi/data/translations/epiphany.php b/src/Yasumi/data/translations/epiphany.php index c615e01ba..f393452b4 100644 --- a/src/Yasumi/data/translations/epiphany.php +++ b/src/Yasumi/data/translations/epiphany.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,9 +16,9 @@ // Translations for Epiphany return [ 'ca' => 'Epifania', + 'de' => 'Heilige 3 Könige', 'de_AT' => 'Heilige Drei Könige', 'de_CH' => 'Heilige Drei Könige', - 'de' => 'Heilige 3 Könige', 'el' => 'Θεοφάνεια', 'en' => 'Epiphany', 'es' => 'Día de Reyes', diff --git a/src/Yasumi/data/translations/epiphanyEve.php b/src/Yasumi/data/translations/epiphanyEve.php index 1ddf54ebf..69b73aace 100644 --- a/src/Yasumi/data/translations/epiphanyEve.php +++ b/src/Yasumi/data/translations/epiphanyEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/familyDay.php b/src/Yasumi/data/translations/familyDay.php index f611eaac5..d3b7ecb10 100644 --- a/src/Yasumi/data/translations/familyDay.php +++ b/src/Yasumi/data/translations/familyDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/fathersDay.php b/src/Yasumi/data/translations/fathersDay.php old mode 100755 new mode 100644 index a1ff62059..ff9a5a20b --- a/src/Yasumi/data/translations/fathersDay.php +++ b/src/Yasumi/data/translations/fathersDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/goldCupParadeDay.php b/src/Yasumi/data/translations/goldCupParadeDay.php index ac9075026..b0a9eee36 100644 --- a/src/Yasumi/data/translations/goldCupParadeDay.php +++ b/src/Yasumi/data/translations/goldCupParadeDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/goodFriday.php b/src/Yasumi/data/translations/goodFriday.php index 0758f7528..c120df4f3 100644 --- a/src/Yasumi/data/translations/goodFriday.php +++ b/src/Yasumi/data/translations/goodFriday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/heritageDay.php b/src/Yasumi/data/translations/heritageDay.php index 42f35bbb5..7d655a854 100644 --- a/src/Yasumi/data/translations/heritageDay.php +++ b/src/Yasumi/data/translations/heritageDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/immaculateConception.php b/src/Yasumi/data/translations/immaculateConception.php index 0d75bdf66..449c6dbc0 100644 --- a/src/Yasumi/data/translations/immaculateConception.php +++ b/src/Yasumi/data/translations/immaculateConception.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -23,4 +23,5 @@ 'fr' => 'Immaculée Conception', 'it' => 'Immacolata Concezione', 'pt' => 'Dia da Imaculada Conceição', + 'sk' => 'Nepoškvrnené počatie Panny Márie', ]; diff --git a/src/Yasumi/data/translations/internationalWomensDay.php b/src/Yasumi/data/translations/internationalWomensDay.php old mode 100755 new mode 100644 index 6e3877d2b..0253029ca --- a/src/Yasumi/data/translations/internationalWomensDay.php +++ b/src/Yasumi/data/translations/internationalWomensDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/internationalWorkersDay.php b/src/Yasumi/data/translations/internationalWorkersDay.php old mode 100755 new mode 100644 index f4d4570cf..440ef32ae --- a/src/Yasumi/data/translations/internationalWorkersDay.php +++ b/src/Yasumi/data/translations/internationalWorkersDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/islanderDay.php b/src/Yasumi/data/translations/islanderDay.php index b1272dded..845ead8ea 100644 --- a/src/Yasumi/data/translations/islanderDay.php +++ b/src/Yasumi/data/translations/islanderDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/labourDay.php b/src/Yasumi/data/translations/labourDay.php index 463d1d724..5e4a895ca 100644 --- a/src/Yasumi/data/translations/labourDay.php +++ b/src/Yasumi/data/translations/labourDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,10 +17,10 @@ return [ 'en' => 'Labour Day', 'en_US' => 'Labor Day', + 'fr' => 'Fête du travail', 'ja' => '労働の日', 'ko' => '노동절', 'nl' => 'Dag van de arbeid', 'sk' => 'Sviatok práce', - 'fr' => 'Fête du travail', 'tr' => 'Emek ve Dayanışma Günü', ]; diff --git a/src/Yasumi/data/translations/louisRielDay.php b/src/Yasumi/data/translations/louisRielDay.php index 5f83e5efe..7f177b85f 100644 --- a/src/Yasumi/data/translations/louisRielDay.php +++ b/src/Yasumi/data/translations/louisRielDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/maundyThursday.php b/src/Yasumi/data/translations/maundyThursday.php index 0aaba02e0..87a7126f8 100644 --- a/src/Yasumi/data/translations/maundyThursday.php +++ b/src/Yasumi/data/translations/maundyThursday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/mothersDay.php b/src/Yasumi/data/translations/mothersDay.php old mode 100755 new mode 100644 index c31900f8a..5cdeaf0ab --- a/src/Yasumi/data/translations/mothersDay.php +++ b/src/Yasumi/data/translations/mothersDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/natalHoliday.php b/src/Yasumi/data/translations/natalHoliday.php index 26d4d6e44..62b0be3e0 100644 --- a/src/Yasumi/data/translations/natalHoliday.php +++ b/src/Yasumi/data/translations/natalHoliday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php b/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php index e2239f441..a70b2f5a6 100644 --- a/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php +++ b/src/Yasumi/data/translations/nationalIndigenousPeoplesDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/nationalPatriotsDay.php b/src/Yasumi/data/translations/nationalPatriotsDay.php index 08b5125e7..8380c887f 100644 --- a/src/Yasumi/data/translations/nationalPatriotsDay.php +++ b/src/Yasumi/data/translations/nationalPatriotsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/newYearsDay.php b/src/Yasumi/data/translations/newYearsDay.php old mode 100755 new mode 100644 index 06b8b01d1..19fe5303d --- a/src/Yasumi/data/translations/newYearsDay.php +++ b/src/Yasumi/data/translations/newYearsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,9 @@ 'es' => 'Año Nuevo', 'et' => 'Uusaasta', 'fi' => 'Uudenvuodenpäivä', + 'fr' => 'Jour de l’An', 'fr_BE' => 'Nouvel An', 'fr_CH' => 'Nouvel An', - 'fr' => 'Jour de l’An', 'ga' => 'Lá Caille', 'hr' => 'Nova godina', 'hu' => 'Újév', diff --git a/src/Yasumi/data/translations/newYearsEve.php b/src/Yasumi/data/translations/newYearsEve.php old mode 100755 new mode 100644 index a97f651f1..ffa26e04d --- a/src/Yasumi/data/translations/newYearsEve.php +++ b/src/Yasumi/data/translations/newYearsEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/novaScotiaHeritageDay.php b/src/Yasumi/data/translations/novaScotiaHeritageDay.php index 8337aae9d..b38e73e22 100644 --- a/src/Yasumi/data/translations/novaScotiaHeritageDay.php +++ b/src/Yasumi/data/translations/novaScotiaHeritageDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/orangemensDay.php b/src/Yasumi/data/translations/orangemensDay.php index 0aaa9ba4f..7807a25f3 100644 --- a/src/Yasumi/data/translations/orangemensDay.php +++ b/src/Yasumi/data/translations/orangemensDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/pentecost.php b/src/Yasumi/data/translations/pentecost.php old mode 100755 new mode 100644 index 68f82a76b..59cfa6494 --- a/src/Yasumi/data/translations/pentecost.php +++ b/src/Yasumi/data/translations/pentecost.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/pentecostMonday.php b/src/Yasumi/data/translations/pentecostMonday.php old mode 100755 new mode 100644 index de9076520..510732c59 --- a/src/Yasumi/data/translations/pentecostMonday.php +++ b/src/Yasumi/data/translations/pentecostMonday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/plebisciteDay.php b/src/Yasumi/data/translations/plebisciteDay.php index d68854288..72ee674ea 100644 --- a/src/Yasumi/data/translations/plebisciteDay.php +++ b/src/Yasumi/data/translations/plebisciteDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,6 +15,6 @@ // Translations for Plebiscite Day. return [ - 'en' => 'Plebiscite Day', 'de_AT' => 'Tag der Volksabstimmung', + 'en' => 'Plebiscite Day', ]; diff --git a/src/Yasumi/data/translations/portugalDay.php b/src/Yasumi/data/translations/portugalDay.php index 7b051a772..9e551091f 100644 --- a/src/Yasumi/data/translations/portugalDay.php +++ b/src/Yasumi/data/translations/portugalDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/portugueseRepublicDay.php b/src/Yasumi/data/translations/portugueseRepublicDay.php index da020ed5f..64ed8a018 100644 --- a/src/Yasumi/data/translations/portugueseRepublicDay.php +++ b/src/Yasumi/data/translations/portugueseRepublicDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/queensBirthday.php b/src/Yasumi/data/translations/queensBirthday.php index 6ebfea29e..0b12db053 100644 --- a/src/Yasumi/data/translations/queensBirthday.php +++ b/src/Yasumi/data/translations/queensBirthday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,7 +17,7 @@ return [ 'da' => 'Dronningens fødselsdag', 'en' => 'Queen’s Birthday', - 'pt' => 'Aniversário da Rainha', 'fr' => 'Anniversaire officiel de la reine', + 'pt' => 'Aniversário da Rainha', 'ru' => 'Официальный день рождения королевы', ]; diff --git a/src/Yasumi/data/translations/reformationDay.php b/src/Yasumi/data/translations/reformationDay.php old mode 100755 new mode 100644 index c519914d6..b08ab7051 --- a/src/Yasumi/data/translations/reformationDay.php +++ b/src/Yasumi/data/translations/reformationDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/remembranceDay.php b/src/Yasumi/data/translations/remembranceDay.php index 3930a26e2..603d5ca1a 100644 --- a/src/Yasumi/data/translations/remembranceDay.php +++ b/src/Yasumi/data/translations/remembranceDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/restorationOfIndepence.php b/src/Yasumi/data/translations/restorationOfIndepence.php index 201f52a41..17b950daa 100644 --- a/src/Yasumi/data/translations/restorationOfIndepence.php +++ b/src/Yasumi/data/translations/restorationOfIndepence.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/saintJeanBaptisteDay.php b/src/Yasumi/data/translations/saintJeanBaptisteDay.php index feace1968..caf57aed6 100644 --- a/src/Yasumi/data/translations/saintJeanBaptisteDay.php +++ b/src/Yasumi/data/translations/saintJeanBaptisteDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/saskatchewanDay.php b/src/Yasumi/data/translations/saskatchewanDay.php index 2c87d8d07..ab815a9bd 100644 --- a/src/Yasumi/data/translations/saskatchewanDay.php +++ b/src/Yasumi/data/translations/saskatchewanDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/secondChristmasDay.php b/src/Yasumi/data/translations/secondChristmasDay.php old mode 100755 new mode 100644 index c50e45a52..97791fb7e --- a/src/Yasumi/data/translations/secondChristmasDay.php +++ b/src/Yasumi/data/translations/secondChristmasDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/secondNewYearsDay.php b/src/Yasumi/data/translations/secondNewYearsDay.php old mode 100755 new mode 100644 index f00823db4..1c3eb0886 --- a/src/Yasumi/data/translations/secondNewYearsDay.php +++ b/src/Yasumi/data/translations/secondNewYearsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stAndrewsDay.php b/src/Yasumi/data/translations/stAndrewsDay.php index 7560cb172..36feff42e 100644 --- a/src/Yasumi/data/translations/stAndrewsDay.php +++ b/src/Yasumi/data/translations/stAndrewsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stDavidsDay.php b/src/Yasumi/data/translations/stDavidsDay.php index 5dda220ab..404b5f9a3 100644 --- a/src/Yasumi/data/translations/stDavidsDay.php +++ b/src/Yasumi/data/translations/stDavidsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stFloriansDay.php b/src/Yasumi/data/translations/stFloriansDay.php index f9894e014..81763baad 100644 --- a/src/Yasumi/data/translations/stFloriansDay.php +++ b/src/Yasumi/data/translations/stFloriansDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,6 +15,6 @@ // Translations for Saint Florian's Day. return [ - 'en' => 'Saint Florian’s Day', 'de_AT' => 'Florian', + 'en' => 'Saint Florian’s Day', ]; diff --git a/src/Yasumi/data/translations/stGeorgesDay.php b/src/Yasumi/data/translations/stGeorgesDay.php index 7f350fe63..9adcf0a60 100644 --- a/src/Yasumi/data/translations/stGeorgesDay.php +++ b/src/Yasumi/data/translations/stGeorgesDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stJohnsDay.php b/src/Yasumi/data/translations/stJohnsDay.php index bd2529110..31ca479de 100644 --- a/src/Yasumi/data/translations/stJohnsDay.php +++ b/src/Yasumi/data/translations/stJohnsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stJohnsEve.php b/src/Yasumi/data/translations/stJohnsEve.php index 17a81e175..6f3bda582 100644 --- a/src/Yasumi/data/translations/stJohnsEve.php +++ b/src/Yasumi/data/translations/stJohnsEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stJosephsDay.php b/src/Yasumi/data/translations/stJosephsDay.php index cb9cfb86b..45831614b 100644 --- a/src/Yasumi/data/translations/stJosephsDay.php +++ b/src/Yasumi/data/translations/stJosephsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/stLeopoldsDay.php b/src/Yasumi/data/translations/stLeopoldsDay.php index aa7cfc990..f8f619c4c 100644 --- a/src/Yasumi/data/translations/stLeopoldsDay.php +++ b/src/Yasumi/data/translations/stLeopoldsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,6 +15,6 @@ // Translations for Saint Leopold's Day. return [ - 'en' => 'Saint Leopold’s Day', 'de_AT' => 'Leopold', + 'en' => 'Saint Leopold’s Day', ]; diff --git a/src/Yasumi/data/translations/stMartinsDay.php b/src/Yasumi/data/translations/stMartinsDay.php index 3113bf9ec..68d9a8446 100644 --- a/src/Yasumi/data/translations/stMartinsDay.php +++ b/src/Yasumi/data/translations/stMartinsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,7 @@ // Translations for St. Martin's Day return [ + 'de_AT' => 'Martin', 'en' => 'St. Martin’s Day', 'nl' => 'Sint Maarten', - 'de_AT' => 'Martin', ]; diff --git a/src/Yasumi/data/translations/stRupertsDay.php b/src/Yasumi/data/translations/stRupertsDay.php index 35ad9d318..fe2361488 100644 --- a/src/Yasumi/data/translations/stRupertsDay.php +++ b/src/Yasumi/data/translations/stRupertsDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,6 +15,6 @@ // Translations for Saint Rupert's Day. return [ - 'en' => 'Saint Rupert’s Day', 'de_AT' => 'Rupert', + 'en' => 'Saint Rupert’s Day', ]; diff --git a/src/Yasumi/data/translations/stStephensDay.php b/src/Yasumi/data/translations/stStephensDay.php index be482d8bd..433239c32 100644 --- a/src/Yasumi/data/translations/stStephensDay.php +++ b/src/Yasumi/data/translations/stStephensDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/substituteHoliday.php b/src/Yasumi/data/translations/substituteHoliday.php old mode 100755 new mode 100644 index 38a59906e..310b2f179 --- a/src/Yasumi/data/translations/substituteHoliday.php +++ b/src/Yasumi/data/translations/substituteHoliday.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,8 +17,8 @@ return [ 'da' => '{0} (erstatning)', 'en' => '{0} (substitute day)', - 'en_US' => '{0} observed', 'en_CA' => '{0} observed', + 'en_US' => '{0} observed', 'ja' => '振替休日 ({0})', 'ko' => '대체공휴일', ]; diff --git a/src/Yasumi/data/translations/summerTime.php b/src/Yasumi/data/translations/summerTime.php index 424b41433..0cb56a05e 100644 --- a/src/Yasumi/data/translations/summerTime.php +++ b/src/Yasumi/data/translations/summerTime.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/terryFoxDay.php b/src/Yasumi/data/translations/terryFoxDay.php index 94c0ea931..d01774eae 100644 --- a/src/Yasumi/data/translations/terryFoxDay.php +++ b/src/Yasumi/data/translations/terryFoxDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/thanksgivingDay.php b/src/Yasumi/data/translations/thanksgivingDay.php index f39c044c9..c2932e9b9 100644 --- a/src/Yasumi/data/translations/thanksgivingDay.php +++ b/src/Yasumi/data/translations/thanksgivingDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/truthAndReconciliationDay.php b/src/Yasumi/data/translations/truthAndReconciliationDay.php index 82d8c5ee3..3665d6a7b 100644 --- a/src/Yasumi/data/translations/truthAndReconciliationDay.php +++ b/src/Yasumi/data/translations/truthAndReconciliationDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/valentinesDay.php b/src/Yasumi/data/translations/valentinesDay.php index ec4923620..618e35be1 100644 --- a/src/Yasumi/data/translations/valentinesDay.php +++ b/src/Yasumi/data/translations/valentinesDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/victoriaDay.php b/src/Yasumi/data/translations/victoriaDay.php index 2907f0216..deb5de5f9 100644 --- a/src/Yasumi/data/translations/victoriaDay.php +++ b/src/Yasumi/data/translations/victoriaDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/victoryInEuropeDay.php b/src/Yasumi/data/translations/victoryInEuropeDay.php index 3c25cd75b..ddbd19c33 100644 --- a/src/Yasumi/data/translations/victoryInEuropeDay.php +++ b/src/Yasumi/data/translations/victoryInEuropeDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/waitangiDay.php b/src/Yasumi/data/translations/waitangiDay.php index 7065860e2..750e32f22 100644 --- a/src/Yasumi/data/translations/waitangiDay.php +++ b/src/Yasumi/data/translations/waitangiDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/walpurgisEve.php b/src/Yasumi/data/translations/walpurgisEve.php old mode 100755 new mode 100644 index cb2dab29c..6a0bd8d19 --- a/src/Yasumi/data/translations/walpurgisEve.php +++ b/src/Yasumi/data/translations/walpurgisEve.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/winterTime.php b/src/Yasumi/data/translations/winterTime.php index 08d0a6f9e..18b9e1026 100644 --- a/src/Yasumi/data/translations/winterTime.php +++ b/src/Yasumi/data/translations/winterTime.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/worldAnimalDay.php b/src/Yasumi/data/translations/worldAnimalDay.php index f4cb470a3..348a44098 100644 --- a/src/Yasumi/data/translations/worldAnimalDay.php +++ b/src/Yasumi/data/translations/worldAnimalDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Yasumi/data/translations/yukonHeritageDay.php b/src/Yasumi/data/translations/yukonHeritageDay.php index 8047be763..b1699d043 100644 --- a/src/Yasumi/data/translations/yukonHeritageDay.php +++ b/src/Yasumi/data/translations/yukonHeritageDay.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Argentina/ArgentinaBaseTestCase.php b/tests/Argentina/ArgentinaBaseTestCase.php index b16a4f955..88a893bc6 100644 --- a/tests/Argentina/ArgentinaBaseTestCase.php +++ b/tests/Argentina/ArgentinaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Argentina/ArgentinaTest.php b/tests/Argentina/ArgentinaTest.php index 0f66d092a..c929a545a 100644 --- a/tests/Argentina/ArgentinaTest.php +++ b/tests/Argentina/ArgentinaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Argentina; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Argentina; use Yasumi\tests\ProviderTestCase; @@ -31,6 +30,8 @@ class ArgentinaTest extends ArgentinaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -39,22 +40,17 @@ protected function setUp(): void /** * Tests if all official holidays in Argentina are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { $holidays = [ 'newYearsDay', 'internationalWorkersDay', - 'remembranceDay', - 'malvinasDay', 'mayRevolution', 'generalMartinMigueldeGuemesDay', 'flagDay', 'generalJoseSanMartinDay', 'raceDay', - 'nationalSovereigntyDay', 'immaculateConceptionDay', 'christmasDay', ]; @@ -63,13 +59,23 @@ public function testOfficialHolidays(): void $holidays[] = 'independenceDay'; } + if ($this->year >= 2006) { + $holidays[] = 'remembranceDay'; + } + + if ($this->year >= 2010) { + $holidays[] = 'nationalSovereigntyDay'; + } + + if ($this->year >= 1982) { + $holidays[] = 'malvinasDay'; + } + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Argentina are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,9 +87,7 @@ public function testObservedHolidays(): void ], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } - /** - * @throws ReflectionException - */ + /** @throws \Exception */ public function testSources(): void { $this->assertSources(self::REGION, 1); diff --git a/tests/Argentina/CarnavalMondayTest.php b/tests/Argentina/CarnavalMondayTest.php index d8b1aad25..e49280d6a 100644 --- a/tests/Argentina/CarnavalMondayTest.php +++ b/tests/Argentina/CarnavalMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -41,8 +38,7 @@ class CarnavalMondayTest extends ArgentinaBaseTestCase implements HolidayTestCas /** * Tests Carnaval Monday on or after 1700. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalMondayAfter1700(): void { @@ -51,14 +47,14 @@ public function testCarnavalMondayAfter1700(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P48D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P48D')) ); } /** * Tests Carnaval Monday on or before 1700. * - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalMondayBefore1700(): void { @@ -69,7 +65,7 @@ public function testCarnavalMondayBefore1700(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -80,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/CarnavalTuesdayTest.php b/tests/Argentina/CarnavalTuesdayTest.php index d510bf5ec..4be661a23 100644 --- a/tests/Argentina/CarnavalTuesdayTest.php +++ b/tests/Argentina/CarnavalTuesdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -41,8 +38,7 @@ class CarnavalTuesdayTest extends ArgentinaBaseTestCase implements HolidayTestCa /** * Tests Carnaval Tuesday on or after 1700. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalTuesdayAfter1700(): void { @@ -51,14 +47,14 @@ public function testCarnavalTuesdayAfter1700(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P47D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P47D')) ); } /** * Tests Carnaval Tuesday on or before 1700. * - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalTuesdayBefore1700(): void { @@ -69,7 +65,7 @@ public function testCarnavalTuesdayBefore1700(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -80,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/ChristmasDayTest.php b/tests/Argentina/ChristmasDayTest.php index 2d120a733..682a5846c 100644 --- a/tests/Argentina/ChristmasDayTest.php +++ b/tests/Argentina/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class ChristmasDayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests Christmas Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDay(): void { @@ -44,14 +39,14 @@ public function testChristmasDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/EasterTest.php b/tests/Argentina/EasterTest.php index 67c0cea68..5e5a478ed 100644 --- a/tests/Argentina/EasterTest.php +++ b/tests/Argentina/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Argentina; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -35,8 +33,7 @@ class EasterTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests Easter. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEaster(): void { @@ -47,7 +44,7 @@ public function testEaster(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -62,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/FlagDayTest.php b/tests/Argentina/FlagDayTest.php index 65f4a0afd..bb24046bf 100644 --- a/tests/Argentina/FlagDayTest.php +++ b/tests/Argentina/FlagDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class FlagDayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-06-20", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-06-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Paso a la Inmortalidad del General Manuel Belgrano'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Paso a la Inmortalidad del General Manuel Belgrano'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/GeneralJoseSanMartinDayTest.php b/tests/Argentina/GeneralJoseSanMartinDayTest.php index 458afa5d1..5302b4064 100644 --- a/tests/Argentina/GeneralJoseSanMartinDayTest.php +++ b/tests/Argentina/GeneralJoseSanMartinDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class GeneralJoseSanMartinDayTest extends ArgentinaBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-08-17", new DateTimeZone(self::TIMEZONE)) - ); + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-08-17", new \DateTimeZone(self::TIMEZONE)) + ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Paso a la Inmortalidad del General José de San Martín'] - ); + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Paso a la Inmortalidad del General José de San Martín'] + ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/GeneralMartinMigueldeGuemesDayTest.php b/tests/Argentina/GeneralMartinMigueldeGuemesDayTest.php index 648eaa108..2053d4fb3 100644 --- a/tests/Argentina/GeneralMartinMigueldeGuemesDayTest.php +++ b/tests/Argentina/GeneralMartinMigueldeGuemesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class GeneralMartinMigueldeGuemesDayTest extends ArgentinaBaseTestCase implement /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-06-17", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-06-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Paso a la Inmortalidad del General Martín Miguel de Güemes'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Paso a la Inmortalidad del General Martín Miguel de Güemes'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/GoodFridayTest.php b/tests/Argentina/GoodFridayTest.php index 8c4f95eea..fc75276d1 100644 --- a/tests/Argentina/GoodFridayTest.php +++ b/tests/Argentina/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class GoodFridayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests Good Friday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testGoodFriday(): void { @@ -46,14 +42,14 @@ public function testGoodFriday(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P2D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P2D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/ImmaculateConceptionDayTest.php b/tests/Argentina/ImmaculateConceptionDayTest.php index ce495970d..8f9a88982 100644 --- a/tests/Argentina/ImmaculateConceptionDayTest.php +++ b/tests/Argentina/ImmaculateConceptionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class ImmaculateConceptionDayTest extends ArgentinaBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-12-08", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-12-08", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Día de la Inmaculada Concepción de María'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Día de la Inmaculada Concepción de María'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/IndependenceDayTest.php b/tests/Argentina/IndependenceDayTest.php index 7a4a375f6..f162c6559 100644 --- a/tests/Argentina/IndependenceDayTest.php +++ b/tests/Argentina/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class IndependenceDayTest extends ArgentinaBaseTestCase implements HolidayTestCa /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-07-09", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-07-09", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Día de la Independencia'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Día de la Independencia'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/InternationalWorkersDayTest.php b/tests/Argentina/InternationalWorkersDayTest.php index 346ab0438..8f8f8c49a 100644 --- a/tests/Argentina/InternationalWorkersDayTest.php +++ b/tests/Argentina/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class InternationalWorkersDayTest extends ArgentinaBaseTestCase implements Holid /** * Tests International Workers' Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testInternationalWorkersDay(): void { @@ -44,14 +39,14 @@ public function testInternationalWorkersDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/MalvinasDayTest.php b/tests/Argentina/MalvinasDayTest.php index af91840c6..0407f55a2 100644 --- a/tests/Argentina/MalvinasDayTest.php +++ b/tests/Argentina/MalvinasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MalvinasDayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-02", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-02", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,7 +59,7 @@ public function testNotHoliday(): void /** * Tests translated name of Malvinas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -81,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/MayRevolutionTest.php b/tests/Argentina/MayRevolutionTest.php index e5e7bd335..643be3167 100644 --- a/tests/Argentina/MayRevolutionTest.php +++ b/tests/Argentina/MayRevolutionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class MayRevolutionTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-05-25", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-05-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of First National Government. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Día de la Revolución de Mayo'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Día de la Revolución de Mayo'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/NationalSovereigntyDayTest.php b/tests/Argentina/NationalSovereigntyDayTest.php index e55e04acb..dc62052d3 100644 --- a/tests/Argentina/NationalSovereigntyDayTest.php +++ b/tests/Argentina/NationalSovereigntyDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,15 +14,11 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; /** - * Class for testing Corpus Christi in Argentina. + * Class for testing National Sovereignty Day in Argentina. */ class NationalSovereigntyDayTest extends ArgentinaBaseTestCase implements HolidayTestCase { @@ -39,24 +35,21 @@ class NationalSovereigntyDayTest extends ArgentinaBaseTestCase implements Holida /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-11-20", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-11-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Día de la Soberanía Nacional'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Día de la Soberanía Nacional'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/NewYearsDayTest.php b/tests/Argentina/NewYearsDayTest.php index 5a7e1f11f..56dde2f09 100644 --- a/tests/Argentina/NewYearsDayTest.php +++ b/tests/Argentina/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class NewYearsDayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests New Years Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDay(): void { @@ -44,14 +39,14 @@ public function testNewYearsDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/RaceDayTest.php b/tests/Argentina/RaceDayTest.php index 389278ec1..f8bf09d75 100644 --- a/tests/Argentina/RaceDayTest.php +++ b/tests/Argentina/RaceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,24 +35,21 @@ class RaceDayTest extends ArgentinaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = self::ESTABLISHMENT_YEAR; $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("$year-10-12", new DateTimeZone(self::TIMEZONE)) + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-10-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -66,22 +59,22 @@ public function testNotHoliday(): void /** * Tests translated name of the holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), - [self::LOCALE => 'Día del Respeto a la Diversidad Cultural'] + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + [self::LOCALE => 'Día del Respeto a la Diversidad Cultural'] ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Argentina/RemembranceDayTest.php b/tests/Argentina/RemembranceDayTest.php index 83a88f75b..f98b63aa6 100644 --- a/tests/Argentina/RemembranceDayTest.php +++ b/tests/Argentina/RemembranceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Argentina; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class RemembranceDayTest extends ArgentinaBaseTestCase implements HolidayTestCas /** * Tests Day of Remembrance for Truth and Justice on or after 2006. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRemembranceDayAfter2006(): void { @@ -49,14 +44,14 @@ public function testRemembranceDayAfter2006(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-03-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-03-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Day of Remembrance for Truth and Justice on or before 2006. * - * @throws ReflectionException + * @throws \Exception */ public function testRemembranceDayBefore2006(): void { @@ -67,7 +62,7 @@ public function testRemembranceDayBefore2006(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AnzacDayTest.php b/tests/Australia/AnzacDayTest.php index 48bcd652e..b6e9d56cd 100644 --- a/tests/Australia/AnzacDayTest.php +++ b/tests/Australia/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class AnzacDayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,12 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Tests that ANZAC Day is not present before 1921. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -70,7 +63,7 @@ public function testNotHoliday(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -93,7 +86,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +101,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustraliaBaseTestCase.php b/tests/Australia/AustraliaBaseTestCase.php index 6014afaff..d8d71d487 100644 --- a/tests/Australia/AustraliaBaseTestCase.php +++ b/tests/Australia/AustraliaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustraliaDayTest.php b/tests/Australia/AustraliaDayTest.php index 09ab06f8a..00cf76ef4 100644 --- a/tests/Australia/AustraliaDayTest.php +++ b/tests/Australia/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -36,12 +32,10 @@ class AustraliaDayTest extends AustraliaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday($this->region, self::HOLIDAY, $year, $expected); } @@ -54,8 +48,7 @@ public function testHoliday(int $year, DateTime $expected): void * @param int $year the year for which the holiday defined in this test needs to be tested * @param ?string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testSubstituteHoliday(int $year, ?string $expected): void { @@ -64,7 +57,7 @@ public function testSubstituteHoliday(int $year, ?string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } else { $this->assertNotSubstituteHoliday( @@ -78,7 +71,7 @@ public function testSubstituteHoliday(int $year, ?string $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -103,9 +96,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -115,7 +108,7 @@ public function HolidayDataProvider(): array /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function SubstituteHolidayDataProvider(): array { diff --git a/tests/Australia/AustraliaTest.php b/tests/Australia/AustraliaTest.php index 22a614269..97222150e 100644 --- a/tests/Australia/AustraliaTest.php +++ b/tests/Australia/AustraliaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class AustraliaTest extends AustraliaBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Australia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -51,13 +50,17 @@ public function testOfficialHolidays(): void 'secondChristmasDay', 'australiaDay', 'anzacDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Australia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -66,8 +69,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Australia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -76,8 +77,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Australia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -86,8 +85,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Australia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -95,7 +92,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php b/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php index 03fec759a..abca7984e 100644 --- a/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php b/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php index e98702942..5a4a07e39 100644 --- a/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php index 426469d11..e4f3732e9 100644 --- a/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php +++ b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php index 2d48c95b0..e8447369e 100644 --- a/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php +++ b/tests/Australia/AustralianCapitalTerritory/AustralianCapitalTerritoryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class AustralianCapitalTerritoryTest extends AustralianCapitalTerritoryBaseTestC /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Australian Capital Territory (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -57,11 +56,18 @@ public function testOfficialHolidays(): void 'labourDay', 'canberraDay', 'reconciliationDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php b/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php index 40467e37d..2a22717d7 100644 --- a/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php index 1d997a368..6f650f9ce 100644 --- a/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/CanberraDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class CanberraDayTest extends AustralianCapitalTerritoryBaseTestCase implements * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php b/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php index 368ac3cef..6d848d71c 100644 --- a/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php index 40e742962..f97c1c168 100644 --- a/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php index 26ca10416..9a240607d 100644 --- a/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSaturdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterSaturdayTest extends AustralianCapitalTerritoryBaseTestCase implemen * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php index fb73a78d9..4a4831268 100644 --- a/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/EasterSundayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EasterSundayTest extends AustralianCapitalTerritoryBaseTestCase implements * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -91,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php b/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php index 9b65da7b6..9ae17b093 100644 --- a/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php index 9bdd92a33..8d1c4c102 100644 --- a/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends AustralianCapitalTerritoryBaseTestCase implements Ho * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/NationalDayOfMourningTest.php b/tests/Australia/AustralianCapitalTerritory/NationalDayOfMourningTest.php new file mode 100644 index 000000000..f1d186efd --- /dev/null +++ b/tests/Australia/AustralianCapitalTerritory/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\AustralianCapitalTerritory; + +/** + * Class for testing National Day of Mourning in Australian Capital Territory (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php b/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php index 7ded580ec..aa741f372 100644 --- a/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php index f946e0c25..58f3e94b2 100644 --- a/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends AustralianCapitalTerritoryBaseTestCase implemen * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php index 0b78f2ba2..c901de5f6 100644 --- a/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php +++ b/tests/Australia/AustralianCapitalTerritory/ReconciliationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\AustralianCapitalTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class ReconciliationDayTest extends AustralianCapitalTerritoryBaseTestCase imple * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -84,7 +79,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -99,7 +94,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/BoxingDayTest.php b/tests/Australia/BoxingDayTest.php index b04ed1771..6e6c8fc25 100644 --- a/tests/Australia/BoxingDayTest.php +++ b/tests/Australia/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class BoxingDayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param string $expected the expected date * @param ?string $expectedExtra the expected date for the additional holiday, or null if no additional holiday * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected, ?string $expectedExtra): void { @@ -50,7 +45,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); if (null === $expectedExtra) { $this->assertNotHoliday( @@ -63,7 +58,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY2, $year, - new DateTime($expectedExtra, new DateTimeZone($this->timezone)) + new \DateTime($expectedExtra, new \DateTimeZone($this->timezone)) ); } } @@ -71,7 +66,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -93,7 +88,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -114,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/ChristmasDayTest.php b/tests/Australia/ChristmasDayTest.php index b5543624d..97a39d7a7 100644 --- a/tests/Australia/ChristmasDayTest.php +++ b/tests/Australia/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class ChristmasDayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param string $expected the expected date * @param ?string $expectedExtra the expected date for the additional holiday, or null if no additional holiday * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected, ?string $expectedExtra): void { @@ -50,7 +45,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); if (null === $expectedExtra) { $this->assertNotHoliday( @@ -63,7 +58,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY2, $year, - new DateTime($expectedExtra, new DateTimeZone($this->timezone)) + new \DateTime($expectedExtra, new \DateTimeZone($this->timezone)) ); } } @@ -71,7 +66,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -93,7 +88,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -114,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/EasterMondayTest.php b/tests/Australia/EasterMondayTest.php index cb915f5f3..71fb3ace2 100644 --- a/tests/Australia/EasterMondayTest.php +++ b/tests/Australia/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +36,7 @@ class EasterMondayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -50,7 +44,7 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } @@ -62,8 +56,7 @@ public function testHoliday(int $year, string $expected): void * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday2(int $year, string $expected): void { @@ -71,16 +64,16 @@ public function testHoliday2(int $year, string $expected): void $this->region, self::HOLIDAY2, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -89,7 +82,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -100,7 +93,7 @@ public function HolidayDataProvider(): array /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider2(): array { @@ -115,7 +108,7 @@ public function HolidayDataProvider2(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -136,7 +129,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/GoodFridayTest.php b/tests/Australia/GoodFridayTest.php index fa61c14f9..a0e28fa50 100644 --- a/tests/Australia/GoodFridayTest.php +++ b/tests/Australia/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class GoodFridayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P2D')); + $date->sub(new \DateInterval('P2D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NationalDayOfMourningTest.php b/tests/Australia/NationalDayOfMourningTest.php new file mode 100644 index 000000000..4fa7ad989 --- /dev/null +++ b/tests/Australia/NationalDayOfMourningTest.php @@ -0,0 +1,108 @@ + + */ + +namespace Yasumi\tests\Australia; + +use Yasumi\Holiday; +use Yasumi\tests\HolidayTestCase; + +/** + * Class for testing National Day of Mourning in Australia. + */ +class NationalDayOfMourningTest extends AustraliaBaseTestCase implements HolidayTestCase +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'nationalDayOfMourning'; + + /** + * The year in which the holiday was first established. + */ + public const ACTIVE_YEAR = 2022; + + /** + * The date on which the holiday occurred. + */ + public const ACTIVE_DATE = '2022-9-22'; + + /** + * Tests the holiday defined in this test. + * + * @throws \Exception + */ + public function testHoliday(): void + { + $this->assertHoliday( + $this->region, + self::HOLIDAY, + self::ACTIVE_YEAR, + new \DateTime(self::ACTIVE_DATE, new \DateTimeZone($this->timezone)) + ); + } + + /** + * Tests the holiday defined in this test before the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayBeforeActive(): void + { + $this->assertNotHoliday( + $this->region, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ACTIVE_YEAR - 1) + ); + } + + /** + * Tests the holiday defined in this test after the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayAfterActive(): void + { + $this->assertNotHoliday( + $this->region, + self::HOLIDAY, + $this->generateRandomYear(self::ACTIVE_YEAR + 1) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + $this->region, + self::HOLIDAY, + self::ACTIVE_YEAR, + [self::LOCALE => 'National Day of Mourning'] + ); + } + + /** + * Tests type of the holiday defined in this test. + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + $this->region, + self::HOLIDAY, + self::ACTIVE_YEAR, + Holiday::TYPE_OFFICIAL + ); + } +} diff --git a/tests/Australia/NewSouthWales/AnzacDayTest.php b/tests/Australia/NewSouthWales/AnzacDayTest.php index a83c8b4c8..f8dfa1365 100644 --- a/tests/Australia/NewSouthWales/AnzacDayTest.php +++ b/tests/Australia/NewSouthWales/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/AustraliaDayTest.php b/tests/Australia/NewSouthWales/AustraliaDayTest.php index 26c4911da..200ccfbd9 100644 --- a/tests/Australia/NewSouthWales/AustraliaDayTest.php +++ b/tests/Australia/NewSouthWales/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/BankHolidayTest.php b/tests/Australia/NewSouthWales/BankHolidayTest.php index c88ce413f..5b012e71d 100644 --- a/tests/Australia/NewSouthWales/BankHolidayTest.php +++ b/tests/Australia/NewSouthWales/BankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class BankHolidayTest extends NewSouthWalesBaseTestCase implements HolidayTestCa * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NewSouthWales/BoxingDayTest.php b/tests/Australia/NewSouthWales/BoxingDayTest.php index e050951f3..1a29cc1c8 100644 --- a/tests/Australia/NewSouthWales/BoxingDayTest.php +++ b/tests/Australia/NewSouthWales/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/ChristmasDayTest.php b/tests/Australia/NewSouthWales/ChristmasDayTest.php index 4a75bdffc..5ec492625 100644 --- a/tests/Australia/NewSouthWales/ChristmasDayTest.php +++ b/tests/Australia/NewSouthWales/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/EasterMondayTest.php b/tests/Australia/NewSouthWales/EasterMondayTest.php index 4a1c44a62..553c2bdf3 100644 --- a/tests/Australia/NewSouthWales/EasterMondayTest.php +++ b/tests/Australia/NewSouthWales/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/EasterSaturdayTest.php b/tests/Australia/NewSouthWales/EasterSaturdayTest.php index 8886a4472..b8401e240 100644 --- a/tests/Australia/NewSouthWales/EasterSaturdayTest.php +++ b/tests/Australia/NewSouthWales/EasterSaturdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterSaturdayTest extends NewSouthWalesBaseTestCase implements HolidayTes * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NewSouthWales/EasterSundayTest.php b/tests/Australia/NewSouthWales/EasterSundayTest.php index bd73133ec..82ac42a2c 100644 --- a/tests/Australia/NewSouthWales/EasterSundayTest.php +++ b/tests/Australia/NewSouthWales/EasterSundayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EasterSundayTest extends NewSouthWalesBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -91,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NewSouthWales/GoodFridayTest.php b/tests/Australia/NewSouthWales/GoodFridayTest.php index 0eaa5e076..4d7e7e33a 100644 --- a/tests/Australia/NewSouthWales/GoodFridayTest.php +++ b/tests/Australia/NewSouthWales/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/LabourDayTest.php b/tests/Australia/NewSouthWales/LabourDayTest.php index 05951e516..6cd4fa341 100644 --- a/tests/Australia/NewSouthWales/LabourDayTest.php +++ b/tests/Australia/NewSouthWales/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends NewSouthWalesBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NewSouthWales/NationalDayOfMourningTest.php b/tests/Australia/NewSouthWales/NationalDayOfMourningTest.php new file mode 100644 index 000000000..8de51bfcf --- /dev/null +++ b/tests/Australia/NewSouthWales/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\NewSouthWales; + +/** + * Class for testing National Day of Mourning in New South Wales (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php b/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php index 25c474f14..3b58fbcce 100644 --- a/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php +++ b/tests/Australia/NewSouthWales/NewSouthWalesBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/NewSouthWalesTest.php b/tests/Australia/NewSouthWales/NewSouthWalesTest.php index cca33c8d9..4550e3393 100644 --- a/tests/Australia/NewSouthWales/NewSouthWalesTest.php +++ b/tests/Australia/NewSouthWales/NewSouthWalesTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NewSouthWalesTest extends NewSouthWalesBaseTestCase implements ProviderTes /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in New South Wales (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $holidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,13 +54,17 @@ public function testOfficialHolidays(): void 'easterSaturday', 'queensBirthday', 'labourDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if (2022 == $this->year) { + $holidays[] = 'nationalDayOfMourning'; + } + + $this->assertDefinedHolidays($holidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all bank holidays in New South Wales (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -71,7 +74,8 @@ public function testBankHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/NewSouthWales/NewYearsDayTest.php b/tests/Australia/NewSouthWales/NewYearsDayTest.php index 90d948180..d46414d06 100644 --- a/tests/Australia/NewSouthWales/NewYearsDayTest.php +++ b/tests/Australia/NewSouthWales/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NewSouthWales/QueensBirthdayTest.php b/tests/Australia/NewSouthWales/QueensBirthdayTest.php index bbcf37040..9f3d968ce 100644 --- a/tests/Australia/NewSouthWales/QueensBirthdayTest.php +++ b/tests/Australia/NewSouthWales/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NewSouthWales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends NewSouthWalesBaseTestCase implements HolidayTes * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NewYearsDayTest.php b/tests/Australia/NewYearsDayTest.php index 4e1178d95..bd4943db2 100644 --- a/tests/Australia/NewYearsDayTest.php +++ b/tests/Australia/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class NewYearsDayTest extends AustraliaBaseTestCase implements HolidayTestCase * @param string $expected the expected date * @param ?string $expectedExtra the expected date for the additional holiday, or null if no additional holiday * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected, ?string $expectedExtra): void { @@ -50,7 +45,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); if (null === $expectedExtra) { $this->assertNotHoliday( @@ -63,7 +58,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY2, $year, - new DateTime($expectedExtra, new DateTimeZone($this->timezone)) + new \DateTime($expectedExtra, new \DateTimeZone($this->timezone)) ); } } @@ -71,7 +66,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -93,7 +88,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -114,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NorthernTerritory/AnzacDayTest.php b/tests/Australia/NorthernTerritory/AnzacDayTest.php index c4d6623ae..929843950 100644 --- a/tests/Australia/NorthernTerritory/AnzacDayTest.php +++ b/tests/Australia/NorthernTerritory/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/AustraliaDayTest.php b/tests/Australia/NorthernTerritory/AustraliaDayTest.php index ce7d44f17..fab4f19a3 100644 --- a/tests/Australia/NorthernTerritory/AustraliaDayTest.php +++ b/tests/Australia/NorthernTerritory/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/BoxingDayTest.php b/tests/Australia/NorthernTerritory/BoxingDayTest.php index a6e349ad8..ba823fa1f 100644 --- a/tests/Australia/NorthernTerritory/BoxingDayTest.php +++ b/tests/Australia/NorthernTerritory/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/ChristmasDayTest.php b/tests/Australia/NorthernTerritory/ChristmasDayTest.php index 159f50e85..6e7aa8b89 100644 --- a/tests/Australia/NorthernTerritory/ChristmasDayTest.php +++ b/tests/Australia/NorthernTerritory/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/EasterMondayTest.php b/tests/Australia/NorthernTerritory/EasterMondayTest.php index f525e67db..48185b919 100644 --- a/tests/Australia/NorthernTerritory/EasterMondayTest.php +++ b/tests/Australia/NorthernTerritory/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/EasterSaturdayTest.php b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php index 9e9714a3e..bc11ec528 100644 --- a/tests/Australia/NorthernTerritory/EasterSaturdayTest.php +++ b/tests/Australia/NorthernTerritory/EasterSaturdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia\NorthernTerritory; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterSaturdayTest extends NorthernTerritoryBaseTestCase implements Holida * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NorthernTerritory/GoodFridayTest.php b/tests/Australia/NorthernTerritory/GoodFridayTest.php index 7724cd26a..bb6250b20 100644 --- a/tests/Australia/NorthernTerritory/GoodFridayTest.php +++ b/tests/Australia/NorthernTerritory/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/MayDayTest.php b/tests/Australia/NorthernTerritory/MayDayTest.php index ebabeaf41..7778eb470 100644 --- a/tests/Australia/NorthernTerritory/MayDayTest.php +++ b/tests/Australia/NorthernTerritory/MayDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NorthernTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayTest extends NorthernTerritoryBaseTestCase implements HolidayTestCas * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NorthernTerritory/NationalDayOfMourningTest.php b/tests/Australia/NorthernTerritory/NationalDayOfMourningTest.php new file mode 100644 index 000000000..6e2f3fb5e --- /dev/null +++ b/tests/Australia/NorthernTerritory/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\NorthernTerritory; + +/** + * Class for testing National Day of Mourning in Northern Territory (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/NorthernTerritory/NewYearsDayTest.php b/tests/Australia/NorthernTerritory/NewYearsDayTest.php index 796f0a26e..f57d98c9d 100644 --- a/tests/Australia/NorthernTerritory/NewYearsDayTest.php +++ b/tests/Australia/NorthernTerritory/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php b/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php index e51836e36..d1c6b41e6 100644 --- a/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php +++ b/tests/Australia/NorthernTerritory/NorthernTerritoryBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php b/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php index 6b7a51150..751f043dc 100644 --- a/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php +++ b/tests/Australia/NorthernTerritory/NorthernTerritoryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\NorthernTerritory; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NorthernTerritoryTest extends NorthernTerritoryBaseTestCase implements Pro /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Northern Territory (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,18 @@ public function testOfficialHolidays(): void 'queensBirthday', 'mayDay', 'picnicDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/NorthernTerritory/PicnicDayTest.php b/tests/Australia/NorthernTerritory/PicnicDayTest.php index 6ba24c77c..8c1ffb2ae 100644 --- a/tests/Australia/NorthernTerritory/PicnicDayTest.php +++ b/tests/Australia/NorthernTerritory/PicnicDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NorthernTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PicnicDayTest extends NorthernTerritoryBaseTestCase implements HolidayTest * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/NorthernTerritory/QueensBirthdayTest.php b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php index e83294147..c445b8e71 100644 --- a/tests/Australia/NorthernTerritory/QueensBirthdayTest.php +++ b/tests/Australia/NorthernTerritory/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\NorthernTerritory; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends NorthernTerritoryBaseTestCase implements Holida * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Queensland/AnzacDayTest.php b/tests/Australia/Queensland/AnzacDayTest.php index ef267915a..8bec56d16 100644 --- a/tests/Australia/Queensland/AnzacDayTest.php +++ b/tests/Australia/Queensland/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/AustraliaDayTest.php b/tests/Australia/Queensland/AustraliaDayTest.php index 42fea23fb..e61d6909a 100644 --- a/tests/Australia/Queensland/AustraliaDayTest.php +++ b/tests/Australia/Queensland/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/BoxingDayTest.php b/tests/Australia/Queensland/BoxingDayTest.php index be3eb0b47..021840caf 100644 --- a/tests/Australia/Queensland/BoxingDayTest.php +++ b/tests/Australia/Queensland/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/AnzacDayTest.php b/tests/Australia/Queensland/Brisbane/AnzacDayTest.php index 5c2cfc3c8..c872c384d 100644 --- a/tests/Australia/Queensland/Brisbane/AnzacDayTest.php +++ b/tests/Australia/Queensland/Brisbane/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/AustraliaDayTest.php b/tests/Australia/Queensland/Brisbane/AustraliaDayTest.php index b8785798e..90eef3a3d 100644 --- a/tests/Australia/Queensland/Brisbane/AustraliaDayTest.php +++ b/tests/Australia/Queensland/Brisbane/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/BoxingDayTest.php b/tests/Australia/Queensland/Brisbane/BoxingDayTest.php index 1bfe2183b..a6559a828 100644 --- a/tests/Australia/Queensland/Brisbane/BoxingDayTest.php +++ b/tests/Australia/Queensland/Brisbane/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/BrisbaneBaseTestCase.php b/tests/Australia/Queensland/Brisbane/BrisbaneBaseTestCase.php index b8b898491..ec4dfc62c 100644 --- a/tests/Australia/Queensland/Brisbane/BrisbaneBaseTestCase.php +++ b/tests/Australia/Queensland/Brisbane/BrisbaneBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/BrisbaneTest.php b/tests/Australia/Queensland/Brisbane/BrisbaneTest.php index 6982e325d..b7c80e366 100644 --- a/tests/Australia/Queensland/Brisbane/BrisbaneTest.php +++ b/tests/Australia/Queensland/Brisbane/BrisbaneTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Queensland\Brisbane; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class BrisbaneTest extends BrisbaneBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Queensland (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -54,11 +53,16 @@ public function testOfficialHolidays(): void 'queensBirthday', 'labourDay', 'peoplesDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Queensland/Brisbane/ChristmasDayTest.php b/tests/Australia/Queensland/Brisbane/ChristmasDayTest.php index 281c4b809..52db481fe 100644 --- a/tests/Australia/Queensland/Brisbane/ChristmasDayTest.php +++ b/tests/Australia/Queensland/Brisbane/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/EasterMondayTest.php b/tests/Australia/Queensland/Brisbane/EasterMondayTest.php index 583df40dc..b1fefca8f 100644 --- a/tests/Australia/Queensland/Brisbane/EasterMondayTest.php +++ b/tests/Australia/Queensland/Brisbane/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/GoodFridayTest.php b/tests/Australia/Queensland/Brisbane/GoodFridayTest.php index 78794364f..4e4381937 100644 --- a/tests/Australia/Queensland/Brisbane/GoodFridayTest.php +++ b/tests/Australia/Queensland/Brisbane/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/LabourDayTest.php b/tests/Australia/Queensland/Brisbane/LabourDayTest.php index 6a25e7377..94f9558b1 100644 --- a/tests/Australia/Queensland/Brisbane/LabourDayTest.php +++ b/tests/Australia/Queensland/Brisbane/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/NationalDayOfMourningTest.php b/tests/Australia/Queensland/Brisbane/NationalDayOfMourningTest.php new file mode 100644 index 000000000..609bc2789 --- /dev/null +++ b/tests/Australia/Queensland/Brisbane/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Queensland\Brisbane; + +/** + * Class for testing National Day of Mourning in Brisbane (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Queensland\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Queensland/Brisbane/NewYearsDayTest.php b/tests/Australia/Queensland/Brisbane/NewYearsDayTest.php index dbeee22c0..334598f83 100644 --- a/tests/Australia/Queensland/Brisbane/NewYearsDayTest.php +++ b/tests/Australia/Queensland/Brisbane/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php index fa82eb1bf..fa91a8213 100644 --- a/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php +++ b/tests/Australia/Queensland/Brisbane/PeoplesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Queensland\Brisbane; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PeoplesDayTest extends BrisbaneBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Queensland/Brisbane/QueensBirthdayTest.php b/tests/Australia/Queensland/Brisbane/QueensBirthdayTest.php index 6fdd889f3..bad0a6fff 100644 --- a/tests/Australia/Queensland/Brisbane/QueensBirthdayTest.php +++ b/tests/Australia/Queensland/Brisbane/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/ChristmasDayTest.php b/tests/Australia/Queensland/ChristmasDayTest.php index 798ddbac5..7e7ce4b7d 100644 --- a/tests/Australia/Queensland/ChristmasDayTest.php +++ b/tests/Australia/Queensland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/EasterMondayTest.php b/tests/Australia/Queensland/EasterMondayTest.php index c6c6fac97..ebec7e644 100644 --- a/tests/Australia/Queensland/EasterMondayTest.php +++ b/tests/Australia/Queensland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/GoodFridayTest.php b/tests/Australia/Queensland/GoodFridayTest.php index fce0193bd..57babc079 100644 --- a/tests/Australia/Queensland/GoodFridayTest.php +++ b/tests/Australia/Queensland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/LabourDayTest.php b/tests/Australia/Queensland/LabourDayTest.php index 7fd6e0679..6ff94f108 100644 --- a/tests/Australia/Queensland/LabourDayTest.php +++ b/tests/Australia/Queensland/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Queensland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends QueenslandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Queensland/NationalDayOfMourningTest.php b/tests/Australia/Queensland/NationalDayOfMourningTest.php new file mode 100644 index 000000000..30fb89db5 --- /dev/null +++ b/tests/Australia/Queensland/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Queensland; + +/** + * Class for testing National Day of Mourning in Queensland (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Queensland/NewYearsDayTest.php b/tests/Australia/Queensland/NewYearsDayTest.php index 6e65a1c6e..b4486522f 100644 --- a/tests/Australia/Queensland/NewYearsDayTest.php +++ b/tests/Australia/Queensland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/QueensBirthdayTest.php b/tests/Australia/Queensland/QueensBirthdayTest.php index d1ee1f7b0..f91061cb6 100644 --- a/tests/Australia/Queensland/QueensBirthdayTest.php +++ b/tests/Australia/Queensland/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Queensland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends QueenslandBaseTestCase implements HolidayTestCa * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Queensland/QueenslandBaseTestCase.php b/tests/Australia/Queensland/QueenslandBaseTestCase.php index c4c509d8a..24f137e48 100644 --- a/tests/Australia/Queensland/QueenslandBaseTestCase.php +++ b/tests/Australia/Queensland/QueenslandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Queensland/QueenslandTest.php b/tests/Australia/Queensland/QueenslandTest.php index 8cc68abe3..e4ec59db2 100644 --- a/tests/Australia/Queensland/QueenslandTest.php +++ b/tests/Australia/Queensland/QueenslandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Queensland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class QueenslandTest extends QueenslandBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Queensland (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -53,11 +52,16 @@ public function testOfficialHolidays(): void 'anzacDay', 'queensBirthday', 'labourDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/SouthAustralia/AdelaideCupDayTest.php b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php index 8e84883dd..ef4e00da5 100644 --- a/tests/Australia/SouthAustralia/AdelaideCupDayTest.php +++ b/tests/Australia/SouthAustralia/AdelaideCupDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class AdelaideCupDayTest extends SouthAustraliaBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -92,7 +87,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -107,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/AnzacDayTest.php b/tests/Australia/SouthAustralia/AnzacDayTest.php index a71c8ca6f..1c0fd214d 100644 --- a/tests/Australia/SouthAustralia/AnzacDayTest.php +++ b/tests/Australia/SouthAustralia/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/AustraliaDayTest.php b/tests/Australia/SouthAustralia/AustraliaDayTest.php index 34f98df24..81480cabd 100644 --- a/tests/Australia/SouthAustralia/AustraliaDayTest.php +++ b/tests/Australia/SouthAustralia/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/ChristmasDayTest.php b/tests/Australia/SouthAustralia/ChristmasDayTest.php index 261d6992f..44ef28c1c 100644 --- a/tests/Australia/SouthAustralia/ChristmasDayTest.php +++ b/tests/Australia/SouthAustralia/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class ChristmasDayTest extends SouthAustraliaBaseTestCase implements HolidayTest * @param string $expected the expected date * @param ?string $expectedExtra the expected date for the additional holiday, or null if no additional holiday * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected, ?string $expectedExtra): void { @@ -50,7 +45,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); if (null === $expectedExtra) { $this->assertNotHoliday( @@ -63,7 +58,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) $this->region, self::HOLIDAY2, $year, - new DateTime($expectedExtra, new DateTimeZone($this->timezone)) + new \DateTime($expectedExtra, new \DateTimeZone($this->timezone)) ); } } @@ -71,7 +66,7 @@ public function testHoliday(int $year, string $expected, ?string $expectedExtra) /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -93,7 +88,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -114,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/EasterMondayTest.php b/tests/Australia/SouthAustralia/EasterMondayTest.php index 8741b3d0d..50430f021 100644 --- a/tests/Australia/SouthAustralia/EasterMondayTest.php +++ b/tests/Australia/SouthAustralia/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/EasterSaturdayTest.php b/tests/Australia/SouthAustralia/EasterSaturdayTest.php index 1d5af8746..fd1a8b01e 100644 --- a/tests/Australia/SouthAustralia/EasterSaturdayTest.php +++ b/tests/Australia/SouthAustralia/EasterSaturdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterSaturdayTest extends SouthAustraliaBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/GoodFridayTest.php b/tests/Australia/SouthAustralia/GoodFridayTest.php index 817146149..bdc5e2d54 100644 --- a/tests/Australia/SouthAustralia/GoodFridayTest.php +++ b/tests/Australia/SouthAustralia/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/LabourDayTest.php b/tests/Australia/SouthAustralia/LabourDayTest.php index 73f7f8db0..91cdde104 100644 --- a/tests/Australia/SouthAustralia/LabourDayTest.php +++ b/tests/Australia/SouthAustralia/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends SouthAustraliaBaseTestCase implements HolidayTestCas * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/NationalDayOfMourningTest.php b/tests/Australia/SouthAustralia/NationalDayOfMourningTest.php new file mode 100644 index 000000000..3c84904b4 --- /dev/null +++ b/tests/Australia/SouthAustralia/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\SouthAustralia; + +/** + * Class for testing National Day of Mourning in South Australia (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/SouthAustralia/NewYearsDayTest.php b/tests/Australia/SouthAustralia/NewYearsDayTest.php index 2dc2ca8e4..6e06d443b 100644 --- a/tests/Australia/SouthAustralia/NewYearsDayTest.php +++ b/tests/Australia/SouthAustralia/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/ProclamationDayTest.php b/tests/Australia/SouthAustralia/ProclamationDayTest.php index 77a849a05..50d956969 100644 --- a/tests/Australia/SouthAustralia/ProclamationDayTest.php +++ b/tests/Australia/SouthAustralia/ProclamationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ProclamationDayTest extends SouthAustraliaBaseTestCase implements HolidayT * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/QueensBirthdayTest.php b/tests/Australia/SouthAustralia/QueensBirthdayTest.php index 8a83852f4..f377d8c51 100644 --- a/tests/Australia/SouthAustralia/QueensBirthdayTest.php +++ b/tests/Australia/SouthAustralia/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends SouthAustraliaBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php b/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php index c1177cad8..11a4e3271 100644 --- a/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php +++ b/tests/Australia/SouthAustralia/SouthAustraliaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/SouthAustralia/SouthAustraliaTest.php b/tests/Australia/SouthAustralia/SouthAustraliaTest.php index 9f348c698..2c48960c0 100644 --- a/tests/Australia/SouthAustralia/SouthAustraliaTest.php +++ b/tests/Australia/SouthAustralia/SouthAustraliaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\SouthAustralia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class SouthAustraliaTest extends SouthAustraliaBaseTestCase implements ProviderT /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in South Australia (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'queensBirthday', 'labourDay', 'adelaideCup', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/AnzacDayTest.php b/tests/Australia/Tasmania/AnzacDayTest.php index b1c6a8b18..54b013ff8 100644 --- a/tests/Australia/Tasmania/AnzacDayTest.php +++ b/tests/Australia/Tasmania/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/AustraliaDayTest.php b/tests/Australia/Tasmania/AustraliaDayTest.php index caa329b63..ad3ddccba 100644 --- a/tests/Australia/Tasmania/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/BoxingDayTest.php b/tests/Australia/Tasmania/BoxingDayTest.php index e3c7f9725..9fec1e091 100644 --- a/tests/Australia/Tasmania/BoxingDayTest.php +++ b/tests/Australia/Tasmania/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/AnzacDayTest.php b/tests/Australia/Tasmania/CentralNorth/AnzacDayTest.php index 4ee87297f..3aedc6c05 100644 --- a/tests/Australia/Tasmania/CentralNorth/AnzacDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/AustraliaDayTest.php b/tests/Australia/Tasmania/CentralNorth/AustraliaDayTest.php index 5f36120db..8770a1af1 100644 --- a/tests/Australia/Tasmania/CentralNorth/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/BoxingDayTest.php b/tests/Australia/Tasmania/CentralNorth/BoxingDayTest.php index 18b49f309..6593e10df 100644 --- a/tests/Australia/Tasmania/CentralNorth/BoxingDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/CentralNorthBaseTestCase.php b/tests/Australia/Tasmania/CentralNorth/CentralNorthBaseTestCase.php index 364783f7b..78dbc694c 100644 --- a/tests/Australia/Tasmania/CentralNorth/CentralNorthBaseTestCase.php +++ b/tests/Australia/Tasmania/CentralNorth/CentralNorthBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/CentralNorthTest.php b/tests/Australia/Tasmania/CentralNorth/CentralNorthTest.php index 2f96ca123..46e46f9f4 100644 --- a/tests/Australia/Tasmania/CentralNorth/CentralNorthTest.php +++ b/tests/Australia/Tasmania/CentralNorth/CentralNorthTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\CentralNorth; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CentralNorthTest extends CentralNorthBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in central north Tasmania (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'devonportShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/CentralNorth/ChristmasDayTest.php b/tests/Australia/Tasmania/CentralNorth/ChristmasDayTest.php index 14e6d9c8e..9089bae2e 100644 --- a/tests/Australia/Tasmania/CentralNorth/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php index bd8ac6842..5173a296d 100644 --- a/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php +++ b/tests/Australia/Tasmania/CentralNorth/DevonportShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\CentralNorth; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class DevonportShowTest extends CentralNorthBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/CentralNorth/EasterMondayTest.php b/tests/Australia/Tasmania/CentralNorth/EasterMondayTest.php index 70b181491..cf9afb995 100644 --- a/tests/Australia/Tasmania/CentralNorth/EasterMondayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/EightHourDayTest.php b/tests/Australia/Tasmania/CentralNorth/EightHourDayTest.php index e0307ba35..21c511303 100644 --- a/tests/Australia/Tasmania/CentralNorth/EightHourDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/GoodFridayTest.php b/tests/Australia/Tasmania/CentralNorth/GoodFridayTest.php index f0bf13640..f361f7ed5 100644 --- a/tests/Australia/Tasmania/CentralNorth/GoodFridayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/CentralNorth/NationalDayOfMourningTest.php new file mode 100644 index 000000000..e3eac8f46 --- /dev/null +++ b/tests/Australia/Tasmania/CentralNorth/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\CentralNorth; + +/** + * Class for testing National Day of Mourning in central north Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/CentralNorth/NewYearsDayTest.php b/tests/Australia/Tasmania/CentralNorth/NewYearsDayTest.php index b32d31dd1..074069cd8 100644 --- a/tests/Australia/Tasmania/CentralNorth/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/QueensBirthdayTest.php b/tests/Australia/Tasmania/CentralNorth/QueensBirthdayTest.php index 912c0c806..eb48703ad 100644 --- a/tests/Australia/Tasmania/CentralNorth/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/CentralNorth/RecreationDayTest.php b/tests/Australia/Tasmania/CentralNorth/RecreationDayTest.php index 2a9ddf2c9..f3a86bcb3 100644 --- a/tests/Australia/Tasmania/CentralNorth/RecreationDayTest.php +++ b/tests/Australia/Tasmania/CentralNorth/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/ChristmasDayTest.php b/tests/Australia/Tasmania/ChristmasDayTest.php index 5ee4540b8..279c66bcc 100644 --- a/tests/Australia/Tasmania/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/EasterMondayTest.php b/tests/Australia/Tasmania/EasterMondayTest.php index 13dc1de1a..56a75610b 100644 --- a/tests/Australia/Tasmania/EasterMondayTest.php +++ b/tests/Australia/Tasmania/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/EightHourDayTest.php b/tests/Australia/Tasmania/EightHourDayTest.php index 5f93bc5a5..731cbb719 100644 --- a/tests/Australia/Tasmania/EightHourDayTest.php +++ b/tests/Australia/Tasmania/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EightHourDayTest extends TasmaniaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/FlindersIsland/AnzacDayTest.php b/tests/Australia/Tasmania/FlindersIsland/AnzacDayTest.php index 219980b35..28d70e25d 100644 --- a/tests/Australia/Tasmania/FlindersIsland/AnzacDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/AustraliaDayTest.php b/tests/Australia/Tasmania/FlindersIsland/AustraliaDayTest.php index 2dfafaded..2ff0f8e9f 100644 --- a/tests/Australia/Tasmania/FlindersIsland/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/BoxingDayTest.php b/tests/Australia/Tasmania/FlindersIsland/BoxingDayTest.php index 379ae3251..5e0bb90ed 100644 --- a/tests/Australia/Tasmania/FlindersIsland/BoxingDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/ChristmasDayTest.php b/tests/Australia/Tasmania/FlindersIsland/ChristmasDayTest.php index 7c2f617e2..90e306321 100644 --- a/tests/Australia/Tasmania/FlindersIsland/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/EasterMondayTest.php b/tests/Australia/Tasmania/FlindersIsland/EasterMondayTest.php index 5df37a4e9..109c6422f 100644 --- a/tests/Australia/Tasmania/FlindersIsland/EasterMondayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/EightHourDayTest.php b/tests/Australia/Tasmania/FlindersIsland/EightHourDayTest.php index 67d8d2d13..e8f90dc18 100644 --- a/tests/Australia/Tasmania/FlindersIsland/EightHourDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandBaseTestCase.php b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandBaseTestCase.php index 2726300e6..28b9fb7cc 100644 --- a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandBaseTestCase.php +++ b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php index 5ded66c62..972d36e05 100644 --- a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\FlindersIsland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class FlindersIslandShowTest extends FlindersIslandBaseTestCase implements Holid * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandTest.php b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandTest.php index fe612a37b..8799efc8c 100644 --- a/tests/Australia/Tasmania/FlindersIsland/FlindersIslandTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/FlindersIslandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\FlindersIsland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class FlindersIslandTest extends FlindersIslandBaseTestCase implements ProviderT /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Flinders Island (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'flindersIslandShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/FlindersIsland/GoodFridayTest.php b/tests/Australia/Tasmania/FlindersIsland/GoodFridayTest.php index 60ac761c4..a4844deda 100644 --- a/tests/Australia/Tasmania/FlindersIsland/GoodFridayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/FlindersIsland/NationalDayOfMourningTest.php new file mode 100644 index 000000000..f129424ed --- /dev/null +++ b/tests/Australia/Tasmania/FlindersIsland/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\FlindersIsland; + +/** + * Class for testing National Day of Mourning in Flinders Island (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/FlindersIsland/NewYearsDayTest.php b/tests/Australia/Tasmania/FlindersIsland/NewYearsDayTest.php index 9ee76172b..abfc4d74c 100644 --- a/tests/Australia/Tasmania/FlindersIsland/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/QueensBirthdayTest.php b/tests/Australia/Tasmania/FlindersIsland/QueensBirthdayTest.php index d925dd833..69df30bd9 100644 --- a/tests/Australia/Tasmania/FlindersIsland/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/FlindersIsland/RecreationDayTest.php b/tests/Australia/Tasmania/FlindersIsland/RecreationDayTest.php index 9d047861e..00e2e374f 100644 --- a/tests/Australia/Tasmania/FlindersIsland/RecreationDayTest.php +++ b/tests/Australia/Tasmania/FlindersIsland/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/GoodFridayTest.php b/tests/Australia/Tasmania/GoodFridayTest.php index d35f556a7..7663c53a9 100644 --- a/tests/Australia/Tasmania/GoodFridayTest.php +++ b/tests/Australia/Tasmania/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/AnzacDayTest.php b/tests/Australia/Tasmania/KingIsland/AnzacDayTest.php index c83ab4b39..a7766f194 100644 --- a/tests/Australia/Tasmania/KingIsland/AnzacDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/AustraliaDayTest.php b/tests/Australia/Tasmania/KingIsland/AustraliaDayTest.php index fc6c681c2..27fcbd8dd 100644 --- a/tests/Australia/Tasmania/KingIsland/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/BoxingDayTest.php b/tests/Australia/Tasmania/KingIsland/BoxingDayTest.php index 247651f23..77d5b9704 100644 --- a/tests/Australia/Tasmania/KingIsland/BoxingDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/ChristmasDayTest.php b/tests/Australia/Tasmania/KingIsland/ChristmasDayTest.php index 586ab5314..35041f418 100644 --- a/tests/Australia/Tasmania/KingIsland/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/EasterMondayTest.php b/tests/Australia/Tasmania/KingIsland/EasterMondayTest.php index 530318422..ecea35ac6 100644 --- a/tests/Australia/Tasmania/KingIsland/EasterMondayTest.php +++ b/tests/Australia/Tasmania/KingIsland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/EightHourDayTest.php b/tests/Australia/Tasmania/KingIsland/EightHourDayTest.php index ca2c5db64..6c130e793 100644 --- a/tests/Australia/Tasmania/KingIsland/EightHourDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/GoodFridayTest.php b/tests/Australia/Tasmania/KingIsland/GoodFridayTest.php index 07979a121..69a4fc989 100644 --- a/tests/Australia/Tasmania/KingIsland/GoodFridayTest.php +++ b/tests/Australia/Tasmania/KingIsland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/KingIslandBaseTestCase.php b/tests/Australia/Tasmania/KingIsland/KingIslandBaseTestCase.php index 46f9c9811..72e988aab 100644 --- a/tests/Australia/Tasmania/KingIsland/KingIslandBaseTestCase.php +++ b/tests/Australia/Tasmania/KingIsland/KingIslandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php index 73a007b2e..743c93f09 100644 --- a/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php +++ b/tests/Australia/Tasmania/KingIsland/KingIslandShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\KingIsland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class KingIslandShowTest extends KingIslandBaseTestCase implements HolidayTestCa * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/KingIsland/KingIslandTest.php b/tests/Australia/Tasmania/KingIsland/KingIslandTest.php index 2f1d23083..d38199096 100644 --- a/tests/Australia/Tasmania/KingIsland/KingIslandTest.php +++ b/tests/Australia/Tasmania/KingIsland/KingIslandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\KingIsland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class KingIslandTest extends KingIslandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in King Island (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'kingIslandShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/KingIsland/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/KingIsland/NationalDayOfMourningTest.php new file mode 100644 index 000000000..6d30653ff --- /dev/null +++ b/tests/Australia/Tasmania/KingIsland/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\KingIsland; + +/** + * Class for testing National Day of Mourning in King Island (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/KingIsland/NewYearsDayTest.php b/tests/Australia/Tasmania/KingIsland/NewYearsDayTest.php index dc563091a..61b02a86b 100644 --- a/tests/Australia/Tasmania/KingIsland/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/QueensBirthdayTest.php b/tests/Australia/Tasmania/KingIsland/QueensBirthdayTest.php index fefce38a4..92e19d893 100644 --- a/tests/Australia/Tasmania/KingIsland/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/KingIsland/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/KingIsland/RecreationDayTest.php b/tests/Australia/Tasmania/KingIsland/RecreationDayTest.php index b6109dbc3..c4208ac1f 100644 --- a/tests/Australia/Tasmania/KingIsland/RecreationDayTest.php +++ b/tests/Australia/Tasmania/KingIsland/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/NationalDayOfMourningTest.php new file mode 100644 index 000000000..e4d52bc54 --- /dev/null +++ b/tests/Australia/Tasmania/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania; + +/** + * Class for testing National Day of Mourning in Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/NewYearsDayTest.php b/tests/Australia/Tasmania/NewYearsDayTest.php index a8d4c482f..f92040878 100644 --- a/tests/Australia/Tasmania/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/AnzacDayTest.php b/tests/Australia/Tasmania/Northeast/AnzacDayTest.php index 693508b7e..90e52f65b 100644 --- a/tests/Australia/Tasmania/Northeast/AnzacDayTest.php +++ b/tests/Australia/Tasmania/Northeast/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/AustraliaDayTest.php b/tests/Australia/Tasmania/Northeast/AustraliaDayTest.php index 147ff4e67..6c2920678 100644 --- a/tests/Australia/Tasmania/Northeast/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/Northeast/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/BoxingDayTest.php b/tests/Australia/Tasmania/Northeast/BoxingDayTest.php index f1cf2983b..c650ad447 100644 --- a/tests/Australia/Tasmania/Northeast/BoxingDayTest.php +++ b/tests/Australia/Tasmania/Northeast/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/ChristmasDayTest.php b/tests/Australia/Tasmania/Northeast/ChristmasDayTest.php index 0a7afa4e7..a30bc5aac 100644 --- a/tests/Australia/Tasmania/Northeast/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/Northeast/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/EasterMondayTest.php b/tests/Australia/Tasmania/Northeast/EasterMondayTest.php index 41a1edbf9..46f235f7c 100644 --- a/tests/Australia/Tasmania/Northeast/EasterMondayTest.php +++ b/tests/Australia/Tasmania/Northeast/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/EightHourDayTest.php b/tests/Australia/Tasmania/Northeast/EightHourDayTest.php index 23abe1852..aacb3faf6 100644 --- a/tests/Australia/Tasmania/Northeast/EightHourDayTest.php +++ b/tests/Australia/Tasmania/Northeast/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/GoodFridayTest.php b/tests/Australia/Tasmania/Northeast/GoodFridayTest.php index 8b1d8185d..41b1260c1 100644 --- a/tests/Australia/Tasmania/Northeast/GoodFridayTest.php +++ b/tests/Australia/Tasmania/Northeast/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php index 936f9f5ec..113f6fd43 100644 --- a/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php +++ b/tests/Australia/Tasmania/Northeast/LauncestonShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northeast; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LauncestonShowTest extends NortheastBaseTestCase implements HolidayTestCas * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/Northeast/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/Northeast/NationalDayOfMourningTest.php new file mode 100644 index 000000000..7ff73368e --- /dev/null +++ b/tests/Australia/Tasmania/Northeast/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\Northeast; + +/** + * Class for testing National Day of Mourning in northeastern Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/Northeast/NewYearsDayTest.php b/tests/Australia/Tasmania/Northeast/NewYearsDayTest.php index 5e1f63723..f3ccb2d7f 100644 --- a/tests/Australia/Tasmania/Northeast/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/Northeast/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/NortheastBaseTestCase.php b/tests/Australia/Tasmania/Northeast/NortheastBaseTestCase.php index 318755030..66bfd5c0e 100644 --- a/tests/Australia/Tasmania/Northeast/NortheastBaseTestCase.php +++ b/tests/Australia/Tasmania/Northeast/NortheastBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/NortheastTest.php b/tests/Australia/Tasmania/Northeast/NortheastTest.php index e01db49eb..1bbc49771 100644 --- a/tests/Australia/Tasmania/Northeast/NortheastTest.php +++ b/tests/Australia/Tasmania/Northeast/NortheastTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northeast; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NortheastTest extends NortheastBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in northeastern Tasmania (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'launcestonShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/Northeast/QueensBirthdayTest.php b/tests/Australia/Tasmania/Northeast/QueensBirthdayTest.php index 5aae36b1f..3f4d28014 100644 --- a/tests/Australia/Tasmania/Northeast/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/Northeast/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northeast/RecreationDayTest.php b/tests/Australia/Tasmania/Northeast/RecreationDayTest.php index cb10db520..177d8c34f 100644 --- a/tests/Australia/Tasmania/Northeast/RecreationDayTest.php +++ b/tests/Australia/Tasmania/Northeast/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/AnzacDayTest.php b/tests/Australia/Tasmania/Northwest/AnzacDayTest.php index cb1a621df..f826b380a 100644 --- a/tests/Australia/Tasmania/Northwest/AnzacDayTest.php +++ b/tests/Australia/Tasmania/Northwest/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/AustraliaDayTest.php b/tests/Australia/Tasmania/Northwest/AustraliaDayTest.php index 8776309d7..7094e4010 100644 --- a/tests/Australia/Tasmania/Northwest/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/Northwest/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/BoxingDayTest.php b/tests/Australia/Tasmania/Northwest/BoxingDayTest.php index ee2b3ecf5..3f3e7f77c 100644 --- a/tests/Australia/Tasmania/Northwest/BoxingDayTest.php +++ b/tests/Australia/Tasmania/Northwest/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php index 132827b39..f5e4e3c71 100644 --- a/tests/Australia/Tasmania/Northwest/BurnieShowTest.php +++ b/tests/Australia/Tasmania/Northwest/BurnieShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northwest; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class BurnieShowTest extends NorthwestBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/Northwest/ChristmasDayTest.php b/tests/Australia/Tasmania/Northwest/ChristmasDayTest.php index 007a6ac0a..56d9a8068 100644 --- a/tests/Australia/Tasmania/Northwest/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/Northwest/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php index 8aab4c5cd..0c7766fb4 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/AGFESTTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northwest\CircularHead; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AGFESTTest extends CircularHeadBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/AnzacDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/AnzacDayTest.php index f73af536f..42db9a141 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/AnzacDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/AustraliaDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/AustraliaDayTest.php index a0eec524a..2a490c36d 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/BoxingDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/BoxingDayTest.php index c796a5f1f..88fbaec55 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/BoxingDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/BurnieShowTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/BurnieShowTest.php index 2082c4dcd..c85f012d2 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/BurnieShowTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/BurnieShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/ChristmasDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/ChristmasDayTest.php index b638739dc..f16f4ef05 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadBaseTestCase.php b/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadBaseTestCase.php index 70e13c30c..7c930a38c 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadBaseTestCase.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadTest.php index 79b1ec73a..07e26d98d 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/CircularHeadTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northwest\CircularHead; -use ReflectionException; use Yasumi\Holiday; /** @@ -29,6 +28,8 @@ class CircularHeadTest extends CircularHeadBaseTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -37,12 +38,10 @@ protected function setUp(): void /** * Tests if all official holidays in Circular Head (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,6 +54,10 @@ public function testOfficialHolidays(): void 'recreationDay', 'burnieShow', 'agfest', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/EasterMondayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/EasterMondayTest.php index a9004a510..318b39880 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/EasterMondayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/EightHourDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/EightHourDayTest.php index 86e9297e2..b76aafb4d 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/EightHourDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/GoodFridayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/GoodFridayTest.php index 2487f237c..c86deaf77 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/GoodFridayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/NationalDayOfMourningTest.php new file mode 100644 index 000000000..c1fec57e2 --- /dev/null +++ b/tests/Australia/Tasmania/Northwest/CircularHead/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\Northwest\CircularHead; + +/** + * Class for testing National Day of Mourning in Circular Head (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\Northwest\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/NewYearsDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/NewYearsDayTest.php index ffb1ecf55..2f8c9c0c2 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/QueensBirthdayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/QueensBirthdayTest.php index dddd6cd40..518a55d4e 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/CircularHead/RecreationDayTest.php b/tests/Australia/Tasmania/Northwest/CircularHead/RecreationDayTest.php index 7be961b75..87098af7f 100644 --- a/tests/Australia/Tasmania/Northwest/CircularHead/RecreationDayTest.php +++ b/tests/Australia/Tasmania/Northwest/CircularHead/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/EasterMondayTest.php b/tests/Australia/Tasmania/Northwest/EasterMondayTest.php index 3541fe2c1..4e80d6454 100644 --- a/tests/Australia/Tasmania/Northwest/EasterMondayTest.php +++ b/tests/Australia/Tasmania/Northwest/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/EightHourDayTest.php b/tests/Australia/Tasmania/Northwest/EightHourDayTest.php index 1f2e9d31b..74f525203 100644 --- a/tests/Australia/Tasmania/Northwest/EightHourDayTest.php +++ b/tests/Australia/Tasmania/Northwest/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/GoodFridayTest.php b/tests/Australia/Tasmania/Northwest/GoodFridayTest.php index 7415a80b2..a5b9a68dc 100644 --- a/tests/Australia/Tasmania/Northwest/GoodFridayTest.php +++ b/tests/Australia/Tasmania/Northwest/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/Northwest/NationalDayOfMourningTest.php new file mode 100644 index 000000000..d1a63bf71 --- /dev/null +++ b/tests/Australia/Tasmania/Northwest/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\Northwest; + +/** + * Class for testing National Day of Mourning in northwestern Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/Northwest/NewYearsDayTest.php b/tests/Australia/Tasmania/Northwest/NewYearsDayTest.php index aa41dadaa..4fbef25e7 100644 --- a/tests/Australia/Tasmania/Northwest/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/Northwest/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/NorthwestBaseTestCase.php b/tests/Australia/Tasmania/Northwest/NorthwestBaseTestCase.php index 2f40825cf..8df9cebde 100644 --- a/tests/Australia/Tasmania/Northwest/NorthwestBaseTestCase.php +++ b/tests/Australia/Tasmania/Northwest/NorthwestBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/NorthwestTest.php b/tests/Australia/Tasmania/Northwest/NorthwestTest.php index 36466435e..f2fecdc3e 100644 --- a/tests/Australia/Tasmania/Northwest/NorthwestTest.php +++ b/tests/Australia/Tasmania/Northwest/NorthwestTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\Northwest; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NorthwestTest extends NorthwestBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in northwestern Tasmania (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'burnieShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/Northwest/QueensBirthdayTest.php b/tests/Australia/Tasmania/Northwest/QueensBirthdayTest.php index 7216d5ac1..b1ad85c71 100644 --- a/tests/Australia/Tasmania/Northwest/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/Northwest/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/Northwest/RecreationDayTest.php b/tests/Australia/Tasmania/Northwest/RecreationDayTest.php index 5216e7932..8b7e5b447 100644 --- a/tests/Australia/Tasmania/Northwest/RecreationDayTest.php +++ b/tests/Australia/Tasmania/Northwest/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/QueensBirthdayTest.php b/tests/Australia/Tasmania/QueensBirthdayTest.php index e6672897d..0b8440e9c 100644 --- a/tests/Australia/Tasmania/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends TasmaniaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/RecreationDayTest.php b/tests/Australia/Tasmania/RecreationDayTest.php index f6fbe4441..d752dce22 100644 --- a/tests/Australia/Tasmania/RecreationDayTest.php +++ b/tests/Australia/Tasmania/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class RecreationDayTest extends TasmaniaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/South/AnzacDayTest.php b/tests/Australia/Tasmania/South/AnzacDayTest.php index c30d9c53e..73ada924f 100644 --- a/tests/Australia/Tasmania/South/AnzacDayTest.php +++ b/tests/Australia/Tasmania/South/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/AustraliaDayTest.php b/tests/Australia/Tasmania/South/AustraliaDayTest.php index 8fbff55c4..b2a8c3017 100644 --- a/tests/Australia/Tasmania/South/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/South/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/BoxingDayTest.php b/tests/Australia/Tasmania/South/BoxingDayTest.php index 8de7c7bdd..58cc8d4a0 100644 --- a/tests/Australia/Tasmania/South/BoxingDayTest.php +++ b/tests/Australia/Tasmania/South/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/ChristmasDayTest.php b/tests/Australia/Tasmania/South/ChristmasDayTest.php index f3aab9a5b..482311f79 100644 --- a/tests/Australia/Tasmania/South/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/South/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/EasterMondayTest.php b/tests/Australia/Tasmania/South/EasterMondayTest.php index dcbadf76d..b67353be5 100644 --- a/tests/Australia/Tasmania/South/EasterMondayTest.php +++ b/tests/Australia/Tasmania/South/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/EightHourDayTest.php b/tests/Australia/Tasmania/South/EightHourDayTest.php index 4bb25c640..a4797e003 100644 --- a/tests/Australia/Tasmania/South/EightHourDayTest.php +++ b/tests/Australia/Tasmania/South/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/GoodFridayTest.php b/tests/Australia/Tasmania/South/GoodFridayTest.php index 5af07b9ce..b9bbf70bf 100644 --- a/tests/Australia/Tasmania/South/GoodFridayTest.php +++ b/tests/Australia/Tasmania/South/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/HobartShowTest.php b/tests/Australia/Tasmania/South/HobartShowTest.php index 233d65a15..b28da3126 100644 --- a/tests/Australia/Tasmania/South/HobartShowTest.php +++ b/tests/Australia/Tasmania/South/HobartShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\South; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class HobartShowTest extends SouthBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/South/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/South/NationalDayOfMourningTest.php new file mode 100644 index 000000000..e2024ff17 --- /dev/null +++ b/tests/Australia/Tasmania/South/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\South; + +/** + * Class for testing National Day of Mourning in southern Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/South/NewYearsDayTest.php b/tests/Australia/Tasmania/South/NewYearsDayTest.php index b8ce0f402..2af00db13 100644 --- a/tests/Australia/Tasmania/South/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/South/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/QueensBirthdayTest.php b/tests/Australia/Tasmania/South/QueensBirthdayTest.php index 55b5f61c0..ddf89fdb3 100644 --- a/tests/Australia/Tasmania/South/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/South/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/RecreationDayTest.php b/tests/Australia/Tasmania/South/RecreationDayTest.php index d7a046251..e6d59e05a 100644 --- a/tests/Australia/Tasmania/South/RecreationDayTest.php +++ b/tests/Australia/Tasmania/South/RecreationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/SouthBaseTestCase.php b/tests/Australia/Tasmania/South/SouthBaseTestCase.php index 2da9fbf86..da5fbb550 100644 --- a/tests/Australia/Tasmania/South/SouthBaseTestCase.php +++ b/tests/Australia/Tasmania/South/SouthBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/SouthTest.php b/tests/Australia/Tasmania/South/SouthTest.php index 7af73ab3e..06ce3a7e8 100644 --- a/tests/Australia/Tasmania/South/SouthTest.php +++ b/tests/Australia/Tasmania/South/SouthTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\South; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SouthTest extends SouthBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in northwestern Tasmania (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -55,11 +54,16 @@ public function testOfficialHolidays(): void 'eightHourDay', 'recreationDay', 'hobartShow', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Tasmania/South/Southeast/AnzacDayTest.php b/tests/Australia/Tasmania/South/Southeast/AnzacDayTest.php index 09dcb0f0f..9507b97c0 100644 --- a/tests/Australia/Tasmania/South/Southeast/AnzacDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/AustraliaDayTest.php b/tests/Australia/Tasmania/South/Southeast/AustraliaDayTest.php index c4df5432d..e8047fe27 100644 --- a/tests/Australia/Tasmania/South/Southeast/AustraliaDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/BoxingDayTest.php b/tests/Australia/Tasmania/South/Southeast/BoxingDayTest.php index 69c14b49d..6aad31745 100644 --- a/tests/Australia/Tasmania/South/Southeast/BoxingDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/ChristmasDayTest.php b/tests/Australia/Tasmania/South/Southeast/ChristmasDayTest.php index 9d850cac5..f09273260 100644 --- a/tests/Australia/Tasmania/South/Southeast/ChristmasDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/EasterMondayTest.php b/tests/Australia/Tasmania/South/Southeast/EasterMondayTest.php index 466aede58..a9bb1cfdc 100644 --- a/tests/Australia/Tasmania/South/Southeast/EasterMondayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/EightHourDayTest.php b/tests/Australia/Tasmania/South/Southeast/EightHourDayTest.php index be559a445..7a0ee954e 100644 --- a/tests/Australia/Tasmania/South/Southeast/EightHourDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/EightHourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/GoodFridayTest.php b/tests/Australia/Tasmania/South/Southeast/GoodFridayTest.php index 6ee000dbb..31001f762 100644 --- a/tests/Australia/Tasmania/South/Southeast/GoodFridayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php index 5da6997a7..addf38e17 100644 --- a/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php +++ b/tests/Australia/Tasmania/South/Southeast/HobartRegattaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\South\Southeast; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class HobartRegattaTest extends SoutheastBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Tasmania/South/Southeast/HobartShowTest.php b/tests/Australia/Tasmania/South/Southeast/HobartShowTest.php index 27c1e3349..153d000b9 100644 --- a/tests/Australia/Tasmania/South/Southeast/HobartShowTest.php +++ b/tests/Australia/Tasmania/South/Southeast/HobartShowTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/NationalDayOfMourningTest.php b/tests/Australia/Tasmania/South/Southeast/NationalDayOfMourningTest.php new file mode 100644 index 000000000..b781a8430 --- /dev/null +++ b/tests/Australia/Tasmania/South/Southeast/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Tasmania\South\Southeast; + +/** + * Class for testing National Day of Mourning in southeastern Tasmania (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\Tasmania\South\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Tasmania/South/Southeast/NewYearsDayTest.php b/tests/Australia/Tasmania/South/Southeast/NewYearsDayTest.php index 4b1086cbd..7329a98cb 100644 --- a/tests/Australia/Tasmania/South/Southeast/NewYearsDayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/QueensBirthdayTest.php b/tests/Australia/Tasmania/South/Southeast/QueensBirthdayTest.php index 6a9507ac4..4cf3036d7 100644 --- a/tests/Australia/Tasmania/South/Southeast/QueensBirthdayTest.php +++ b/tests/Australia/Tasmania/South/Southeast/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/SoutheastBaseTestCase.php b/tests/Australia/Tasmania/South/Southeast/SoutheastBaseTestCase.php index 4e1d6f7e2..e854bdcc7 100644 --- a/tests/Australia/Tasmania/South/Southeast/SoutheastBaseTestCase.php +++ b/tests/Australia/Tasmania/South/Southeast/SoutheastBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/South/Southeast/SoutheastTest.php b/tests/Australia/Tasmania/South/Southeast/SoutheastTest.php index f0d42b0ad..fc89b4779 100644 --- a/tests/Australia/Tasmania/South/Southeast/SoutheastTest.php +++ b/tests/Australia/Tasmania/South/Southeast/SoutheastTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania\South\Southeast; -use ReflectionException; use Yasumi\Holiday; /** @@ -29,6 +28,8 @@ class SoutheastTest extends SoutheastBaseTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -37,12 +38,10 @@ protected function setUp(): void /** * Tests if all official holidays in Circular Head (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -54,6 +53,10 @@ public function testOfficialHolidays(): void 'eightHourDay', 'hobartShow', 'hobartRegatta', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Australia/Tasmania/TasmaniaBaseTestCase.php b/tests/Australia/Tasmania/TasmaniaBaseTestCase.php index 39fac83a0..44df7e29f 100644 --- a/tests/Australia/Tasmania/TasmaniaBaseTestCase.php +++ b/tests/Australia/Tasmania/TasmaniaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Tasmania/TasmaniaTest.php b/tests/Australia/Tasmania/TasmaniaTest.php index e1e40fcfa..4cea7d980 100644 --- a/tests/Australia/Tasmania/TasmaniaTest.php +++ b/tests/Australia/Tasmania/TasmaniaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Tasmania; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class TasmaniaTest extends TasmaniaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Tasmania (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -54,11 +53,16 @@ public function testOfficialHolidays(): void 'queensBirthday', 'eightHourDay', 'recreationDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php index 4ca20039e..77cee7821 100644 --- a/tests/Australia/Victoria/AFLGrandFinalFridayTest.php +++ b/tests/Australia/Victoria/AFLGrandFinalFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -42,8 +38,7 @@ class AFLGrandFinalFridayTest extends VictoriaBaseTestCase implements HolidayTes * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -51,14 +46,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -73,7 +68,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -87,8 +82,6 @@ public function testHolidayType(): void /** * Tests that Holiday is not present before establishment year. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -98,7 +91,7 @@ public function testNotHoliday(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { diff --git a/tests/Australia/Victoria/AnzacDayTest.php b/tests/Australia/Victoria/AnzacDayTest.php index 46857273f..4ade076b2 100644 --- a/tests/Australia/Victoria/AnzacDayTest.php +++ b/tests/Australia/Victoria/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/AustraliaDayTest.php b/tests/Australia/Victoria/AustraliaDayTest.php index cea38c753..692e8f773 100644 --- a/tests/Australia/Victoria/AustraliaDayTest.php +++ b/tests/Australia/Victoria/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/BoxingDayTest.php b/tests/Australia/Victoria/BoxingDayTest.php index 0a6a0f062..8fd7f875b 100644 --- a/tests/Australia/Victoria/BoxingDayTest.php +++ b/tests/Australia/Victoria/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/ChristmasDayTest.php b/tests/Australia/Victoria/ChristmasDayTest.php index b971d0d3f..177d238ea 100644 --- a/tests/Australia/Victoria/ChristmasDayTest.php +++ b/tests/Australia/Victoria/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/EasterMondayTest.php b/tests/Australia/Victoria/EasterMondayTest.php index 52b7bc02f..c1b38fc0e 100644 --- a/tests/Australia/Victoria/EasterMondayTest.php +++ b/tests/Australia/Victoria/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/EasterSaturdayTest.php b/tests/Australia/Victoria/EasterSaturdayTest.php index 84c3ecc2b..eac5464d5 100644 --- a/tests/Australia/Victoria/EasterSaturdayTest.php +++ b/tests/Australia/Victoria/EasterSaturdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterSaturdayTest extends VictoriaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, $this->timezone); - $date->sub(new DateInterval('P1D')); + $date->sub(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Victoria/EasterSundayTest.php b/tests/Australia/Victoria/EasterSundayTest.php index 1ebe813a6..d97e8edab 100644 --- a/tests/Australia/Victoria/EasterSundayTest.php +++ b/tests/Australia/Victoria/EasterSundayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EasterSundayTest extends VictoriaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,16 +43,16 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -91,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Victoria/GoodFridayTest.php b/tests/Australia/Victoria/GoodFridayTest.php index d246bccb4..d6d6bd5a2 100644 --- a/tests/Australia/Victoria/GoodFridayTest.php +++ b/tests/Australia/Victoria/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/LabourDayTest.php b/tests/Australia/Victoria/LabourDayTest.php index 390eb8bf2..3e9bbc243 100644 --- a/tests/Australia/Victoria/LabourDayTest.php +++ b/tests/Australia/Victoria/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends VictoriaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Victoria/MelbourneCupDayTest.php b/tests/Australia/Victoria/MelbourneCupDayTest.php index a7b166f35..e43379843 100644 --- a/tests/Australia/Victoria/MelbourneCupDayTest.php +++ b/tests/Australia/Victoria/MelbourneCupDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class MelbourneCupDayTest extends VictoriaBaseTestCase implements HolidayTestCas * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Victoria/NationalDayOfMourningTest.php b/tests/Australia/Victoria/NationalDayOfMourningTest.php new file mode 100644 index 000000000..033be7914 --- /dev/null +++ b/tests/Australia/Victoria/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\Victoria; + +/** + * Class for testing National Day of Mourning in Victoria (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/Victoria/NewYearsDayTest.php b/tests/Australia/Victoria/NewYearsDayTest.php index 206c4e244..1d2016897 100644 --- a/tests/Australia/Victoria/NewYearsDayTest.php +++ b/tests/Australia/Victoria/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/QueensBirthdayTest.php b/tests/Australia/Victoria/QueensBirthdayTest.php index 11b6cd7aa..f6d60b76f 100644 --- a/tests/Australia/Victoria/QueensBirthdayTest.php +++ b/tests/Australia/Victoria/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends VictoriaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/Victoria/VictoriaBaseTestCase.php b/tests/Australia/Victoria/VictoriaBaseTestCase.php index c803ade63..e78b1660a 100644 --- a/tests/Australia/Victoria/VictoriaBaseTestCase.php +++ b/tests/Australia/Victoria/VictoriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/Victoria/VictoriaTest.php b/tests/Australia/Victoria/VictoriaTest.php index 73b0c7c26..14718133d 100644 --- a/tests/Australia/Victoria/VictoriaTest.php +++ b/tests/Australia/Victoria/VictoriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\Victoria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class VictoriaTest extends VictoriaBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Victoria (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -57,11 +56,16 @@ public function testOfficialHolidays(): void 'labourDay', 'aflGrandFinalFriday', 'melbourneCup', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Australia/WesternAustralia/AnzacDayTest.php b/tests/Australia/WesternAustralia/AnzacDayTest.php index 44dc2a1c9..82c1cab4f 100644 --- a/tests/Australia/WesternAustralia/AnzacDayTest.php +++ b/tests/Australia/WesternAustralia/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/AustraliaDayTest.php b/tests/Australia/WesternAustralia/AustraliaDayTest.php index e8e395ac7..ed58a6e28 100644 --- a/tests/Australia/WesternAustralia/AustraliaDayTest.php +++ b/tests/Australia/WesternAustralia/AustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/BoxingDayTest.php b/tests/Australia/WesternAustralia/BoxingDayTest.php index 548197de0..7c17911e3 100644 --- a/tests/Australia/WesternAustralia/BoxingDayTest.php +++ b/tests/Australia/WesternAustralia/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/ChristmasDayTest.php b/tests/Australia/WesternAustralia/ChristmasDayTest.php index 445a89ea6..d0508719b 100644 --- a/tests/Australia/WesternAustralia/ChristmasDayTest.php +++ b/tests/Australia/WesternAustralia/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/EasterMondayTest.php b/tests/Australia/WesternAustralia/EasterMondayTest.php index 844fad561..eba0dae5b 100644 --- a/tests/Australia/WesternAustralia/EasterMondayTest.php +++ b/tests/Australia/WesternAustralia/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/GoodFridayTest.php b/tests/Australia/WesternAustralia/GoodFridayTest.php index ced934315..0192aeca8 100644 --- a/tests/Australia/WesternAustralia/GoodFridayTest.php +++ b/tests/Australia/WesternAustralia/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/LabourDayTest.php b/tests/Australia/WesternAustralia/LabourDayTest.php index 153179d63..50d210579 100644 --- a/tests/Australia/WesternAustralia/LabourDayTest.php +++ b/tests/Australia/WesternAustralia/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\WesternAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends WesternAustraliaBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/WesternAustralia/NationalDayOfMourningTest.php b/tests/Australia/WesternAustralia/NationalDayOfMourningTest.php new file mode 100644 index 000000000..364347f7f --- /dev/null +++ b/tests/Australia/WesternAustralia/NationalDayOfMourningTest.php @@ -0,0 +1,22 @@ + + */ + +namespace Yasumi\tests\Australia\WesternAustralia; + +/** + * Class for testing National Day of Mourning in Western Australia (Australia).. + */ +class NationalDayOfMourningTest extends \Yasumi\tests\Australia\NationalDayOfMourningTest +{ +} diff --git a/tests/Australia/WesternAustralia/NewYearsDayTest.php b/tests/Australia/WesternAustralia/NewYearsDayTest.php index 123b09e8a..ea40509eb 100644 --- a/tests/Australia/WesternAustralia/NewYearsDayTest.php +++ b/tests/Australia/WesternAustralia/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/QueensBirthdayTest.php b/tests/Australia/WesternAustralia/QueensBirthdayTest.php index a3f2c79aa..4290fa490 100644 --- a/tests/Australia/WesternAustralia/QueensBirthdayTest.php +++ b/tests/Australia/WesternAustralia/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\WesternAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class QueensBirthdayTest extends WesternAustraliaBaseTestCase implements Holiday * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php b/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php index e75330e93..5b98909ee 100644 --- a/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php index 2c7fded4c..a51919e04 100644 --- a/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Australia\WesternAustralia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class WesternAustraliaDayTest extends WesternAustraliaBaseTestCase implements Ho * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,14 +43,14 @@ public function testHoliday(int $year, string $expected): void $this->region, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone($this->timezone)) + new \DateTime($expected, new \DateTimeZone($this->timezone)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test */ public function HolidayDataProvider(): array { @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Australia/WesternAustralia/WesternAustraliaTest.php b/tests/Australia/WesternAustralia/WesternAustraliaTest.php index 6447710ef..fdf748fe0 100644 --- a/tests/Australia/WesternAustralia/WesternAustraliaTest.php +++ b/tests/Australia/WesternAustralia/WesternAustraliaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Australia\WesternAustralia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class WesternAustraliaTest extends WesternAustraliaBaseTestCase implements Provi /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,12 +39,10 @@ protected function setUp(): void /** * Tests if all official holidays in Western Australia (Australia) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ + $expectedHolidays = [ 'newYearsDay', 'goodFriday', 'easterMonday', @@ -54,11 +53,16 @@ public function testOfficialHolidays(): void 'queensBirthday', 'labourDay', 'westernAustraliaDay', - ], $this->region, $this->year, Holiday::TYPE_OFFICIAL); + ]; + if (2022 == $this->year) { + $expectedHolidays[] = 'nationalDayOfMourning'; + } + $this->assertDefinedHolidays($expectedHolidays, $this->region, $this->year, Holiday::TYPE_OFFICIAL); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/AllSaintsDayTest.php b/tests/Austria/AllSaintsDayTest.php index 13579e2ee..60dbfd3d1 100644 --- a/tests/Austria/AllSaintsDayTest.php +++ b/tests/Austria/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends AustriaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/AscensionDayTest.php b/tests/Austria/AscensionDayTest.php index b952b6bb0..dbefaff38 100644 --- a/tests/Austria/AscensionDayTest.php +++ b/tests/Austria/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, 'ascensionDay', $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/AssumptionOfMaryTest.php b/tests/Austria/AssumptionOfMaryTest.php index 6e30aac47..f67d6284f 100644 --- a/tests/Austria/AssumptionOfMaryTest.php +++ b/tests/Austria/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends AustriaBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/AustriaBaseTestCase.php b/tests/Austria/AustriaBaseTestCase.php index 82ecbdbb2..7500867a3 100644 --- a/tests/Austria/AustriaBaseTestCase.php +++ b/tests/Austria/AustriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/AustriaTest.php b/tests/Austria/AustriaTest.php index 491a70ba6..312f991f8 100644 --- a/tests/Austria/AustriaTest.php +++ b/tests/Austria/AustriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class AustriaTest extends AustriaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Austria are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -62,8 +61,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Austria are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -72,8 +69,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Austria are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +77,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Austria are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +85,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Austria are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +92,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Burgenland/BurgenlandBaseTestCase.php b/tests/Austria/Burgenland/BurgenlandBaseTestCase.php index 03bfe986c..18e37a261 100644 --- a/tests/Austria/Burgenland/BurgenlandBaseTestCase.php +++ b/tests/Austria/Burgenland/BurgenlandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Burgenland/BurgenlandTest.php b/tests/Austria/Burgenland/BurgenlandTest.php index cdaf6f31e..b4d0e4be4 100644 --- a/tests/Austria/Burgenland/BurgenlandTest.php +++ b/tests/Austria/Burgenland/BurgenlandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Burgenland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BurgenlandTest extends BurgenlandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Burgenland (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -68,8 +67,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Burgenland (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -78,8 +75,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Burgenland (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -88,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Burgenland (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -98,8 +91,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Burgenland (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -107,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Burgenland/stMartinsDayTest.php b/tests/Austria/Burgenland/stMartinsDayTest.php index 72bd26a27..c97c56c0d 100644 --- a/tests/Austria/Burgenland/stMartinsDayTest.php +++ b/tests/Austria/Burgenland/stMartinsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Burgenland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stMartinsDayTest extends BurgenlandBaseTestCase implements HolidayTestCase * * @dataProvider stMartinsDayDataProvider * - * @param int $year the year for which Saint Martins Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Saint Martins Day needs to be tested + * @param \DateTime $expected the expected date */ - public function teststMartinsDay(int $year, DateTime $expected): void + public function teststMartinsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function teststMartinsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Saint Martins Day. * - * @return array list of test dates for Saint Martins Day + * @return array list of test dates for Saint Martins Day * - * @throws Exception + * @throws \Exception */ public function stMartinsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function stMartinsDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Carinthia/CarinthiaBaseTestCase.php b/tests/Austria/Carinthia/CarinthiaBaseTestCase.php index 5f3a7a4b9..efac35984 100644 --- a/tests/Austria/Carinthia/CarinthiaBaseTestCase.php +++ b/tests/Austria/Carinthia/CarinthiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Carinthia/CarinthiaTest.php b/tests/Austria/Carinthia/CarinthiaTest.php index 79e9acb3b..f201f29ba 100644 --- a/tests/Austria/Carinthia/CarinthiaTest.php +++ b/tests/Austria/Carinthia/CarinthiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Carinthia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CarinthiaTest extends CarinthiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Carinthia (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -72,8 +71,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Carinthia (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -82,8 +79,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Carinthia (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -92,8 +87,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Carinthia (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -102,8 +95,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Carinthia (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -111,7 +102,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Carinthia/PlebisciteDayTest.php b/tests/Austria/Carinthia/PlebisciteDayTest.php index 4241d288a..1c01cf677 100644 --- a/tests/Austria/Carinthia/PlebisciteDayTest.php +++ b/tests/Austria/Carinthia/PlebisciteDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria\Carinthia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class PlebisciteDayTest extends CarinthiaBaseTestCase implements HolidayTestCase * * @dataProvider PlebisciteDayDataProvider * - * @param int $year the year for which Plebiscite Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Plebiscite Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testPlebisciteDay(int $year, DateTime $expected): void + public function testPlebisciteDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testPlebisciteDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Plebiscite Day. * - * @return array list of test dates for Plebiscite Day + * @return array list of test dates for Plebiscite Day * - * @throws Exception + * @throws \Exception */ public function PlebisciteDayDataProvider(): array { @@ -64,7 +58,7 @@ public function PlebisciteDayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-10", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-10", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function PlebisciteDayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Carinthia/StJosephsDayTest.php b/tests/Austria/Carinthia/StJosephsDayTest.php index 1ac72f817..f2be80fb5 100644 --- a/tests/Austria/Carinthia/StJosephsDayTest.php +++ b/tests/Austria/Carinthia/StJosephsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Carinthia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StJosephsDayTest extends CarinthiaBaseTestCase implements HolidayTestCase * * @dataProvider StJosephsDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested. - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param \DateTime $expected the expected date */ - public function testStJosephsDay(int $year, DateTime $expected): void + public function testStJosephsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStJosephsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day. + * @return array list of test dates for St. Joseph's Day. * - * @throws Exception + * @throws \Exception */ public function StJosephsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StJosephsDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/ChristmasTest.php b/tests/Austria/ChristmasTest.php index 7c243fd5f..c4a056369 100644 --- a/tests/Austria/ChristmasTest.php +++ b/tests/Austria/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends AustriaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/CorpusChristiTest.php b/tests/Austria/CorpusChristiTest.php index 1b5dfe0fa..af83540e7 100644 --- a/tests/Austria/CorpusChristiTest.php +++ b/tests/Austria/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -46,14 +42,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/EasterMondayTest.php b/tests/Austria/EasterMondayTest.php index e3b3fafcd..1e05bd2aa 100644 --- a/tests/Austria/EasterMondayTest.php +++ b/tests/Austria/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/EasterTest.php b/tests/Austria/EasterTest.php index 362f49c16..9c2d68a71 100644 --- a/tests/Austria/EasterTest.php +++ b/tests/Austria/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/EpiphanyTest.php b/tests/Austria/EpiphanyTest.php index 28bc7b759..d69457f05 100644 --- a/tests/Austria/EpiphanyTest.php +++ b/tests/Austria/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends AustriaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/ImmaculateConceptionTest.php b/tests/Austria/ImmaculateConceptionTest.php index 15c4e12cd..2d3680a4d 100644 --- a/tests/Austria/ImmaculateConceptionTest.php +++ b/tests/Austria/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends AustriaBaseTestCase implements HolidayTes * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/InternationalWorkersDayTest.php b/tests/Austria/InternationalWorkersDayTest.php index b3da186d9..e54a406d1 100644 --- a/tests/Austria/InternationalWorkersDayTest.php +++ b/tests/Austria/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends AustriaBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php b/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php index d9517d7c3..1b939f9e2 100644 --- a/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php +++ b/tests/Austria/LowerAustria/LowerAustriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/LowerAustria/LowerAustriaTest.php b/tests/Austria/LowerAustria/LowerAustriaTest.php index 6295481fb..7fc9884fd 100644 --- a/tests/Austria/LowerAustria/LowerAustriaTest.php +++ b/tests/Austria/LowerAustria/LowerAustriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\LowerAustria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class LowerAustriaTest extends LowerAustriaBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Lower Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Lower Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Lower Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Lower Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Lower Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/LowerAustria/StLeopoldsDayTest.php b/tests/Austria/LowerAustria/StLeopoldsDayTest.php index 39bea4a69..98132ab54 100644 --- a/tests/Austria/LowerAustria/StLeopoldsDayTest.php +++ b/tests/Austria/LowerAustria/StLeopoldsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria\LowerAustria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class StLeopoldsDayTest extends LowerAustriaBaseTestCase implements HolidayTestC * * @dataProvider StLeopoldsDayDataProvider * - * @param int $year the year for which Saint Leopold's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Saint Leopold's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStLeopoldsDay(int $year, DateTime $expected): void + public function testStLeopoldsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testStLeopoldsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Saint Leopold's Day. * - * @return array list of test dates for Saint Leopold's Day + * @return array list of test dates for Saint Leopold's Day * - * @throws Exception + * @throws \Exception */ public function StLeopoldsDayDataProvider(): array { @@ -64,7 +58,7 @@ public function StLeopoldsDayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-11-15", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-11-15", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function StLeopoldsDayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/NationalDayTest.php b/tests/Austria/NationalDayTest.php index 4dae40559..32bc27c7f 100644 --- a/tests/Austria/NationalDayTest.php +++ b/tests/Austria/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NationalDayTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/NewYearsDayTest.php b/tests/Austria/NewYearsDayTest.php index 65c2111f1..d9acdc23a 100644 --- a/tests/Austria/NewYearsDayTest.php +++ b/tests/Austria/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends AustriaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/PentecostMondayTest.php b/tests/Austria/PentecostMondayTest.php index 8a9ef2cd4..4a0baef2f 100644 --- a/tests/Austria/PentecostMondayTest.php +++ b/tests/Austria/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/PentecostTest.php b/tests/Austria/PentecostTest.php index caed66870..adc2206a8 100644 --- a/tests/Austria/PentecostTest.php +++ b/tests/Austria/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends AustriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Salzburg/SalzburgBaseTestCase.php b/tests/Austria/Salzburg/SalzburgBaseTestCase.php index 89083dcfb..5a740671d 100644 --- a/tests/Austria/Salzburg/SalzburgBaseTestCase.php +++ b/tests/Austria/Salzburg/SalzburgBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Salzburg/SalzburgTest.php b/tests/Austria/Salzburg/SalzburgTest.php index b0587b605..e504b2b1b 100644 --- a/tests/Austria/Salzburg/SalzburgTest.php +++ b/tests/Austria/Salzburg/SalzburgTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Salzburg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SalzburgTest extends SalzburgBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Salzburg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Salzburg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Salzburg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Salzburg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Salzburg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Salzburg/StRupertsDayTest.php b/tests/Austria/Salzburg/StRupertsDayTest.php index ce32e822c..da9130474 100644 --- a/tests/Austria/Salzburg/StRupertsDayTest.php +++ b/tests/Austria/Salzburg/StRupertsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Salzburg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StRupertsDayTest extends SalzburgBaseTestCase implements HolidayTestCase * * @dataProvider StRupertsDayDataProvider * - * @param int $year the year for which Saint Rupert's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Saint Rupert's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStRupertsDay(int $year, DateTime $expected): void + public function testStRupertsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStRupertsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Saint Rupert's Day. * - * @return array list of test dates for Saint Rupert's Day + * @return array list of test dates for Saint Rupert's Day * - * @throws Exception + * @throws \Exception */ public function StRupertsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StRupertsDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/SecondChristmasDayTest.php b/tests/Austria/SecondChristmasDayTest.php index 438b37c48..fceab69c3 100644 --- a/tests/Austria/SecondChristmasDayTest.php +++ b/tests/Austria/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends AustriaBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Styria/StJosephsDayTest.php b/tests/Austria/Styria/StJosephsDayTest.php index 090095778..01e07a2a2 100644 --- a/tests/Austria/Styria/StJosephsDayTest.php +++ b/tests/Austria/Styria/StJosephsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Styria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StJosephsDayTest extends StyriaBaseTestCase implements HolidayTestCase * * @dataProvider StJosephsDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested. - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param \DateTime $expected the expected date */ - public function testStJosephsDay(int $year, DateTime $expected): void + public function testStJosephsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStJosephsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day. + * @return array list of test dates for St. Joseph's Day. * - * @throws Exception + * @throws \Exception */ public function StJosephsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StJosephsDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Styria/StyriaBaseTestCase.php b/tests/Austria/Styria/StyriaBaseTestCase.php index afb05d6f4..7213fff41 100644 --- a/tests/Austria/Styria/StyriaBaseTestCase.php +++ b/tests/Austria/Styria/StyriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Styria/StyriaTest.php b/tests/Austria/Styria/StyriaTest.php index 5b1f24e6b..588f4deaa 100644 --- a/tests/Austria/Styria/StyriaTest.php +++ b/tests/Austria/Styria/StyriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Styria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class StyriaTest extends StyriaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Styria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -68,8 +67,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Styria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -78,8 +75,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Styria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -88,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Styria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -98,8 +91,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Styria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -107,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Tyrol/StJosephsDayTest.php b/tests/Austria/Tyrol/StJosephsDayTest.php index 567aa662b..cbc379052 100644 --- a/tests/Austria/Tyrol/StJosephsDayTest.php +++ b/tests/Austria/Tyrol/StJosephsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Tyrol; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StJosephsDayTest extends TyrolBaseTestCase implements HolidayTestCase * * @dataProvider StJosephsDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested. - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param \DateTime $expected the expected date */ - public function testStJosephsDay(int $year, DateTime $expected): void + public function testStJosephsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStJosephsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day. + * @return array list of test dates for St. Joseph's Day. * - * @throws Exception + * @throws \Exception */ public function StJosephsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StJosephsDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Tyrol/TyrolBaseTestCase.php b/tests/Austria/Tyrol/TyrolBaseTestCase.php index 02d58ad8c..4e6249fc3 100644 --- a/tests/Austria/Tyrol/TyrolBaseTestCase.php +++ b/tests/Austria/Tyrol/TyrolBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Tyrol/TyrolTest.php b/tests/Austria/Tyrol/TyrolTest.php index ac08b857c..6ec9cc0c5 100644 --- a/tests/Austria/Tyrol/TyrolTest.php +++ b/tests/Austria/Tyrol/TyrolTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Tyrol; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class TyrolTest extends TyrolBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Tyrol (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -68,8 +67,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Tyrol (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -78,8 +75,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Tyrol (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -88,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Tyrol (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -98,8 +91,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Tyrol (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -107,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/UpperAustria/StFloriansDayTest.php b/tests/Austria/UpperAustria/StFloriansDayTest.php index ea884ad4c..e5b0743b6 100644 --- a/tests/Austria/UpperAustria/StFloriansDayTest.php +++ b/tests/Austria/UpperAustria/StFloriansDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\UpperAustria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StFloriansDayTest extends UpperAustriaBaseTestCase implements HolidayTestC * * @dataProvider StFloriansDayDataProvider * - * @param int $year the year for which Saint Florian's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Saint Florian's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStFloriansDay(int $year, DateTime $expected): void + public function testStFloriansDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStFloriansDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Saint Florian's Day. * - * @return array list of test dates for Saint Florian's Day + * @return array list of test dates for Saint Florian's Day * - * @throws Exception + * @throws \Exception */ public function StFloriansDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StFloriansDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php b/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php index 0cb75ac95..c7c11e9f2 100644 --- a/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php +++ b/tests/Austria/UpperAustria/UpperAustriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/UpperAustria/UpperAustriaTest.php b/tests/Austria/UpperAustria/UpperAustriaTest.php index a6c91b0cf..0b8232530 100644 --- a/tests/Austria/UpperAustria/UpperAustriaTest.php +++ b/tests/Austria/UpperAustria/UpperAustriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\UpperAustria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class UpperAustriaTest extends UpperAustriaBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Upper Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Upper Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Upper Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Upper Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Upper Austria (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Vienna/StLeopoldsDayTest.php b/tests/Austria/Vienna/StLeopoldsDayTest.php index 261eea595..3b3302239 100644 --- a/tests/Austria/Vienna/StLeopoldsDayTest.php +++ b/tests/Austria/Vienna/StLeopoldsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Austria\Vienna; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class StLeopoldsDayTest extends ViennaBaseTestCase implements HolidayTestCase * * @dataProvider StLeopoldsDayDataProvider * - * @param int $year the year for which Saint Leopold's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Saint Leopold's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStLeopoldsDay(int $year, DateTime $expected): void + public function testStLeopoldsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testStLeopoldsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Saint Leopold's Day. * - * @return array list of test dates for Saint Leopold's Day + * @return array list of test dates for Saint Leopold's Day * - * @throws Exception + * @throws \Exception */ public function StLeopoldsDayDataProvider(): array { @@ -64,7 +58,7 @@ public function StLeopoldsDayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-11-15", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-11-15", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function StLeopoldsDayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Vienna/ViennaBaseTestCase.php b/tests/Austria/Vienna/ViennaBaseTestCase.php index ba54eb780..835df2050 100644 --- a/tests/Austria/Vienna/ViennaBaseTestCase.php +++ b/tests/Austria/Vienna/ViennaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Vienna/ViennaTest.php b/tests/Austria/Vienna/ViennaTest.php index 8eebe56ce..822347236 100644 --- a/tests/Austria/Vienna/ViennaTest.php +++ b/tests/Austria/Vienna/ViennaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Vienna; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ViennaTest extends ViennaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Vienna (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Vienna (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Vienna (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Vienna (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Vienna (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Austria/Vorarlberg/StJosephsDayTest.php b/tests/Austria/Vorarlberg/StJosephsDayTest.php index d1b08d0a0..525009e1b 100644 --- a/tests/Austria/Vorarlberg/StJosephsDayTest.php +++ b/tests/Austria/Vorarlberg/StJosephsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Austria\Vorarlberg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StJosephsDayTest extends VorarlbergBaseTestCase implements HolidayTestCase * * @dataProvider StJosephsDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested. - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested. + * @param \DateTime $expected the expected date */ - public function testStJosephsDay(int $year, DateTime $expected): void + public function testStJosephsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStJosephsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day. + * @return array list of test dates for St. Joseph's Day. * - * @throws Exception + * @throws \Exception */ public function StJosephsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function StJosephsDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php b/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php index e270d2622..eb8b24220 100644 --- a/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php +++ b/tests/Austria/Vorarlberg/VorarlbergBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Austria/Vorarlberg/VorarlbergTest.php b/tests/Austria/Vorarlberg/VorarlbergTest.php index 24c7713ac..e3147b601 100644 --- a/tests/Austria/Vorarlberg/VorarlbergTest.php +++ b/tests/Austria/Vorarlberg/VorarlbergTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Austria\Vorarlberg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class VorarlbergTest extends VorarlbergBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Vorarlberg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -68,8 +67,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Vorarlberg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -78,8 +75,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Vorarlberg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -88,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Vorarlberg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -98,8 +91,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Vorarlberg (Austria) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -107,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Base/HolidayBetweenFilterTest.php b/tests/Base/HolidayBetweenFilterTest.php index b8f91f1be..8cb860d81 100644 --- a/tests/Base/HolidayBetweenFilterTest.php +++ b/tests/Base/HolidayBetweenFilterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,39 +14,23 @@ namespace Yasumi\tests\Base; -use DateTime; -use DateTimeImmutable; -use DateTimeZone; -use Exception; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; -use ReflectionException; use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; -/** - * Class HolidayBetweenFilterTest. - * - * Contains tests for testing the BetweenFilter class - */ class HolidayBetweenFilterTest extends TestCase { use YasumiBase; - /** - * Tests the basic usage of the BetweenFilter. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRange(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); $between = $holidays->between( - new DateTime('03/25/2016', new DateTimeZone($timezone)), - new DateTime('07/25/2016', new DateTimeZone($timezone)) + new \DateTime('03/25/2016', new \DateTimeZone($timezone)), + new \DateTime('07/25/2016', new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -88,20 +72,15 @@ public function testHolidaysBetweenDateRange(): void self::assertNotEquals(\count($holidays), $between->count()); } - /** - * Tests the basic usage of the BetweenFilter using DateTimeImmutable objects. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRangeWithDateTimeImmutable(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); $between = $holidays->between( - new DateTimeImmutable('03/25/2016', new DateTimeZone($timezone)), - new DateTimeImmutable('07/25/2016', new DateTimeZone($timezone)) + new \DateTimeImmutable('03/25/2016', new \DateTimeZone($timezone)), + new \DateTimeImmutable('07/25/2016', new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -143,12 +122,7 @@ public function testHolidaysBetweenDateRangeWithDateTimeImmutable(): void self::assertNotEquals(\count($holidays), $between->count()); } - /** - * Tests that BetweenFilter considers the date and ignores timezones and time of day. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRangeDifferentTimezone(): void { $holidays = Yasumi::create('Netherlands', 2016); @@ -157,33 +131,28 @@ public function testHolidaysBetweenDateRangeDifferentTimezone(): void foreach ($timezones as $timezone) { $between = $holidays->between( - new DateTime('01/01/2016', new DateTimeZone($timezone)), - new DateTime('01/01/2016', new DateTimeZone($timezone)) + new \DateTime('01/01/2016', new \DateTimeZone($timezone)), + new \DateTime('01/01/2016', new \DateTimeZone($timezone)) ); self::assertCount(1, $between); $between = $holidays->between( - new DateTime('01/01/2016 23:59:59', new DateTimeZone($timezone)), - new DateTime('01/01/2016 23:59:59', new DateTimeZone($timezone)) + new \DateTime('01/01/2016 23:59:59', new \DateTimeZone($timezone)), + new \DateTime('01/01/2016 23:59:59', new \DateTimeZone($timezone)) ); self::assertCount(1, $between); } } - /** - * Tests the BetweenFilter with date range where start and end date are exclusive of the comparison. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRangeExclusiveStartEndDate(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); $between = $holidays->between( - new DateTime('01/01/2016', new DateTimeZone($timezone)), - new DateTime('07/25/2016', new DateTimeZone($timezone)), + new \DateTime('01/01/2016', new \DateTimeZone($timezone)), + new \DateTime('07/25/2016', new \DateTimeZone($timezone)), false ); @@ -226,12 +195,7 @@ public function testHolidaysBetweenDateRangeExclusiveStartEndDate(): void self::assertNotEquals(\count($holidays), $between->count()); } - /** - * Tests the BetweenFilter where the start date lies before the year of the Holiday Provider instance. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRangeWithStartBeforeInstanceYear(): void { $year = 2015; @@ -239,8 +203,8 @@ public function testHolidaysBetweenDateRangeWithStartBeforeInstanceYear(): void $holidays = Yasumi::create('Norway', $year); $between = $holidays->between( - new DateTime('03/25/2011', new DateTimeZone($timezone)), - new DateTime('05/17/'.$year, new DateTimeZone($timezone)) + new \DateTime('03/25/2011', new \DateTimeZone($timezone)), + new \DateTime('05/17/'.$year, new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -266,12 +230,7 @@ public function testHolidaysBetweenDateRangeWithStartBeforeInstanceYear(): void self::assertNotEquals(\count($holidays), $between->count()); } - /** - * Tests the BetweenFilter where the end date lies beyond the year of the Holiday Provider instance. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testHolidaysBetweenDateRangeWithEndAfterInstanceYear(): void { $year = 2000; @@ -279,8 +238,8 @@ public function testHolidaysBetweenDateRangeWithEndAfterInstanceYear(): void $holidays = Yasumi::create('Italy', $year); $between = $holidays->between( - new DateTime('03/25/'.$year, new DateTimeZone($timezone)), - new DateTime('09/21/2021', new DateTimeZone($timezone)) + new \DateTime('03/25/'.$year, new \DateTimeZone($timezone)), + new \DateTime('09/21/2021', new \DateTimeZone($timezone)) ); $betweenHolidays = iterator_to_array($between); @@ -306,23 +265,18 @@ public function testHolidaysBetweenDateRangeWithEndAfterInstanceYear(): void self::assertNotEquals(\count($holidays), $between->count()); } - /** - * Tests that an InvalidArgumentException is thrown in case an invalid holiday provider is given. - * - * @throws Exception - * @throws ReflectionException - */ + /** @throws \Exception */ public function testWrongDates(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $year = 2017; $timezone = 'America/New_York'; $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)) ); } @@ -331,8 +285,7 @@ public function testWrongDates(): void * * This test covers the scenario that the requested date range covers all know holidays. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCountBetweenWithSubstitutes(): void { @@ -342,8 +295,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); @@ -372,8 +325,7 @@ public function testCountBetweenWithSubstitutes(): void * * This test covers the scenario that the requested date range excludes a substituted holiday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCountBetweenExcludingSubstituteHoliday(): void { @@ -383,8 +335,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); @@ -417,8 +369,7 @@ public function testCountBetweenExcludingSubstituteHoliday(): void * This test covers the scenario that the requested date range excludes a substituted holiday, but includes * the original substituted holiday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCountBetweenExcludingSubstituteHolidayIncludingOriginalHoliday(): void { @@ -428,8 +379,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); @@ -463,8 +414,7 @@ public function testCountBetweenExcludingSubstituteHolidayIncludingOriginalHolid * This test covers the scenario that the requested date range excludes a substituted holiday and also * the original substituted holiday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCountBetweenExcludingSubstituteHolidayAndOriginalHoliday(): void { @@ -474,8 +424,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 b2b41797e..5aca68812 100644 --- a/tests/Base/HolidayFiltersTest.php +++ b/tests/Base/HolidayFiltersTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Base; use PHPUnit\Framework\TestCase; -use ReflectionException; use Yasumi\Filters\BankHolidaysFilter; use Yasumi\Filters\ObservedHolidaysFilter; use Yasumi\Filters\OfficialHolidaysFilter; @@ -24,20 +23,10 @@ use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; -/** - * Class HolidayFiltersTest. - * - * Contains tests for testing the filter classes - */ class HolidayFiltersTest extends TestCase { use YasumiBase; - /** - * Tests the Official Holidays filter. - * - * @throws ReflectionException - */ public function testOfficialHolidaysFilter(): void { // There are 11 official holidays in Ireland in the year 2018, with 1 substituted holiday. @@ -68,11 +57,6 @@ public function testOfficialHolidaysFilter(): void self::assertNotEquals(\count($holidays), $filteredHolidays->count()); } - /** - * Tests the Observed Holidays filter. - * - * @throws ReflectionException - */ public function testObservedHolidaysFilter(): void { // There are 2 observed holidays in Ireland in the year 2018. @@ -103,11 +87,6 @@ public function testObservedHolidaysFilter(): void self::assertNotEquals(\count($holidays), $filteredHolidays->count()); } - /** - * Tests Bank Holidays. - * - * @throws ReflectionException - */ public function testBankHolidaysFilter(): void { // There are no bank holidays in Ireland in the year 2018. @@ -138,11 +117,6 @@ public function testBankHolidaysFilter(): void self::assertNotEquals(\count($holidays), $filteredHolidays->count()); } - /** - * Tests Seasonal Holidays. - * - * @throws ReflectionException - */ public function testSeasonalHolidaysFilter(): void { $holidays = Yasumi::create('Netherlands', 2017); @@ -187,11 +161,6 @@ public function testSeasonalHolidaysFilter(): void self::assertNotEquals(\count($holidays), $filteredHolidays->count()); } - /** - * Tests other type of Holidays. - * - * @throws ReflectionException - */ public function testOtherHolidaysFilter(): void { $holidays = Yasumi::create('Netherlands', 2017); diff --git a/tests/Base/HolidayOnFilterTest.php b/tests/Base/HolidayOnFilterTest.php index e95a069fe..301e61270 100644 --- a/tests/Base/HolidayOnFilterTest.php +++ b/tests/Base/HolidayOnFilterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,38 +14,24 @@ namespace Yasumi\tests\Base; -use DateTime; -use DateTimeZone; -use Exception; use PHPUnit\Framework\TestCase; -use ReflectionException; use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; -/** - * Class HolidayOnFilterTest. - * - * Contains tests for testing the OnFilter class - */ class HolidayOnFilterTest extends TestCase { use YasumiBase; - /** - * Tests the basic usage of the OnFilter. - * - * @throws ReflectionException - * @throws Exception - */ + /** @throws \Exception */ public function testHolidaysOnDate(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); $holidayDates = [ - 'goodFriday' => new DateTime('03/25/2016', new DateTimeZone($timezone)), - 'easter' => new DateTime('03/27/2016', new DateTimeZone($timezone)), - 'summerTime' => new DateTime('03/27/2016', new DateTimeZone($timezone)), + 'goodFriday' => new \DateTime('03/25/2016', new \DateTimeZone($timezone)), + 'easter' => new \DateTime('03/27/2016', new \DateTimeZone($timezone)), + 'summerTime' => new \DateTime('03/27/2016', new \DateTimeZone($timezone)), ]; foreach ($holidayDates as $name => $date) { @@ -57,19 +43,16 @@ public function testHolidaysOnDate(): void } } - /** - * @throws ReflectionException - * @throws Exception - */ + /** @throws \Exception */ public function testHolidaysNotOnDate(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); $holidayWrongDates = [ - 'goodFriday' => new DateTime('04/25/2016', new DateTimeZone($timezone)), - 'easter' => new DateTime('03/22/2016', new DateTimeZone($timezone)), - 'summerTime' => new DateTime('12/27/2016', new DateTimeZone($timezone)), + 'goodFriday' => new \DateTime('04/25/2016', new \DateTimeZone($timezone)), + 'easter' => new \DateTime('03/22/2016', new \DateTimeZone($timezone)), + 'summerTime' => new \DateTime('12/27/2016', new \DateTimeZone($timezone)), ]; foreach ($holidayWrongDates as $name => $date) { @@ -81,25 +64,22 @@ public function testHolidaysNotOnDate(): void } } - /** - * @throws ReflectionException - * @throws Exception - */ + /** @throws \Exception */ public function testCorrectNumberOfHolidaysOnDate(): void { $timezone = 'Europe/Amsterdam'; $holidays = Yasumi::create('Netherlands', 2016); // No holidays - $holidaysOnDate = $holidays->on(new DateTime('11/19/2016', new DateTimeZone($timezone))); + $holidaysOnDate = $holidays->on(new \DateTime('11/19/2016', new \DateTimeZone($timezone))); self::assertEquals(0, $holidaysOnDate->count()); // One holiday - $holidaysOnDate = $holidays->on(new DateTime('12/25/2016', new DateTimeZone($timezone))); + $holidaysOnDate = $holidays->on(new \DateTime('12/25/2016', new \DateTimeZone($timezone))); self::assertEquals(1, $holidaysOnDate->count()); // Multiple holidays - $holidaysOnDate = $holidays->on(new DateTime('03/27/2016', new DateTimeZone($timezone))); + $holidaysOnDate = $holidays->on(new \DateTime('03/27/2016', new \DateTimeZone($timezone))); self::assertGreaterThan(1, $holidaysOnDate->count()); } } diff --git a/tests/Base/HolidayTest.php b/tests/Base/HolidayTest.php index 8bd9eba42..39d9be320 100644 --- a/tests/Base/HolidayTest.php +++ b/tests/Base/HolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Base; -use DateTime; -use DateTimeImmutable; -use Exception; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Yasumi\Exception\MissingTranslationException; use Yasumi\Exception\UnknownLocaleException; @@ -25,47 +21,30 @@ use Yasumi\tests\YasumiBase; use Yasumi\TranslationsInterface; -/** - * Class HolidayTest. - * - * Contains tests for testing the Holiday class - */ class HolidayTest extends TestCase { use YasumiBase; - /** - * Tests that an InvalidArgumentException is thrown in case a blank key is given. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayBlankKeyInvalidArgumentException(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); - new Holiday('', [], new DateTime()); + new Holiday('', [], new \DateTime()); } - /** - * Tests that an Yasumi\Exception\UnknownLocaleException is thrown in case an invalid locale is given. - * - * @throws Exception - */ + /** @throws \Exception */ public function testCreateHolidayUnknownLocaleException(): void { $this->expectException(UnknownLocaleException::class); - new Holiday('testHoliday', [], new DateTime(), 'wx-YZ'); + new Holiday('testHoliday', [], new \DateTime(), 'wx-YZ'); } - /** - * Tests that a Yasumi holiday instance can be serialized to a JSON object. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayIsJsonSerializable(): void { - $holiday = new Holiday('testHoliday', [], new DateTime(), 'en_US'); + $holiday = new Holiday('testHoliday', [], new \DateTime(), 'en_US'); $json = json_encode($holiday, JSON_THROW_ON_ERROR); $instance = json_decode($json, true, 512, JSON_THROW_ON_ERROR); @@ -74,33 +53,24 @@ public function testHolidayIsJsonSerializable(): void self::assertArrayHasKey('shortName', $instance); } - /** - * Tests that a Yasumi holiday instance can be created using an object that implements the DateTimeInterface (e.g. - * DateTime or DateTimeImmutable). - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayWithDateTimeInterface(): void { // Assert with DateTime instance - $holiday = new Holiday('testHoliday', [], new DateTime(), 'en_US'); + $holiday = new Holiday('testHoliday', [], new \DateTime(), 'en_US'); self::assertNotNull($holiday); self::assertInstanceOf(Holiday::class, $holiday); // Assert with DateTimeImmutable instance - $holiday = new Holiday('testHoliday', [], new DateTimeImmutable(), 'en_US'); + $holiday = new Holiday('testHoliday', [], new \DateTimeImmutable(), 'en_US'); self::assertNotNull($holiday); self::assertInstanceOf(Holiday::class, $holiday); } - /** - * Tests the getLocales function of the Holiday object. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetLocales(): void { - $holiday = new Holiday('testHoliday', [], new DateTime(), 'ca_ES_VALENCIA'); + $holiday = new Holiday('testHoliday', [], new \DateTime(), 'ca_ES_VALENCIA'); $method = new \ReflectionMethod(Holiday::class, 'getLocales'); $method->setAccessible(true); @@ -109,11 +79,7 @@ public function testHolidayGetLocales(): void self::assertEquals(['de_DE', 'de', Holiday::LOCALE_KEY], $method->invoke($holiday, ['de_DE', Holiday::LOCALE_KEY])); } - /** - * Tests the getName function of the Holiday object without any arguments provided. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithoutArgument(): void { // 'en_US' fallback @@ -124,16 +90,16 @@ public function testHolidayGetNameWithoutArgument(): void 'en_US' => 'Holiday EN-US', ]; - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_AT'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de_AT'); self::assertEquals('Holiday DE-AT', $holiday->getName()); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de'); self::assertEquals('Holiday DE', $holiday->getName()); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de_DE'); self::assertEquals('Holiday DE', $holiday->getName()); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'ja'); self::assertEquals('Holiday EN-US', $holiday->getName()); // 'en' fallback @@ -142,10 +108,10 @@ public function testHolidayGetNameWithoutArgument(): void 'en' => 'Holiday EN', ]; - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de_DE'); self::assertEquals('Holiday DE', $holiday->getName()); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'ja'); self::assertEquals('Holiday EN', $holiday->getName()); // No 'en' or 'en_US' fallback @@ -153,19 +119,14 @@ public function testHolidayGetNameWithoutArgument(): void 'de' => 'Holiday DE', ]; - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de_DE'); self::assertEquals('Holiday DE', $holiday->getName()); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'ja'); self::assertEquals('testHoliday', $holiday->getName()); } - /** - * Tests the getName function of the Holiday object with an explicit list of locales. - * - * @throws MissingTranslationException - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithArgument(): void { $translations = [ @@ -175,7 +136,7 @@ public function testHolidayGetNameWithArgument(): void 'it_IT' => 'Holiday IT-IT', 'en_US' => 'Holiday EN-US', ]; - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'de_DE'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'de_DE'); self::assertEquals('Holiday DE', $holiday->getName(['de'])); self::assertEquals('Holiday DE', $holiday->getName(['ja', 'de', 'nl', 'it_IT'])); @@ -190,18 +151,14 @@ public function testHolidayGetNameWithArgument(): void self::assertEquals('Holiday IT-IT', $holiday->getName(['it_IT', Holiday::LOCALE_KEY])); self::assertEquals('testHoliday', $holiday->getName([Holiday::LOCALE_KEY])); - $holiday = new Holiday('testHoliday', $translations, new DateTime(), 'ja'); + $holiday = new Holiday('testHoliday', $translations, new \DateTime(), 'ja'); self::assertEquals('Holiday EN-US', $holiday->getName()); $this->expectException(MissingTranslationException::class); $holiday->getName(['it']); } - /** - * Tests the getName function of the Holiday object with global translations and no custom translation. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithGlobalTranslations(): void { $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); @@ -215,7 +172,7 @@ public function testHolidayGetNameWithGlobalTranslations(): void $locale = 'pl_PL'; - $holiday = new Holiday('newYearsDay', [], new DateTime('2015-01-01'), $locale); + $holiday = new Holiday('newYearsDay', [], new \DateTime('2015-01-01'), $locale); $holiday->mergeGlobalTranslations($translationsStub); self::assertNotNull($holiday->getName()); @@ -223,11 +180,7 @@ public function testHolidayGetNameWithGlobalTranslations(): void self::assertEquals($translations[$locale], $holiday->getName()); } - /** - * Tests the getName function of the Holiday object with global translations and no custom translation. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithGlobalParentLocaleTranslations(): void { $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); @@ -241,7 +194,7 @@ public function testHolidayGetNameWithGlobalParentLocaleTranslations(): void $locale = 'pl_PL'; - $holiday = new Holiday('newYearsDay', [], new DateTime('2015-01-01'), $locale); + $holiday = new Holiday('newYearsDay', [], new \DateTime('2015-01-01'), $locale); $holiday->mergeGlobalTranslations($translationsStub); self::assertNotNull($holiday->getName()); @@ -249,11 +202,7 @@ public function testHolidayGetNameWithGlobalParentLocaleTranslations(): void self::assertEquals($translations['pl'], $holiday->getName()); } - /** - * Tests the getName function of the Holiday object with global translations and a new custom translation. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithGlobalAndCustomTranslations(): void { $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); @@ -271,7 +220,7 @@ public function testHolidayGetNameWithGlobalAndCustomTranslations(): void $holiday = new Holiday( 'newYearsDay', [$customLocale => $customTranslation], - new DateTime('2015-01-01'), + new \DateTime('2015-01-01'), $customLocale ); $holiday->mergeGlobalTranslations($translationsStub); @@ -281,11 +230,7 @@ public function testHolidayGetNameWithGlobalAndCustomTranslations(): void self::assertEquals($customTranslation, $holiday->getName()); } - /** - * Tests the getName function of the Holiday object with global translations and an overriding custom translation. - * - * @throws Exception - */ + /** @throws \Exception */ public function testHolidayGetNameWithOverridenGlobalTranslations(): void { $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); @@ -303,7 +248,7 @@ public function testHolidayGetNameWithOverridenGlobalTranslations(): void $holiday = new Holiday( 'newYearsDay', [$customLocale => $customTranslation], - new DateTime('2014-01-01'), + new \DateTime('2014-01-01'), $customLocale ); $holiday->mergeGlobalTranslations($translationsStub); diff --git a/tests/Base/SubstituteHolidayTest.php b/tests/Base/SubstituteHolidayTest.php index 9ceca52ad..2ca55e6ca 100644 --- a/tests/Base/SubstituteHolidayTest.php +++ b/tests/Base/SubstituteHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Base; -use DateTime; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; @@ -23,27 +21,18 @@ use Yasumi\tests\YasumiBase; use Yasumi\TranslationsInterface; -/** - * Class SubstituteHolidayTest. - * - * Contains tests for testing the SubstituteHoliday class - */ class SubstituteHolidayTest extends TestCase { use YasumiBase; - /** - * Tests that an UnknownLocaleException is thrown in case an invalid locale is given. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testCreateSubstituteHolidayUnknownLocaleException(): void { - $holiday = new Holiday('testHoliday', [], new DateTime()); + $holiday = new Holiday('testHoliday', [], new \DateTime()); $this->expectException(UnknownLocaleException::class); - new SubstituteHoliday($holiday, [], new DateTime(), 'wx-YZ'); + new SubstituteHoliday($holiday, [], new \DateTime(), 'wx-YZ'); } /** @@ -53,38 +42,30 @@ public function testCreateSubstituteHolidayUnknownLocaleException(): void */ public function testCreateSubstituteHolidaySameDate(): void { - $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01')); + $holiday = new Holiday('testHoliday', [], new \DateTime('2019-01-01')); - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); - new SubstituteHoliday($holiday, [], new DateTime('2019-01-01')); + new SubstituteHoliday($holiday, [], new \DateTime('2019-01-01')); } - /** - * Tests the constructor. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testConstructor(): void { - $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US', Holiday::TYPE_BANK); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US', Holiday::TYPE_SEASON); + $holiday = new Holiday('testHoliday', [], new \DateTime('2019-01-01'), 'en_US', Holiday::TYPE_BANK); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), 'en_US', Holiday::TYPE_SEASON); self::assertSame($holiday, $substitute->getSubstitutedHoliday()); self::assertEquals('substituteHoliday:testHoliday', $substitute->getKey()); self::assertEquals(Holiday::TYPE_SEASON, $substitute->getType()); - self::assertEquals(new DateTime('2019-01-02'), $substitute); + self::assertEquals(new \DateTime('2019-01-02'), $substitute); } - /** - * Tests that a Yasumi holiday instance can be serialized to a JSON object. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayIsJsonSerializable(): void { - $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US'); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US'); + $holiday = new Holiday('testHoliday', [], new \DateTime('2019-01-01'), 'en_US'); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), 'en_US'); $json = json_encode($substitute, JSON_THROW_ON_ERROR); $instance = json_decode($json, true, 512, JSON_THROW_ON_ERROR); @@ -94,17 +75,12 @@ public function testSubstituteHolidayIsJsonSerializable(): void self::assertArrayHasKey('substitutedHoliday', $instance); } - /** - * Tests that a Yasumi holiday instance can be created using an object that implements the DateTimeInterface (e.g. - * DateTime or DateTimeImmutable). - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayWithDateTimeInterface(): void { // Assert with DateTime instance - $holiday = new Holiday('testHoliday', [], new DateTime('2019-01-01'), 'en_US'); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US'); + $holiday = new Holiday('testHoliday', [], new \DateTime('2019-01-01'), 'en_US'); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), 'en_US'); self::assertNotNull($holiday); self::assertInstanceOf(SubstituteHoliday::class, $substitute); @@ -114,33 +90,25 @@ public function testSubstituteHolidayWithDateTimeInterface(): void self::assertInstanceOf(SubstituteHoliday::class, $substitute); } - /** - * Tests the getName function of the SubstituteHoliday object with no translations for the name given. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayGetNameWithNoTranslations(): void { $name = 'testHoliday'; - $holiday = new Holiday($name, [], new DateTime('2019-01-01')); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), 'en_US'); + $holiday = new Holiday($name, [], new \DateTime('2019-01-01')); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), 'en_US'); self::assertIsString($substitute->getName()); self::assertEquals('substituteHoliday:'.$name, $substitute->getName()); } - /** - * Tests the getName function of the SubstituteHoliday object when it has a custom translation. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): void { $name = 'testHoliday'; $translation = 'My Holiday'; $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); + $holiday = new Holiday($name, [$locale => 'foo'], new \DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new \DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub @@ -159,18 +127,14 @@ public function testSubstituteHolidayGetNameWithCustomSubstituteTranslation(): v self::assertEquals($translation, $substitute->getName()); } - /** - * Tests the getName function of the SubstituteHoliday object when substitute holiday pattern uses fallback. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayGetNameWithPatternFallback(): void { $name = 'testHoliday'; $translation = 'My Holiday'; $locale = 'en_US'; - $holiday = new Holiday($name, [], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); + $holiday = new Holiday($name, [], new \DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub @@ -189,18 +153,14 @@ public function testSubstituteHolidayGetNameWithPatternFallback(): void self::assertEquals('My Holiday obs', $substitute->getName()); } - /** - * Tests the getName function of the SubstituteHoliday object when it has a global translation. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayGetNameWithGlobalSubstituteTranslation(): void { $name = 'testHoliday'; $translation = 'My Substitute'; $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => 'foo'], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new DateTime('2019-01-02'), $locale); + $holiday = new Holiday($name, [$locale => 'foo'], new \DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [$locale => $translation], new \DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub @@ -219,18 +179,14 @@ public function testSubstituteHolidayGetNameWithGlobalSubstituteTranslation(): v self::assertEquals($translation, $substitute->getName()); } - /** - * Tests the getName function of the SubstituteHoliday object when only the substituted holiday has a translation. - * - * @throws \Exception - */ + /** @throws \Exception */ public function testSubstituteHolidayGetNameWithSubstitutedTranslation(): void { $name = 'testHoliday'; $translation = 'My Holiday'; $locale = 'en_US'; - $holiday = new Holiday($name, [$locale => $translation], new DateTime('2019-01-01'), $locale); - $substitute = new SubstituteHoliday($holiday, [], new DateTime('2019-01-02'), $locale); + $holiday = new Holiday($name, [$locale => $translation], new \DateTime('2019-01-01'), $locale); + $substitute = new SubstituteHoliday($holiday, [], new \DateTime('2019-01-02'), $locale); $translationsStub = $this->getMockBuilder(TranslationsInterface::class)->getMock(); $translationsStub diff --git a/tests/Base/TranslationsTest.php b/tests/Base/TranslationsTest.php index d62d3b05d..6768a5a14 100644 --- a/tests/Base/TranslationsTest.php +++ b/tests/Base/TranslationsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,17 +14,11 @@ namespace Yasumi\tests\Base; -use InvalidArgumentException; use org\bovigo\vfs\vfsStream; use PHPUnit\Framework\TestCase; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Translations; -/** - * Class TranslationsTest. - * - * Contains tests for testing the Translations class - */ class TranslationsTest extends TestCase { public const LOCALES = [ @@ -33,9 +27,6 @@ class TranslationsTest extends TestCase 'pl_PL', ]; - /** - * Tests adding single translation. - */ public function testAddTranslation(): void { $translations = new Translations(self::LOCALES); @@ -58,9 +49,6 @@ public function testAddTranslation(): void self::assertEquals($translation, $translations->getTranslation($key, $locale)); } - /** - * Tests adding multiple translations. - */ public function testAddMultipleTranslations(): void { $translations = new Translations(self::LOCALES); @@ -111,9 +99,6 @@ public function testAddMultipleTranslations(): void self::assertEquals($thirdTranslation, $translations->getTranslation($thirdIdentifier, $thirdLocale)); } - /** - * Tests that an UnknownLocaleException is thrown when adding translation for unknown locale. - */ public function testAddTranslationUnknownLocaleException(): void { $this->expectException(UnknownLocaleException::class); @@ -127,9 +112,6 @@ public function testAddTranslationUnknownLocaleException(): void $translations->addTranslation($key, $unknownLocale, $translation); } - /** - * Tests that no translation is returned for an unknown holiday. - */ public function testNoTranslationForUnknownHoliday(): void { $translations = new Translations(self::LOCALES); @@ -146,9 +128,6 @@ public function testNoTranslationForUnknownHoliday(): void self::assertEmpty($translations->getTranslations($unknownIdentifier)); } - /** - * Tests that no translation is returned for not translated locale. - */ public function testNoTranslationForNotTranslatedLocale(): void { $translations = new Translations(self::LOCALES); @@ -164,9 +143,6 @@ public function testNoTranslationForNotTranslatedLocale(): void self::assertNull($translations->getTranslation($key, $unknownLocale)); } - /** - * Tests loading one translation file from directory. - */ public function testLoadingTranslationsFromDirectory(): void { $key = 'newYearsDay'; @@ -193,9 +169,6 @@ public function testLoadingTranslationsFromDirectory(): void self::assertEquals($translation, $translations->getTranslation($key, $locale)); } - /** - * Tests that translation is not loaded from file with invalid extension. - */ public function testNotLoadingTranslationsFromFileWithInvalidExtension(): void { $key = 'newYearsDay'; @@ -217,9 +190,6 @@ public function testNotLoadingTranslationsFromFileWithInvalidExtension(): void self::assertEmpty($translations->getTranslations($key)); } - /** - * Tests that an UnknownLocaleException is thrown when loading translation with unknown locale(s). - */ public function testLoadingTranslationsFromDirectoryWithUnknownLocaleException(): void { $this->expectException(UnknownLocaleException::class); @@ -239,12 +209,9 @@ public function testLoadingTranslationsFromDirectoryWithUnknownLocaleException() $translations->loadTranslations(vfsStream::url('root/lang')); } - /** - * Tests that an InvalidArgumentException is thrown when loading translation from inexistent directory. - */ public function testLoadingTranslationsFromInexistentDirectory(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); vfsStream::setup(); @@ -252,9 +219,6 @@ public function testLoadingTranslationsFromInexistentDirectory(): void $translations->loadTranslations(vfsStream::url('root/lang')); } - /** - * Tests loading more than one translation file from directory. - */ public function testLoadingMultipleTranslationsFromDirectory(): void { $firstIdentifier = 'newYearsDay'; diff --git a/tests/Base/TypographyTest.php b/tests/Base/TypographyTest.php index ccdd52dd5..4f187b526 100644 --- a/tests/Base/TypographyTest.php +++ b/tests/Base/TypographyTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -49,7 +49,10 @@ public function testTranslations(string $name, string $class, string $key, strin /** * Provides test data for testProvider(). * + * @return array list of test translations + * * @throws \ReflectionException + * @throws \Exception */ public function translationProvider(): array { diff --git a/tests/Base/WeekendTest.php b/tests/Base/WeekendTest.php index 182e965df..edcf7f038 100644 --- a/tests/Base/WeekendTest.php +++ b/tests/Base/WeekendTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -35,8 +35,6 @@ class WeekendTest extends TestCase * Holiday Provider is created. * * @dataProvider dataProviderWeekendDays - * - * @throws \ReflectionException */ public function testWeekendDay(\DateTimeImmutable $date): void { @@ -48,6 +46,8 @@ public function testWeekendDay(\DateTimeImmutable $date): void } /** + * @return array list of test dates that are considered a weekend date + * * @throws \Exception */ public function dataProviderWeekendDays(): array @@ -77,8 +77,6 @@ public function dataProviderWeekendDays(): array * Holiday Provider is created. * * @dataProvider dataProviderNonWeekendDays - * - * @throws \ReflectionException */ public function testNonWeekendDay(\DateTimeImmutable $date): void { @@ -90,6 +88,8 @@ public function testNonWeekendDay(\DateTimeImmutable $date): void } /** + * @return array list of test dates that are considered not a weekend date + * * @throws \Exception */ public function dataProviderNonWeekendDays(): array diff --git a/tests/Base/YasumiExternalProvider.php b/tests/Base/YasumiExternalProvider.php index 224f0f6a1..086e5c09a 100644 --- a/tests/Base/YasumiExternalProvider.php +++ b/tests/Base/YasumiExternalProvider.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,16 +16,8 @@ use Yasumi\Provider\AbstractProvider; -/** - * Class YasumiExternalProvider. - * - * Class for testing the use of an external holiday provider class. - */ class YasumiExternalProvider extends AbstractProvider { - /** - * Initialize country holidays. - */ public function initialize(): void { // We don't actually have to do anything here. diff --git a/tests/Base/YasumiTest.php b/tests/Base/YasumiTest.php index 2a94f3153..388ed0933 100644 --- a/tests/Base/YasumiTest.php +++ b/tests/Base/YasumiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,12 +14,7 @@ namespace Yasumi\tests\Base; -use DateTime; -use DateTimeImmutable; -use Exception; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; -use ReflectionException; use Yasumi\Exception\InvalidYearException; use Yasumi\Exception\ProviderNotFoundException; use Yasumi\Exception\UnknownLocaleException; @@ -27,30 +22,14 @@ use Yasumi\tests\YasumiBase; use Yasumi\Yasumi; -/** - * Class YasumiTest. - * - * Contains tests for testing the Holiday class - */ class YasumiTest extends TestCase { use YasumiBase; - /** - * The lower year limit supported by Yasumi. - */ public const YEAR_LOWER_BOUND = 1000; - /** - * The upper year limit supported by Yasumi. - */ public const YEAR_UPPER_BOUND = 9999; - /** - * Tests that an InvalidArgumentException is thrown in case an invalid year is given. - * - * @throws ReflectionException - */ public function testCreateWithInvalidYear(): void { $this->expectException(InvalidYearException::class); @@ -58,11 +37,6 @@ public function testCreateWithInvalidYear(): void Yasumi::create('Japan', 10100); } - /** - * Tests that an InvalidArgumentException is thrown in case an invalid holiday provider is given. - * - * @throws ReflectionException - */ public function testCreateWithInvalidProvider(): void { $this->expectException(ProviderNotFoundException::class); @@ -70,35 +44,20 @@ public function testCreateWithInvalidProvider(): void Yasumi::create('Mars'); } - /** - * Tests that an InvalidArgumentException is thrown in case we try to load a Trait as provider. - * - * @throws ReflectionException - */ public function testCreateWithInvalidProviderBecauseItsATrait(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Yasumi::create('CommonHolidays'); } - /** - * Tests that an InvalidArgumentException is thrown in case we try to load the AbstractProvider as provider. - * - * @throws ReflectionException - */ public function testCreateWithAbstractClassProvider(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Yasumi::create('AbstractProvider'); } - /** - * Tests that Yasumi allows external classes that extend the ProviderInterface. - * - * @throws ReflectionException - */ public function testCreateWithAbstractExtension(): void { $class = YasumiExternalProvider::class; @@ -109,11 +68,6 @@ public function testCreateWithAbstractExtension(): void self::assertInstanceOf(YasumiExternalProvider::class, $instance); } - /** - * Tests that an Yasumi\Exception\UnknownLocaleException is thrown in case an invalid locale is given. - * - * @throws ReflectionException - */ public function testCreateWithInvalidLocale(): void { $this->expectException(UnknownLocaleException::class); @@ -125,11 +79,6 @@ public function testCreateWithInvalidLocale(): void ); } - /** - * Tests that the count function returns an integer and a correct count for the test holiday provider. - * - * @throws ReflectionException - */ public function testCount(): void { // There are 16 holidays in Japan in the year 2015, with 1 substituted holiday. @@ -140,11 +89,6 @@ public function testCount(): void self::assertNotEquals(17, $holidays->count()); } - /** - * Tests that the getType function returns a string for the test holiday provider. - * - * @throws ReflectionException - */ public function testGetType(): void { $holidays = Yasumi::create('Japan', self::numberBetween(1949, self::YEAR_UPPER_BOUND)); @@ -153,11 +97,6 @@ public function testGetType(): void self::assertIsString($holiday->getType()); } - /** - * Tests that the getYear function returns an integer for the test holiday provider. - * - * @throws ReflectionException - */ public function testGetYear(): void { $year = self::numberBetween(self::YEAR_LOWER_BOUND, self::YEAR_UPPER_BOUND); @@ -170,7 +109,7 @@ public function testGetYear(): void /** * Tests that the next function returns the next upcoming date (i.e. next year) for the given holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testNext(): void { @@ -183,14 +122,9 @@ public function testNext(): void $this->assertHoliday($country, $name, $year + 1, $holidays->next($name)); } - /** - * Tests the next function that an InvalidArgumentException is thrown in case a blank name is given. - * - * @throws ReflectionException - */ public function testNextWithBlankKey(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $holidays = Yasumi::create( 'Netherlands', @@ -202,7 +136,7 @@ public function testNextWithBlankKey(): void /** * Tests the previous function returns the previous date (i.e. previous year) for the given holiday. * - * @throws ReflectionException + * @throws \Exception */ public function testPrevious(): void { @@ -216,19 +150,14 @@ public function testPrevious(): void $this->assertHoliday( $country, $name, - (($year > $year_lower_limit) ? $year - 1 : $year_lower_limit), + ($year > $year_lower_limit) ? $year - 1 : $year_lower_limit, $holidays->previous($name) ); } - /** - * Tests the previous function that an InvalidArgumentException is thrown in case a blank name is given. - * - * @throws ReflectionException - */ public function testPreviousWithBlankKey(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $holidays = Yasumi::create( 'Netherlands', @@ -237,11 +166,6 @@ public function testPreviousWithBlankKey(): void $holidays->previous(''); } - /** - * Tests that the getHolidayNames function returns an array and a correct count for the test holiday provider. - * - * @throws ReflectionException - */ public function testGetHolidayNames(): void { $holidays = Yasumi::create('Japan', 2015); @@ -252,11 +176,6 @@ public function testGetHolidayNames(): void self::assertContains('newYearsDay', $holidayNames); } - /** - * Tests that the WhenIs function returns a string representation of the date the given holiday occurs. - * - * @throws ReflectionException - */ public function testWhenIs(): void { $holidays = Yasumi::create('Japan', 2010); @@ -267,38 +186,22 @@ public function testWhenIs(): void self::assertEquals('2010-09-23', $when); } - /** - * Tests that the WhenIs function throws an InvalidArgumentException when a blank key is given. - * - * @throws ReflectionException - */ public function testWhenIsWithBlankKey(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $holidays = Yasumi::create('Japan', 2010); $holidays->whenIs(''); } - /** - * Tests that an InvalidArgumentException is thrown in case a blank name is given for the getHoliday function. - * - * @throws ReflectionException - */ public function testGetHolidayWithBlankKey(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $holidays = Yasumi::create('Netherlands', 1999); $holidays->getHoliday(''); } - /** - * Tests that the whatWeekDayIs function returns an integer representation of the day of the week the given holiday - * is occurring. - * - * @throws ReflectionException - */ public function testWhatWeekDayIs(): void { $holidays = Yasumi::create('Netherlands', 2110); @@ -308,14 +211,9 @@ public function testWhatWeekDayIs(): void self::assertEquals(2, $weekDay); } - /** - * Tests that the whatWeekDayIs function throws an InvalidArgumentException when a blank name is given. - * - * @throws ReflectionException - */ public function testWhatWeekDayIsWithBlankKey(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $holidays = Yasumi::create('Netherlands', 2388); $holidays->whatWeekDayIs(''); @@ -324,7 +222,7 @@ public function testWhatWeekDayIsWithBlankKey(): void /** * Tests that the getProviders function returns an array containing all available holiday providers. * - * @throws ReflectionException + * @throws \ReflectionException */ public function testGetProviders(): void { @@ -340,7 +238,7 @@ public function testGetProviders(): void /** * Tests that the getProviders function (static call) returns the same data when called again. * - * @throws ReflectionException + * @throws \ReflectionException */ public function testGetProvidersStaticCall(): void { @@ -365,10 +263,7 @@ public function testGetProvidersStaticCall(): void * Note that this function does *NOT* determine whether a date is a working or non-working day. It * only asserts that it is a date calculated by the Holiday Provider. * - * @throws Exception - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIsHoliday(): void { @@ -377,12 +272,12 @@ public function testIsHoliday(): void $date = $year.'-08-15'; // Assertion using a DateTime instance - $isHoliday = Yasumi::create($provider, $year)->isHoliday(new DateTime($date)); + $isHoliday = Yasumi::create($provider, $year)->isHoliday(new \DateTime($date)); self::assertIsBool($isHoliday); self::assertTrue($isHoliday); // Assertion using a DateTimeImmutable instance - $isHoliday = Yasumi::create($provider, $year)->isHoliday(new DateTimeImmutable($date)); + $isHoliday = Yasumi::create($provider, $year)->isHoliday(new \DateTimeImmutable($date)); self::assertIsBool($isHoliday); self::assertTrue($isHoliday); @@ -395,10 +290,7 @@ public function testIsHoliday(): void * Note that this function does *NOT* determine whether a date is a working or non-working day. It * only asserts that it is a date calculated by the Holiday Provider. * - * @throws Exception - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIsNotHoliday(): void { @@ -407,12 +299,12 @@ public function testIsNotHoliday(): void $date = $year.'-06-10'; // Assertion using a DateTime instance - $isHoliday = Yasumi::create($provider, $year)->isHoliday(new DateTime($date)); + $isHoliday = Yasumi::create($provider, $year)->isHoliday(new \DateTime($date)); self::assertIsBool($isHoliday); self::assertFalse($isHoliday); // Assertion using a DateTimeImmutable instance - $isHoliday = Yasumi::create($provider, $year)->isHoliday(new DateTimeImmutable($date)); + $isHoliday = Yasumi::create($provider, $year)->isHoliday(new \DateTimeImmutable($date)); self::assertIsBool($isHoliday); self::assertFalse($isHoliday); @@ -425,10 +317,7 @@ public function testIsNotHoliday(): void * * @TODO Add additional unit tests for those holiday providers that differ from the global definition * - * @throws Exception - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIsWorkingDay(): void { @@ -437,12 +326,12 @@ public function testIsWorkingDay(): void $date = $year.'-06-02'; // Assertion using a DateTime instance - $isWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new DateTime($date)); + $isWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTime($date)); self::assertIsBool($isWorkingDay); self::assertTrue($isWorkingDay); // Assertion using a DateTimeImmutable instance - $isWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new DateTimeImmutable($date)); + $isWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTimeImmutable($date)); self::assertIsBool($isWorkingDay); self::assertTrue($isWorkingDay); @@ -455,10 +344,7 @@ public function testIsWorkingDay(): void * * @TODO Add additional unit tests for those holiday providers that differ from the global definition * - * @throws Exception - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIsNotWorkingDay(): void { @@ -467,23 +353,18 @@ public function testIsNotWorkingDay(): void $date = $year.'-01-11'; // Assertion using a DateTime instance - $isNotWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new DateTime($date)); + $isNotWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTime($date)); self::assertIsBool($isNotWorkingDay); self::assertFalse($isNotWorkingDay); // Assertion using a DateTimeImmutable instance - $isNotWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new DateTimeImmutable($date)); + $isNotWorkingDay = Yasumi::create($provider, $year)->isWorkingDay(new \DateTimeImmutable($date)); self::assertIsBool($isNotWorkingDay); self::assertFalse($isNotWorkingDay); unset($isNotWorkingDay); } - /** - * Tests that holidays successfully can be removed from the list of holidays of a provider. - * - * @throws ReflectionException - */ public function testRemoveHoliday(): void { $provider = Yasumi::create('Ireland', 2018); @@ -532,7 +413,7 @@ public function testRemoveHoliday(): void * Tests that a holiday provider instance can be created by using the ISO3166-2 * country/region code. (Using the Yasumi::createByISO3166_2 method). * - * @throws ReflectionException + * @throws \ReflectionException */ public function testCreateByISO31662(): void { @@ -553,7 +434,7 @@ public function testCreateByISO31662(): void * Tests that a ProviderNotFoundException is thrown when providing a invalid * ISO3166-2 code when using the Yasumi::createByISO3166_2 method. * - * @throws ReflectionException + * @throws \ReflectionException */ public function testCreateByISO31662WithInvalidCode(): void { @@ -566,15 +447,15 @@ public function testCreateByISO31662WithInvalidCode(): void * Tests that a holiday can be added to a provider. In addition, it * tests that the same holiday instance isn't added twice. * - * @throws ReflectionException - * @throws Exception + * @throws \ReflectionException + * @throws \Exception */ public function testAddExistingHoliday(): void { $provider = Yasumi::createByISO3166_2('NL', 2019); $holidayName = 'testHoliday'; - $holiday = new Holiday($holidayName, [], new DateTime()); + $holiday = new Holiday($holidayName, [], new \DateTime()); $originalHolidays = $provider->getHolidayNames(); // Add a new holiday diff --git a/tests/Base/YasumiWorkdayTest.php b/tests/Base/YasumiWorkdayTest.php index f626f1101..61c9d6f6b 100644 --- a/tests/Base/YasumiWorkdayTest.php +++ b/tests/Base/YasumiWorkdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,19 +14,9 @@ namespace Yasumi\tests\Base; -use DateTime; -use DateTimeImmutable; -use DateTimeZone; -use Exception; use PHPUnit\Framework\TestCase; -use ReflectionException; use Yasumi\Yasumi; -/** - * Class YasumiWorkdayTest. - * - * Class for testing the workday functions. - */ class YasumiWorkdayTest extends TestCase { public const FORMAT_DATE = 'Y-m-d'; @@ -34,8 +24,7 @@ class YasumiWorkdayTest extends TestCase /** * Tests that the nextWorkingDay function returns an object that implements the DateTimeInterface (e.g. DateTime). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNextWorkingDay(): void { @@ -46,25 +35,24 @@ public function testNextWorkingDay(): void $expectedDate = '2016-07-05'; // Assertion using a DateTime instance - $startDate = new DateTime($date, new DateTimeZone($timezone)); + $startDate = new \DateTime($date, new \DateTimeZone($timezone)); $nextWorkingDay = Yasumi::nextWorkingDay($provider, $startDate); - self::assertInstanceOf(DateTime::class, $nextWorkingDay); + self::assertInstanceOf(\DateTimeImmutable::class, $nextWorkingDay); self::assertEquals($expectedDate, $nextWorkingDay->format(self::FORMAT_DATE)); // Assertion using a DateTimeImmutable instance - $startDate = new DateTimeImmutable($date, new DateTimeZone($timezone)); + $startDate = new \DateTimeImmutable($date, new \DateTimeZone($timezone)); $nextWorkingDay = Yasumi::nextWorkingDay($provider, $startDate); - self::assertInstanceOf(DateTimeImmutable::class, $nextWorkingDay); + self::assertInstanceOf(\DateTimeImmutable::class, $nextWorkingDay); self::assertEquals($expectedDate, $nextWorkingDay->format(self::FORMAT_DATE)); } /** * Tests that the prevWorkingDay function returns an object that implements the DateTimeInterface (e.g. DateTime). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPreviousWorkingDay(): void { @@ -75,17 +63,17 @@ public function testPreviousWorkingDay(): void $expectedDate = '2016-07-01'; // Assertion using a DateTime instance - $startDate = new DateTime($date, new DateTimeZone($timezone)); + $startDate = new \DateTime($date, new \DateTimeZone($timezone)); $previousWorkingDay = Yasumi::prevWorkingDay($provider, $startDate); - self::assertInstanceOf(DateTime::class, $previousWorkingDay); + self::assertInstanceOf(\DateTimeImmutable::class, $previousWorkingDay); self::assertEquals($expectedDate, $previousWorkingDay->format(self::FORMAT_DATE)); // Assertion using a DateTimeImmutable instance - $startDate = new DateTimeImmutable($date, new DateTimeZone($timezone)); + $startDate = new \DateTimeImmutable($date, new \DateTimeZone($timezone)); $previousWorkingDay = Yasumi::prevWorkingDay($provider, $startDate); - self::assertInstanceOf(DateTimeImmutable::class, $previousWorkingDay); + self::assertInstanceOf(\DateTimeImmutable::class, $previousWorkingDay); self::assertEquals($expectedDate, $previousWorkingDay->format(self::FORMAT_DATE)); } @@ -93,8 +81,7 @@ public function testPreviousWorkingDay(): void * Tests that the prevWorkingDay and nextWorkingDay functions returns an object that implements the * DateTimeInterface (e.g. DateTime) when an interval is chosen that passes the year boundary (i.e. beyond 12/31). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testYearBoundary(): void { @@ -123,22 +110,22 @@ public function testYearBoundary(): void $expectedPrevious = '2015-12-18'; // Assertion using a DateTime instance - $startDate = new DateTime($start, new DateTimeZone($timezone)); + $startDate = new \DateTime($start, new \DateTimeZone($timezone)); $nextWorkingDay = Yasumi::nextWorkingDay($provider, $startDate, $interval); self::assertEquals($expectedNext, $nextWorkingDay->format(self::FORMAT_DATE)); - $startDate = new DateTime($expectedNext, new DateTimeZone($timezone)); + $startDate = new \DateTime($expectedNext, new \DateTimeZone($timezone)); $previousWorkingDay = Yasumi::prevWorkingDay($provider, $startDate, $interval); self::assertEquals($expectedPrevious, $previousWorkingDay->format(self::FORMAT_DATE)); // Assertion using a DateTimeImmutable instance - $startDate = new DateTimeImmutable($start, new DateTimeZone($timezone)); + $startDate = new \DateTimeImmutable($start, new \DateTimeZone($timezone)); $nextWorkingDay = Yasumi::nextWorkingDay($provider, $startDate, $interval); self::assertEquals($expectedNext, $nextWorkingDay->format(self::FORMAT_DATE)); - $startDate = new DateTimeImmutable($expectedNext, new DateTimeZone($timezone)); + $startDate = new \DateTimeImmutable($expectedNext, new \DateTimeZone($timezone)); $previousWorkingDay = Yasumi::prevWorkingDay($provider, $startDate, $interval); self::assertEquals($expectedPrevious, $previousWorkingDay->format(self::FORMAT_DATE)); } @@ -148,19 +135,21 @@ public function testYearBoundary(): void * * @dataProvider dataProviderWorkDayNextYear * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testWorkDayIsNextYear(string $start, int $workdays, string $expectedNext): void { $provider = 'USA'; $timezone = 'America/New_York'; - $startDate = new DateTime($start, new DateTimeZone($timezone)); + $startDate = new \DateTime($start, new \DateTimeZone($timezone)); $nextWorkingDay = Yasumi::nextWorkingDay($provider, $startDate, $workdays); self::assertEquals($expectedNext, $nextWorkingDay->format(self::FORMAT_DATE)); } + /** + * @return array list of test dates that are considered working days the next year + */ public function dataProviderWorkDayNextYear(): array { return [ @@ -182,19 +171,21 @@ public function dataProviderWorkDayNextYear(): array * * @dataProvider dataProviderWorkDayPreviousYear * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testWorkDayIsPreviousYear(string $start, int $workdays, string $expectedNext): void { $provider = 'USA'; $timezone = 'America/New_York'; - $startDate = new DateTime($start, new DateTimeZone($timezone)); + $startDate = new \DateTime($start, new \DateTimeZone($timezone)); $previousWorkingDay = Yasumi::prevWorkingDay($provider, $startDate, $workdays); self::assertEquals($expectedNext, $previousWorkingDay->format(self::FORMAT_DATE)); } + /** + * @return array list of test dates that are considered working days the previous year + */ public function dataProviderWorkDayPreviousYear(): array { return [ diff --git a/tests/Belgium/AllSaintsDayTest.php b/tests/Belgium/AllSaintsDayTest.php index 618b06697..7cbbac972 100644 --- a/tests/Belgium/AllSaintsDayTest.php +++ b/tests/Belgium/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends BelgiumBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/ArmisticeDayTest.php b/tests/Belgium/ArmisticeDayTest.php index f20462363..5874ec435 100644 --- a/tests/Belgium/ArmisticeDayTest.php +++ b/tests/Belgium/ArmisticeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ArmisticeDayTest extends BelgiumBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/AscensionDayTest.php b/tests/Belgium/AscensionDayTest.php index d094730df..3ce364b8b 100644 --- a/tests/Belgium/AscensionDayTest.php +++ b/tests/Belgium/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends BelgiumBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/AssumptionOfMaryTest.php b/tests/Belgium/AssumptionOfMaryTest.php index 549afb17f..22d3be99c 100644 --- a/tests/Belgium/AssumptionOfMaryTest.php +++ b/tests/Belgium/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends BelgiumBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/BelgiumBaseTestCase.php b/tests/Belgium/BelgiumBaseTestCase.php index 91c389538..aea9a725b 100644 --- a/tests/Belgium/BelgiumBaseTestCase.php +++ b/tests/Belgium/BelgiumBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Belgium/BelgiumTest.php b/tests/Belgium/BelgiumTest.php index 28779e5ed..34ea40870 100644 --- a/tests/Belgium/BelgiumTest.php +++ b/tests/Belgium/BelgiumTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Belgium; -use ReflectionException; use Yasumi\Holiday; /** @@ -29,6 +28,8 @@ class BelgiumTest extends BelgiumBaseTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -37,8 +38,6 @@ protected function setUp(): void /** * Tests if all official holidays in Belgium are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Belgium are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +67,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Belgium are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +75,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Belgium are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,8 +83,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Belgium are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -99,7 +90,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Belgium/ChristmasTest.php b/tests/Belgium/ChristmasTest.php index 655962ded..d6f07af38 100644 --- a/tests/Belgium/ChristmasTest.php +++ b/tests/Belgium/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends BelgiumBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/EasterMondayTest.php b/tests/Belgium/EasterMondayTest.php index 9ecfb2cfa..596caad31 100644 --- a/tests/Belgium/EasterMondayTest.php +++ b/tests/Belgium/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends BelgiumBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/EasterTest.php b/tests/Belgium/EasterTest.php index c09320ff3..42f5ab775 100644 --- a/tests/Belgium/EasterTest.php +++ b/tests/Belgium/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends BelgiumBaseTestCase implements HolidayTestCase /** * Tests Easter. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEaster(): void { @@ -44,14 +39,14 @@ public function testEaster(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/InternationalWorkersDayTest.php b/tests/Belgium/InternationalWorkersDayTest.php index fb1b2dbb5..f1b16ba14 100644 --- a/tests/Belgium/InternationalWorkersDayTest.php +++ b/tests/Belgium/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends BelgiumBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/NationalDayTest.php b/tests/Belgium/NationalDayTest.php index fa70f1a51..aed1295eb 100644 --- a/tests/Belgium/NationalDayTest.php +++ b/tests/Belgium/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NationalDayTest extends BelgiumBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/NewYearsDayTest.php b/tests/Belgium/NewYearsDayTest.php index 4d8de94d1..928032f9a 100644 --- a/tests/Belgium/NewYearsDayTest.php +++ b/tests/Belgium/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends BelgiumBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/PentecostTest.php b/tests/Belgium/PentecostTest.php index 0a1dfbaf4..55201dd2b 100644 --- a/tests/Belgium/PentecostTest.php +++ b/tests/Belgium/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends BelgiumBaseTestCase implements HolidayTestCase /** * Tests Pentecost. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Belgium/pentecostMondayTest.php b/tests/Belgium/pentecostMondayTest.php index 61c4607f8..ac044c216 100644 --- a/tests/Belgium/pentecostMondayTest.php +++ b/tests/Belgium/pentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Belgium; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class pentecostMondayTest extends BelgiumBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, 'pentecostMonday', $year, - new DateTime("$year-6-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/BosniaBaseTestCase.php b/tests/Bosnia/BosniaBaseTestCase.php index 141d295cd..dd03e70a6 100644 --- a/tests/Bosnia/BosniaBaseTestCase.php +++ b/tests/Bosnia/BosniaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Bosnia/BosniaTest.php b/tests/Bosnia/BosniaTest.php index 381461ef9..c8b9d284b 100644 --- a/tests/Bosnia/BosniaTest.php +++ b/tests/Bosnia/BosniaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Bosnia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BosniaTest extends BosniaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Bosnia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Bosnia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Bosnia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Bosnia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Bosnia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Bosnia/ChristmasDayTest.php b/tests/Bosnia/ChristmasDayTest.php index e4c1195fd..50dd8b67f 100644 --- a/tests/Bosnia/ChristmasDayTest.php +++ b/tests/Bosnia/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends BosniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/DayAfterNewYearsDay.php b/tests/Bosnia/DayAfterNewYearsDay.php index 4f214f8cc..d1bb4e169 100644 --- a/tests/Bosnia/DayAfterNewYearsDay.php +++ b/tests/Bosnia/DayAfterNewYearsDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class DayAfterNewYearsDay extends BosniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/EasterTest.php b/tests/Bosnia/EasterTest.php index 655fd6305..fb088ee14 100644 --- a/tests/Bosnia/EasterTest.php +++ b/tests/Bosnia/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends BosniaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/IndependenceDayTest.php b/tests/Bosnia/IndependenceDayTest.php index d57fdf9dd..94515b3be 100644 --- a/tests/Bosnia/IndependenceDayTest.php +++ b/tests/Bosnia/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndependenceDayTest extends BosniaBaseTestCase implements HolidayTestCase /** * Tests Independence Day on or after 1992. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayOnAfter1992(): void { @@ -49,14 +44,14 @@ public function testIndependenceDayOnAfter1992(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Independence Day before 1992. * - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayBefore1992(): void { @@ -70,7 +65,7 @@ public function testIndependenceDayBefore1992(): void /** * Tests translated name of Independence Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/InternationalWorkersDayTest.php b/tests/Bosnia/InternationalWorkersDayTest.php index aed695158..96f061fff 100644 --- a/tests/Bosnia/InternationalWorkersDayTest.php +++ b/tests/Bosnia/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends BosniaBaseTestCase implements HolidayT * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Bosnia/NewYearsDayTest.php b/tests/Bosnia/NewYearsDayTest.php index f0a7ac3ec..d923dd555 100644 --- a/tests/Bosnia/NewYearsDayTest.php +++ b/tests/Bosnia/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends BosniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/OrthodoxChristmasDay.php b/tests/Bosnia/OrthodoxChristmasDay.php index 2ed5e63ac..22167d93a 100644 --- a/tests/Bosnia/OrthodoxChristmasDay.php +++ b/tests/Bosnia/OrthodoxChristmasDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -31,7 +28,9 @@ class OrthodoxChristmasDay extends BosniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'orthodoxChristmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -40,18 +39,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,9 +59,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Bosnia/SecondLabourDay.php b/tests/Bosnia/SecondLabourDay.php index 0c3389364..d04b0dc7c 100644 --- a/tests/Bosnia/SecondLabourDay.php +++ b/tests/Bosnia/SecondLabourDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondLabourDay extends BosniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Bosnia/StatehoodDayTest.php b/tests/Bosnia/StatehoodDayTest.php index 4d5f0c93f..a893a89a6 100644 --- a/tests/Bosnia/StatehoodDayTest.php +++ b/tests/Bosnia/StatehoodDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Bosnia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class StatehoodDayTest extends BosniaBaseTestCase implements HolidayTestCase /** * Tests Statehood Day on or after 1943. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testStatehoodDayOnAfter1943(): void { @@ -49,14 +44,14 @@ public function testStatehoodDayOnAfter1943(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Statehood Day before 1943. * - * @throws ReflectionException + * @throws \Exception */ public function testStatehoodDayBefore1943(): void { @@ -70,7 +65,7 @@ public function testStatehoodDayBefore1943(): void /** * Tests translated name of Statehood Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/AllSoulsDayTest.php b/tests/Brazil/AllSoulsDayTest.php index ed75ab3ba..7e731bf43 100644 --- a/tests/Brazil/AllSoulsDayTest.php +++ b/tests/Brazil/AllSoulsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AllSoulsDayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Dia dos Finados on or after 1300. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testDiaDosFinadosAfter1300(): void { @@ -49,14 +44,14 @@ public function testDiaDosFinadosAfter1300(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-02", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-02", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Dia dos Finados on or before 1300. * - * @throws ReflectionException + * @throws \Exception */ public function testDiaDosFinadosBefore1300(): void { @@ -67,7 +62,7 @@ public function testDiaDosFinadosBefore1300(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/AshWednesdayTest.php b/tests/Brazil/AshWednesdayTest.php index 69163062f..811dac0c6 100644 --- a/tests/Brazil/AshWednesdayTest.php +++ b/tests/Brazil/AshWednesdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AshWednesdayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ash Wednesday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/BrazilBaseTestCase.php b/tests/Brazil/BrazilBaseTestCase.php index 7d0f89ac0..45e5207ab 100644 --- a/tests/Brazil/BrazilBaseTestCase.php +++ b/tests/Brazil/BrazilBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Brazil/BrazilTest.php b/tests/Brazil/BrazilTest.php index dfb60b96f..0fc5b675c 100644 --- a/tests/Brazil/BrazilTest.php +++ b/tests/Brazil/BrazilTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Brazil; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BrazilTest extends BrazilBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Brazil are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -57,8 +56,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Brazil are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Brazil are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Brazil are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Brazil are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Brazil/CarnavalMondayTest.php b/tests/Brazil/CarnavalMondayTest.php index 26a2afd25..ed1878461 100644 --- a/tests/Brazil/CarnavalMondayTest.php +++ b/tests/Brazil/CarnavalMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -41,8 +38,7 @@ class CarnavalMondayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Carnaval Monday on or after 1700. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalMondayAfter1700(): void { @@ -51,14 +47,14 @@ public function testCarnavalMondayAfter1700(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P48D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P48D')) ); } /** * Tests Carnaval Monday on or before 1700. * - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalMondayBefore1700(): void { @@ -69,7 +65,7 @@ public function testCarnavalMondayBefore1700(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -80,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/CarnavalTuesdayTest.php b/tests/Brazil/CarnavalTuesdayTest.php index ca3b1759b..123653fd4 100644 --- a/tests/Brazil/CarnavalTuesdayTest.php +++ b/tests/Brazil/CarnavalTuesdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -41,8 +38,7 @@ class CarnavalTuesdayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Carnaval Tuesday on or after 1700. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalTuesdayAfter1700(): void { @@ -51,14 +47,14 @@ public function testCarnavalTuesdayAfter1700(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P47D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P47D')) ); } /** * Tests Carnaval Tuesday on or before 1700. * - * @throws ReflectionException + * @throws \Exception */ public function testCarnavalTuesdayBefore1700(): void { @@ -69,7 +65,7 @@ public function testCarnavalTuesdayBefore1700(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -80,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/ChristmasDayTest.php b/tests/Brazil/ChristmasDayTest.php index 603102be9..9c9ef4829 100644 --- a/tests/Brazil/ChristmasDayTest.php +++ b/tests/Brazil/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class ChristmasDayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Christmas Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDay(): void { @@ -44,14 +39,14 @@ public function testChristmasDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/CorpusChristiTest.php b/tests/Brazil/CorpusChristiTest.php index 6752f3c4c..6ebe5894b 100644 --- a/tests/Brazil/CorpusChristiTest.php +++ b/tests/Brazil/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/EasterTest.php b/tests/Brazil/EasterTest.php index b1191ac3b..7af135748 100644 --- a/tests/Brazil/EasterTest.php +++ b/tests/Brazil/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Brazil; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -35,8 +33,7 @@ class EasterTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Easter. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEaster(): void { @@ -47,7 +44,7 @@ public function testEaster(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -62,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/GoodFridayTest.php b/tests/Brazil/GoodFridayTest.php index 81bfb6758..83882be04 100644 --- a/tests/Brazil/GoodFridayTest.php +++ b/tests/Brazil/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class GoodFridayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Good Friday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testGoodFriday(): void { @@ -46,14 +42,14 @@ public function testGoodFriday(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->sub(new DateInterval('P2D')) + $this->calculateEaster($year, self::TIMEZONE)->sub(new \DateInterval('P2D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/IndependenceDayTest.php b/tests/Brazil/IndependenceDayTest.php index 52cd0c361..202aba851 100644 --- a/tests/Brazil/IndependenceDayTest.php +++ b/tests/Brazil/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndependenceDayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Dia da independência do Brasil on or after 1822. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testDiaDaIndependenciaDoBrasilAfter1822(): void { @@ -49,14 +44,14 @@ public function testDiaDaIndependenciaDoBrasilAfter1822(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-09-07", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-09-07", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Dia da independência do Brasil on or before 1822. * - * @throws ReflectionException + * @throws \Exception */ public function testDiaDaIndependenciaDoBrasilBefore1822(): void { @@ -67,7 +62,7 @@ public function testDiaDaIndependenciaDoBrasilBefore1822(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -83,7 +78,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/InternationalWorkersDayTest.php b/tests/Brazil/InternationalWorkersDayTest.php index 65b25690d..a62dfbaf0 100644 --- a/tests/Brazil/InternationalWorkersDayTest.php +++ b/tests/Brazil/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class InternationalWorkersDayTest extends BrazilBaseTestCase implements HolidayT /** * Tests International Workers' Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testInternationalWorkersDay(): void { @@ -44,14 +39,14 @@ public function testInternationalWorkersDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/NewYearsDayTest.php b/tests/Brazil/NewYearsDayTest.php index 2d07d76c5..e69d0a734 100644 --- a/tests/Brazil/NewYearsDayTest.php +++ b/tests/Brazil/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class NewYearsDayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests New Years Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDay(): void { @@ -44,14 +39,14 @@ public function testNewYearsDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/OurLadyOfAparecidaDayTest.php b/tests/Brazil/OurLadyOfAparecidaDayTest.php index d485bb340..b880b9681 100644 --- a/tests/Brazil/OurLadyOfAparecidaDayTest.php +++ b/tests/Brazil/OurLadyOfAparecidaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class OurLadyOfAparecidaDayTest extends BrazilBaseTestCase implements HolidayTes /** * Tests Nossa Senhora Aparecida on or after 1980. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNossaSenhoraAparecidaAfter1980(): void { @@ -49,14 +44,14 @@ public function testNossaSenhoraAparecidaAfter1980(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Nossa Senhora Aparecida on or before 1980. * - * @throws ReflectionException + * @throws \Exception */ public function testNossaSenhoraAparecidaBefore1980(): void { @@ -67,7 +62,7 @@ public function testNossaSenhoraAparecidaBefore1980(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -83,7 +78,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/ProclamationOfRepublicDayTest.php b/tests/Brazil/ProclamationOfRepublicDayTest.php index 7d07e71dc..b628203bc 100644 --- a/tests/Brazil/ProclamationOfRepublicDayTest.php +++ b/tests/Brazil/ProclamationOfRepublicDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ProclamationOfRepublicDayTest extends BrazilBaseTestCase implements Holida /** * Tests Proclamação da República on or after 1889. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testProclamacaoDaRepublicaAfter1889(): void { @@ -49,14 +44,14 @@ public function testProclamacaoDaRepublicaAfter1889(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Proclamação da República on or before 1889. * - * @throws ReflectionException + * @throws \Exception */ public function testProclamacaoDaRepublicaBefore1889(): void { @@ -67,7 +62,7 @@ public function testProclamacaoDaRepublicaBefore1889(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -83,7 +78,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Brazil/TiradentesDayTest.php b/tests/Brazil/TiradentesDayTest.php index 7ae9b3738..211b173ba 100644 --- a/tests/Brazil/TiradentesDayTest.php +++ b/tests/Brazil/TiradentesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Brazil; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class TiradentesDayTest extends BrazilBaseTestCase implements HolidayTestCase /** * Tests Dia de Tiradentes on or after 1792. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testDiaDeTiradentesAfter1792(): void { @@ -49,14 +44,14 @@ public function testDiaDeTiradentesAfter1792(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Dia de Tiradentes on or before 1792. * - * @throws ReflectionException + * @throws \Exception */ public function testDiaDeTiradentesBefore1792(): void { @@ -67,7 +62,7 @@ public function testDiaDeTiradentesBefore1792(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/Alberta/AlbertaBaseTestCase.php b/tests/Canada/Alberta/AlbertaBaseTestCase.php index 835c6216c..5be777f3d 100644 --- a/tests/Canada/Alberta/AlbertaBaseTestCase.php +++ b/tests/Canada/Alberta/AlbertaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Alberta/AlbertaTest.php b/tests/Canada/Alberta/AlbertaTest.php index b5282478a..6e1d1133a 100644 --- a/tests/Canada/Alberta/AlbertaTest.php +++ b/tests/Canada/Alberta/AlbertaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Alberta; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class AlbertaTest extends AlbertaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Alberta are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Alberta are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Alberta are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Alberta are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Alberta are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php b/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php index 6340f2bdf..1f9768a1d 100644 --- a/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php +++ b/tests/Canada/BritishColumbia/BritishColumbiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/BritishColumbia/BritishColumbiaTest.php b/tests/Canada/BritishColumbia/BritishColumbiaTest.php index 0f81006bc..4ed7cf8b6 100644 --- a/tests/Canada/BritishColumbia/BritishColumbiaTest.php +++ b/tests/Canada/BritishColumbia/BritishColumbiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\BritishColumbia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BritishColumbiaTest extends BritishColumbiaBaseTestCase implements Provide /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in BritishColumbia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in BritishColumbia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in BritishColumbia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in BritishColumbia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in BritishColumbia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/CanadaBaseTestCase.php b/tests/Canada/CanadaBaseTestCase.php index 7ba78675c..30f1b7963 100644 --- a/tests/Canada/CanadaBaseTestCase.php +++ b/tests/Canada/CanadaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/CanadaDayTest.php b/tests/Canada/CanadaDayTest.php index 9271a1e04..6b49d1174 100644 --- a/tests/Canada/CanadaDayTest.php +++ b/tests/Canada/CanadaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CanadaDayTest extends CanadaBaseTestCase implements HolidayTestCase /** * Tests Canada Day on or after 1983. Canada Day was established in 1983 on July 1st. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCanadaDayOnAfter1983(): void { @@ -49,21 +44,21 @@ public function testCanadaDayOnAfter1983(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-07-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-07-01", new \DateTimeZone(self::TIMEZONE)) ); $year = 2018; // July 1 is Sunday $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("$year-07-02", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-07-02", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Canada Day before 1879. Canada Day was established as Dominion Day in 1879 on July 1st. * - * @throws ReflectionException + * @throws \Exception */ public function testCanadaDayBefore1879(): void { @@ -77,7 +72,7 @@ public function testCanadaDayBefore1879(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/CanadaTest.php b/tests/Canada/CanadaTest.php index 7658cc233..5911c7323 100644 --- a/tests/Canada/CanadaTest.php +++ b/tests/Canada/CanadaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CanadaTest extends CanadaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Canada are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Canada are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Canada are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Canada are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/ChristmasDayTest.php b/tests/Canada/ChristmasDayTest.php index a0804ee73..2c49e6a32 100644 --- a/tests/Canada/ChristmasDayTest.php +++ b/tests/Canada/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class ChristmasDayTest extends CanadaBaseTestCase implements HolidayTestCase /** * Tests Christmas Day. Christmas Day is celebrated on December 25th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDay(): void { @@ -44,14 +39,14 @@ public function testChristmasDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/LabourDayTest.php b/tests/Canada/LabourDayTest.php index de1ea1044..acc40e099 100644 --- a/tests/Canada/LabourDayTest.php +++ b/tests/Canada/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends CanadaBaseTestCase implements HolidayTestCase /** * Tests Labour Day on or after 1894. Labour Day was established since 1894 on the first Monday of September. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLabourDayOnAfter1894(): void { @@ -49,14 +44,14 @@ public function testLabourDayOnAfter1894(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of september $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of september $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Labour Day before 1894. Labour Day was established since 1894 on the first Monday of September. * - * @throws ReflectionException + * @throws \Exception */ public function testLabourDayBefore1894(): void { @@ -70,7 +65,7 @@ public function testLabourDayBefore1894(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/Manitoba/ManitobaBaseTestCase.php b/tests/Canada/Manitoba/ManitobaBaseTestCase.php index 5d1a6135f..ecee2627a 100644 --- a/tests/Canada/Manitoba/ManitobaBaseTestCase.php +++ b/tests/Canada/Manitoba/ManitobaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Manitoba/ManitobaTest.php b/tests/Canada/Manitoba/ManitobaTest.php index 49db8947d..9a6f27fb0 100644 --- a/tests/Canada/Manitoba/ManitobaTest.php +++ b/tests/Canada/Manitoba/ManitobaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Manitoba; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ManitobaTest extends ManitobaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Manitoba are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Manitoba are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Manitoba are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Manitoba are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Manitoba are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php b/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php index 8f40572db..6cf7afddb 100644 --- a/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php +++ b/tests/Canada/NewBrunswick/NewBrunswickBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/NewBrunswick/NewBrunswickTest.php b/tests/Canada/NewBrunswick/NewBrunswickTest.php index 1982907f9..58fb0afa0 100644 --- a/tests/Canada/NewBrunswick/NewBrunswickTest.php +++ b/tests/Canada/NewBrunswick/NewBrunswickTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\NewBrunswick; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NewBrunswickTest extends NewBrunswickBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in NewBrunswick are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in NewBrunswick are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in NewBrunswick are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in NewBrunswick are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in NewBrunswick are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/NewYearsDayTest.php b/tests/Canada/NewYearsDayTest.php index 544dd784b..625432cad 100644 --- a/tests/Canada/NewYearsDayTest.php +++ b/tests/Canada/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class NewYearsDayTest extends CanadaBaseTestCase implements HolidayTestCase /** * Tests New Years Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDay(): void { @@ -44,14 +39,14 @@ public function testNewYearsDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php index 5004cc16c..b49913339 100644 --- a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php +++ b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php index 54c39795b..bdbfee5ec 100644 --- a/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php +++ b/tests/Canada/NewfoundlandAndLabrador/NewfoundlandAndLabradorTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\NewfoundlandAndLabrador; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NewfoundlandAndLabradorTest extends NewfoundlandAndLabradorBaseTestCase im /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in NewfoundlandAndLabrador are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in NewfoundlandAndLabrador are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -62,8 +59,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in NewfoundlandAndLabrador are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -72,8 +67,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in NewfoundlandAndLabrador are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -85,8 +78,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in NewfoundlandAndLabrador are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -94,7 +85,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php index 9374bcdb4..e06609489 100644 --- a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php +++ b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php index ac47a50d1..8456da287 100644 --- a/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php +++ b/tests/Canada/NorthwestTerritories/NorthwestTerritoriesTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\NorthwestTerritories; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NorthwestTerritoriesTest extends NorthwestTerritoriesBaseTestCase implemen /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in NorthwestTerritories are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in NorthwestTerritories are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in NorthwestTerritories are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in NorthwestTerritories are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in NorthwestTerritories are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php b/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php index 042119d9b..e995c6ce5 100644 --- a/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php +++ b/tests/Canada/NovaScotia/NovaScotiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/NovaScotia/NovaScotiaTest.php b/tests/Canada/NovaScotia/NovaScotiaTest.php index 5806edfe5..dae3f08cf 100644 --- a/tests/Canada/NovaScotia/NovaScotiaTest.php +++ b/tests/Canada/NovaScotia/NovaScotiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\NovaScotia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NovaScotiaTest extends NovaScotiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Nova Scotia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in NovaScotia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in NovaScotia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in NovaScotia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in NovaScotia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/Nunavut/NunavutBaseTestCase.php b/tests/Canada/Nunavut/NunavutBaseTestCase.php index 0b9bf95fd..b2e19f5ed 100644 --- a/tests/Canada/Nunavut/NunavutBaseTestCase.php +++ b/tests/Canada/Nunavut/NunavutBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Nunavut/NunavutTest.php b/tests/Canada/Nunavut/NunavutTest.php index 880323569..7e6bca31d 100644 --- a/tests/Canada/Nunavut/NunavutTest.php +++ b/tests/Canada/Nunavut/NunavutTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Nunavut; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NunavutTest extends NunavutBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Nunavut are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -53,8 +52,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Nunavut are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -63,8 +60,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Nunavut are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -73,8 +68,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Nunavut are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -83,8 +76,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Nunavut are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -92,7 +83,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/Ontario/OntarioBaseTestCase.php b/tests/Canada/Ontario/OntarioBaseTestCase.php index 72106e8ac..a7524dd73 100644 --- a/tests/Canada/Ontario/OntarioBaseTestCase.php +++ b/tests/Canada/Ontario/OntarioBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Ontario/OntarioTest.php b/tests/Canada/Ontario/OntarioTest.php index 871a0f207..7315e5234 100644 --- a/tests/Canada/Ontario/OntarioTest.php +++ b/tests/Canada/Ontario/OntarioTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Ontario; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class OntarioTest extends OntarioBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Ontario are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Ontario are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Ontario are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Ontario are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Ontario are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php index 0e45ff9f8..ed29a99f1 100644 --- a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php +++ b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php index c39180328..3d3ea8bef 100644 --- a/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php +++ b/tests/Canada/PrinceEdwardIsland/PrinceEdwardIslandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\PrinceEdwardIsland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class PrinceEdwardIslandTest extends PrinceEdwardIslandBaseTestCase implements P /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Prince Edward Island are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in PrinceEdwardIsland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in PrinceEdwardIsland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in PrinceEdwardIsland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in PrinceEdwardIsland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/Quebec/QuebecBaseTestCase.php b/tests/Canada/Quebec/QuebecBaseTestCase.php index 590d9a3d0..3113ae29c 100644 --- a/tests/Canada/Quebec/QuebecBaseTestCase.php +++ b/tests/Canada/Quebec/QuebecBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Quebec/QuebecTest.php b/tests/Canada/Quebec/QuebecTest.php index ab7339fdf..beed04054 100644 --- a/tests/Canada/Quebec/QuebecTest.php +++ b/tests/Canada/Quebec/QuebecTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Quebec; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class QuebecTest extends QuebecBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Quebec are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Quebec are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Quebec are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Quebec are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Quebec are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/RemembranceDayTest.php b/tests/Canada/RemembranceDayTest.php index f9bfbac1a..8efae8ae1 100644 --- a/tests/Canada/RemembranceDayTest.php +++ b/tests/Canada/RemembranceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class RemembranceDayTest extends CanadaBaseTestCase implements HolidayTestCase /** * Tests Remembrance Day on or after 1919. Remembrance Day was established in 1919 on November 11. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRemembranceDayOnAfter1919(): void { @@ -49,14 +44,14 @@ public function testRemembranceDayOnAfter1919(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Remembrance Day before 1919. Remembrance Day was established in 1919 on November 11. * - * @throws ReflectionException + * @throws \Exception */ public function testVeteransDayBefore1919(): void { @@ -70,7 +65,7 @@ public function testVeteransDayBefore1919(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php b/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php index 602442471..ea5fe1596 100644 --- a/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php +++ b/tests/Canada/Saskatchewan/SaskatchewanBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Saskatchewan/SaskatchewanTest.php b/tests/Canada/Saskatchewan/SaskatchewanTest.php index 37390de0f..92e228a6d 100644 --- a/tests/Canada/Saskatchewan/SaskatchewanTest.php +++ b/tests/Canada/Saskatchewan/SaskatchewanTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Saskatchewan; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SaskatchewanTest extends SaskatchewanBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Saskatchewan are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Saskatchewan are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Saskatchewan are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Saskatchewan are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Saskatchewan are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Canada/ThanksgivingDayTest.php b/tests/Canada/ThanksgivingDayTest.php index 18155736d..3b46de478 100644 --- a/tests/Canada/ThanksgivingDayTest.php +++ b/tests/Canada/ThanksgivingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ThanksgivingDayTest extends CanadaBaseTestCase implements HolidayTestCase * Tests Thanksgiving Day on or after 1879. Thanksgiving Day is celebrated since 1879 on the second Monday * of October. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testThanksgivingDayOnAfter1879(): void { @@ -50,7 +45,7 @@ public function testThanksgivingDayOnAfter1879(): void self::REGION, self::HOLIDAY, $year, - new DateTime("second monday of october $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("second monday of october $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,7 +53,7 @@ public function testThanksgivingDayOnAfter1879(): void * Tests Thanksgiving Day before 1879. ThanksgivingDay Day is celebrated since 1879 on the second Monday * of October. * - * @throws ReflectionException + * @throws \Exception */ public function testThanksgivingDayBefore1879(): void { @@ -72,7 +67,7 @@ public function testThanksgivingDayBefore1879(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -87,7 +82,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/TruthAndReconciliationDayTest.php b/tests/Canada/TruthAndReconciliationDayTest.php index 3ee107938..be6d8cb8b 100644 --- a/tests/Canada/TruthAndReconciliationDayTest.php +++ b/tests/Canada/TruthAndReconciliationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Canada; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class TruthAndReconciliationDayTest extends CanadaBaseTestCase implements Holida * Tests TruthAndReconciliationDay on or after 2021. Thanksgiving Day is celebrated since 2021 on the last day * of September. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testTruthAndReconciliationDayOnAfter2021(): void { @@ -50,7 +45,7 @@ public function testTruthAndReconciliationDayOnAfter2021(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last day of september $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last day of september $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,7 +53,7 @@ public function testTruthAndReconciliationDayOnAfter2021(): void * Tests TruthAndReconciliationDay before 2021. TruthAndReconciliationDay is celebrated since 2021 on the last day * of September. * - * @throws ReflectionException + * @throws \Exception */ public function testTruthAndReconciliationDayBefore2021(): void { @@ -72,7 +67,7 @@ public function testTruthAndReconciliationDayBefore2021(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -87,7 +82,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Canada/Yukon/YukonBaseTestCase.php b/tests/Canada/Yukon/YukonBaseTestCase.php index 7ad12c9c6..7f57e96f0 100644 --- a/tests/Canada/Yukon/YukonBaseTestCase.php +++ b/tests/Canada/Yukon/YukonBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Canada/Yukon/YukonTest.php b/tests/Canada/Yukon/YukonTest.php index ac7549090..0b8d4edb1 100644 --- a/tests/Canada/Yukon/YukonTest.php +++ b/tests/Canada/Yukon/YukonTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Canada\Yukon; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class YukonTest extends YukonBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Yukon are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -69,8 +68,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Yukon are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -79,8 +76,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Yukon are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -89,8 +84,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Yukon are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -99,8 +92,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Yukon are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -108,7 +99,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Croatia/AllSaintsDayTest.php b/tests/Croatia/AllSaintsDayTest.php index 580bd8467..e693205f5 100644 --- a/tests/Croatia/AllSaintsDayTest.php +++ b/tests/Croatia/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends CroatiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/AntifascistStruggleDayTest.php b/tests/Croatia/AntifascistStruggleDayTest.php index ad5a50171..c42342735 100644 --- a/tests/Croatia/AntifascistStruggleDayTest.php +++ b/tests/Croatia/AntifascistStruggleDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AntifascistStruggleDayTest extends CroatiaBaseTestCase implements HolidayT /** * Tests Day of Antifascist Struggle on or after 1941. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAntifascistStruggleDayOnAfter1941(): void { @@ -49,14 +44,14 @@ public function testAntifascistStruggleDayOnAfter1941(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-22", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-22", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Day of Antifascist Struggle before 1941. * - * @throws ReflectionException + * @throws \Exception */ public function testAntifascistStruggleDayBefore1941(): void { @@ -70,7 +65,7 @@ public function testAntifascistStruggleDayBefore1941(): void /** * Tests translated name of Day of Antifascist Struggle. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/AssumptionOfMaryTest.php b/tests/Croatia/AssumptionOfMaryTest.php index 13e9a14b0..c3bb11246 100644 --- a/tests/Croatia/AssumptionOfMaryTest.php +++ b/tests/Croatia/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends CroatiaBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/ChristmasDayTest.php b/tests/Croatia/ChristmasDayTest.php index f880d080e..5f9ed72e1 100644 --- a/tests/Croatia/ChristmasDayTest.php +++ b/tests/Croatia/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends CroatiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/CorpusChristiTest.php b/tests/Croatia/CorpusChristiTest.php index 20b8bcf01..6e029bfe3 100644 --- a/tests/Croatia/CorpusChristiTest.php +++ b/tests/Croatia/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/CroatiaBaseTestCase.php b/tests/Croatia/CroatiaBaseTestCase.php index 7861cd392..be73b4605 100644 --- a/tests/Croatia/CroatiaBaseTestCase.php +++ b/tests/Croatia/CroatiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Croatia/CroatiaTest.php b/tests/Croatia/CroatiaTest.php index 98652c6a7..9de82b17e 100644 --- a/tests/Croatia/CroatiaTest.php +++ b/tests/Croatia/CroatiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Croatia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CroatiaTest extends CroatiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Croatia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -81,8 +80,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Croatia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -91,8 +88,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Croatia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -101,8 +96,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Croatia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -111,8 +104,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Croatia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -120,7 +111,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Croatia/EasterMondayTest.php b/tests/Croatia/EasterMondayTest.php index 16fca9417..5065fa487 100644 --- a/tests/Croatia/EasterMondayTest.php +++ b/tests/Croatia/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/EasterTest.php b/tests/Croatia/EasterTest.php index 1a20b505d..cd35f92d7 100644 --- a/tests/Croatia/EasterTest.php +++ b/tests/Croatia/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/EpiphanyTest.php b/tests/Croatia/EpiphanyTest.php index 26c6e29bc..ff7530105 100644 --- a/tests/Croatia/EpiphanyTest.php +++ b/tests/Croatia/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends CroatiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/HomelandThanksgivingDayTest.php b/tests/Croatia/HomelandThanksgivingDayTest.php index 1671a54e7..2ea362098 100644 --- a/tests/Croatia/HomelandThanksgivingDayTest.php +++ b/tests/Croatia/HomelandThanksgivingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class HomelandThanksgivingDayTest extends CroatiaBaseTestCase implements Holiday /** * Tests Homeland Thanksgiving Day on or after 1995. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHomelandThanksgivingDayOnAfter1995(): void { @@ -54,14 +49,14 @@ public function testHomelandThanksgivingDayOnAfter1995(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Homeland Thanksgiving Day before 1995. * - * @throws ReflectionException + * @throws \Exception */ public function testHomelandThanksgivingDayBefore1995(): void { @@ -75,7 +70,7 @@ public function testHomelandThanksgivingDayBefore1995(): void /** * Tests translated name of Homeland Thanksgiving Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -101,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/IndependenceDayTest.php b/tests/Croatia/IndependenceDayTest.php index 2ea157559..2157b7952 100644 --- a/tests/Croatia/IndependenceDayTest.php +++ b/tests/Croatia/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class IndependenceDayTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests Independence Day on or after 1991. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayOnAfter1991(): void { @@ -54,14 +49,14 @@ public function testIndependenceDayOnAfter1991(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Independence Day before 1991. * - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayBefore1991(): void { @@ -75,7 +70,7 @@ public function testIndependenceDayBefore1991(): void /** * Tests Independence Day before 1991. * - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayAfterDisbandment(): void { @@ -89,7 +84,7 @@ public function testIndependenceDayAfterDisbandment(): void /** * Tests translated name of Independence Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -104,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/InternationalWorkersDayTest.php b/tests/Croatia/InternationalWorkersDayTest.php index 3b46ad045..67662ab93 100644 --- a/tests/Croatia/InternationalWorkersDayTest.php +++ b/tests/Croatia/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends CroatiaBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Croatia/NewYearsDayTest.php b/tests/Croatia/NewYearsDayTest.php index 26027b6a5..41a0f23d4 100644 --- a/tests/Croatia/NewYearsDayTest.php +++ b/tests/Croatia/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends CroatiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/RemembranceDayTest.php b/tests/Croatia/RemembranceDayTest.php index 48ad1558c..94e45bf39 100644 --- a/tests/Croatia/RemembranceDayTest.php +++ b/tests/Croatia/RemembranceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class RemembranceDayTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests Remembrance Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRemembranceDayAfterItWasEstablished(): void { @@ -49,15 +44,14 @@ public function testRemembranceDayAfterItWasEstablished(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-18", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-18", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Remembrance Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRemembranceDayBeforeItWasEstablished(): void { @@ -71,7 +65,7 @@ public function testRemembranceDayBeforeItWasEstablished(): void /** * Tests translated name of Remembrance Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/StStephensDayTest.php b/tests/Croatia/StStephensDayTest.php index d9bc68e24..89073210a 100644 --- a/tests/Croatia/StStephensDayTest.php +++ b/tests/Croatia/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends CroatiaBaseTestCase implements HolidayTestCase * * @dataProvider stStephensDayDataProvider * - * @param int $year the year for which St. Stephen's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Stephen's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function teststStephensDay(int $year, DateTime $expected): void + public function teststStephensDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function teststStephensDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Stephen's Day. * - * @return array list of test dates for St. Stephen's Day + * @return array list of test dates for St. Stephen's Day * - * @throws Exception + * @throws \Exception */ public function stStephensDayDataProvider(): array { @@ -60,7 +55,7 @@ public function stStephensDayDataProvider(): array /** * Tests translated name of St. Stephen's Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Croatia/StatehoodDayTest.php b/tests/Croatia/StatehoodDayTest.php index 3de09184b..78907db50 100644 --- a/tests/Croatia/StatehoodDayTest.php +++ b/tests/Croatia/StatehoodDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Croatia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class StatehoodDayTest extends CroatiaBaseTestCase implements HolidayTestCase /** * Tests Statehood Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testStatehoodDay(): void { @@ -55,7 +50,7 @@ public function testStatehoodDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime($expectedDate, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expectedDate, new \DateTimeZone(self::TIMEZONE)) ); $year = $this->generateRandomYear(self::DATE_CHANGE_YEAR); @@ -64,14 +59,14 @@ public function testStatehoodDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime($expectedDate, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expectedDate, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Statehood Day before 1991. * - * @throws ReflectionException + * @throws \Exception */ public function testStatehoodDayBefore1991(): void { @@ -85,7 +80,7 @@ public function testStatehoodDayBefore1991(): void /** * Tests translated name of Statehood Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -100,7 +95,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/ChristmasDayTest.php b/tests/CzechRepublic/ChristmasDayTest.php index 2e01f5617..eb7b32ee4 100644 --- a/tests/CzechRepublic/ChristmasDayTest.php +++ b/tests/CzechRepublic/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class ChristmasDayTest extends CzechRepublicBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/ChristmasEveTest.php b/tests/CzechRepublic/ChristmasEveTest.php index 496949858..de862bd40 100644 --- a/tests/CzechRepublic/ChristmasEveTest.php +++ b/tests/CzechRepublic/ChristmasEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class ChristmasEveTest extends CzechRepublicBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Eve needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Eve needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/CzechRepublicBaseTestCase.php b/tests/CzechRepublic/CzechRepublicBaseTestCase.php index 76811d4eb..10924e36f 100644 --- a/tests/CzechRepublic/CzechRepublicBaseTestCase.php +++ b/tests/CzechRepublic/CzechRepublicBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/CzechRepublic/CzechRepublicTest.php b/tests/CzechRepublic/CzechRepublicTest.php index e69602492..f34d6574d 100644 --- a/tests/CzechRepublic/CzechRepublicTest.php +++ b/tests/CzechRepublic/CzechRepublicTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,10 +29,12 @@ class CzechRepublicTest extends CzechRepublicBaseTestCase implements ProviderTes /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -42,8 +43,6 @@ protected function setUp(): void /** * Tests if all official holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -66,8 +65,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Czech Republic are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -76,8 +73,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Czech Republic are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -86,8 +81,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Czech Republic are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -96,8 +89,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Czech Republic are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -105,7 +96,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/CzechRepublic/CzechStateHoodDayTest.php b/tests/CzechRepublic/CzechStateHoodDayTest.php index fbd0d6ab9..ef393e938 100644 --- a/tests/CzechRepublic/CzechStateHoodDayTest.php +++ b/tests/CzechRepublic/CzechStateHoodDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class CzechStateHoodDayTest extends CzechRepublicBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/EasterMondayTest.php b/tests/CzechRepublic/EasterMondayTest.php index 94ffccbb1..549b0b3ca 100644 --- a/tests/CzechRepublic/EasterMondayTest.php +++ b/tests/CzechRepublic/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,8 +34,7 @@ class EasterMondayTest extends CzechRepublicBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -48,14 +43,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -70,7 +65,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/GoodFridayTest.php b/tests/CzechRepublic/GoodFridayTest.php index 08533553f..1fb550079 100644 --- a/tests/CzechRepublic/GoodFridayTest.php +++ b/tests/CzechRepublic/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,8 +34,7 @@ class GoodFridayTest extends CzechRepublicBaseTestCase implements HolidayTestCas /** * Tests Good Friday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testGoodFriday(): void { @@ -48,14 +43,14 @@ public function testGoodFriday(): void self::REGION, 'goodFriday', $year, - new DateTime("$year-4-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -70,7 +65,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php b/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php index 0866727e2..f8a292dbb 100644 --- a/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php +++ b/tests/CzechRepublic/IndependentCzechoslovakStateDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class IndependentCzechoslovakStateDayTest extends CzechRepublicBaseTestCase impl * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/InternationalWorkersDayTest.php b/tests/CzechRepublic/InternationalWorkersDayTest.php index df82b5588..20653c132 100644 --- a/tests/CzechRepublic/InternationalWorkersDayTest.php +++ b/tests/CzechRepublic/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class InternationalWorkersDayTest extends CzechRepublicBaseTestCase implements H * * @dataProvider HolidayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,7 +47,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -77,9 +72,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/CzechRepublic/JanHusDayTest.php b/tests/CzechRepublic/JanHusDayTest.php index ddb5295b3..2781926ec 100644 --- a/tests/CzechRepublic/JanHusDayTest.php +++ b/tests/CzechRepublic/JanHusDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class JanHusDayTest extends CzechRepublicBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/NewYearsDayTest.php b/tests/CzechRepublic/NewYearsDayTest.php index fd93181dc..1d7c12268 100644 --- a/tests/CzechRepublic/NewYearsDayTest.php +++ b/tests/CzechRepublic/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class NewYearsDayTest extends CzechRepublicBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php b/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php index 3171b7df2..82901290a 100644 --- a/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php +++ b/tests/CzechRepublic/RenewalOfIndependentCzechStateDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class RenewalOfIndependentCzechStateDayTest extends CzechRepublicBaseTestCase im * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php b/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php index c14da0ff5..127065894 100644 --- a/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php +++ b/tests/CzechRepublic/SaintsCyrilAndMethodiusDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class SaintsCyrilAndMethodiusDayTest extends CzechRepublicBaseTestCase implement * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/SecondChristmasDayTest.php b/tests/CzechRepublic/SecondChristmasDayTest.php index 90fc97b12..2652a83ea 100644 --- a/tests/CzechRepublic/SecondChristmasDayTest.php +++ b/tests/CzechRepublic/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class SecondChristmasDayTest extends CzechRepublicBaseTestCase implements Holida * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php b/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php index c35fe2c67..e10b60846 100644 --- a/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php +++ b/tests/CzechRepublic/StruggleForFreedomAndDemocracyDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StruggleForFreedomAndDemocracyDayTest extends CzechRepublicBaseTestCase im * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/CzechRepublic/VictoryInEuropeDayTest.php b/tests/CzechRepublic/VictoryInEuropeDayTest.php index d6d02aa36..14e6e08aa 100644 --- a/tests/CzechRepublic/VictoryInEuropeDayTest.php +++ b/tests/CzechRepublic/VictoryInEuropeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\CzechRepublic; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class VictoryInEuropeDayTest extends CzechRepublicBaseTestCase implements Holida * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/AscensionDayTest.php b/tests/Denmark/AscensionDayTest.php index b17b9f86b..e4b38a000 100644 --- a/tests/Denmark/AscensionDayTest.php +++ b/tests/Denmark/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/ChristmasDayTest.php b/tests/Denmark/ChristmasDayTest.php index 0e1869ea9..bf7383746 100644 --- a/tests/Denmark/ChristmasDayTest.php +++ b/tests/Denmark/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends DenmarkBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/ChristmasEveTest.php b/tests/Denmark/ChristmasEveTest.php index 6a6961b58..17b9a73f6 100644 --- a/tests/Denmark/ChristmasEveTest.php +++ b/tests/Denmark/ChristmasEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasEveTest extends DenmarkBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/ConstitutionDayTest.php b/tests/Denmark/ConstitutionDayTest.php index 7023256bd..94f33d941 100644 --- a/tests/Denmark/ConstitutionDayTest.php +++ b/tests/Denmark/ConstitutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstitutionDayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/DaylightSavingTime.php b/tests/Denmark/DaylightSavingTime.php new file mode 100644 index 000000000..f32f2dd9c --- /dev/null +++ b/tests/Denmark/DaylightSavingTime.php @@ -0,0 +1,50 @@ + + */ + +namespace Yasumi\tests\Denmark; + +use Yasumi\tests\HolidayTestCase; + +abstract class DaylightSavingTime extends DenmarkBaseTestCase implements HolidayTestCase +{ + /** @var int[] */ + public array $observedYears; + + /** @var int[] */ + public array $unobservedYears; + + public function __construct() + { + $observedYears = [1916, 1940]; + $observedYears = array_merge($observedYears, range(1942, 1948)); + $observedYears = array_merge($observedYears, range(1980, 2037)); // PHP caps future DST transitions + + $this->observedYears = $observedYears; + $this->unobservedYears = array_diff(range(reset($observedYears), end($observedYears)), $observedYears); + + parent::__construct(); + } + + /* Swaps the observation from observed to unobserved for the given years */ + protected function swapObservation(array $years): void + { + foreach ($years as $y) { + $this->observedYears[] = $y; + if (false !== ($key = array_search($y, $this->unobservedYears, true))) { + unset($this->unobservedYears[(int) $key]); + } + } + } +} diff --git a/tests/Denmark/DenmarkBaseTestCase.php b/tests/Denmark/DenmarkBaseTestCase.php index c08767904..480e6217c 100644 --- a/tests/Denmark/DenmarkBaseTestCase.php +++ b/tests/Denmark/DenmarkBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Denmark/DenmarkTest.php b/tests/Denmark/DenmarkTest.php index 79cb6fca8..5b7ad97e6 100644 --- a/tests/Denmark/DenmarkTest.php +++ b/tests/Denmark/DenmarkTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Denmark; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class DenmarkTest extends DenmarkBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Denmark are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Denmark are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -76,7 +73,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Denmark are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -86,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Denmark are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -96,8 +91,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Denmark are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -105,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Denmark/EasterMondayTest.php b/tests/Denmark/EasterMondayTest.php index 87daa37a8..890a75a01 100644 --- a/tests/Denmark/EasterMondayTest.php +++ b/tests/Denmark/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/EasterTest.php b/tests/Denmark/EasterTest.php index f328718b5..6e1dcea70 100644 --- a/tests/Denmark/EasterTest.php +++ b/tests/Denmark/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/GoodFridayTest.php b/tests/Denmark/GoodFridayTest.php index 77e94cb82..448080988 100644 --- a/tests/Denmark/GoodFridayTest.php +++ b/tests/Denmark/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/GreatPrayerDayTest.php b/tests/Denmark/GreatPrayerDayTest.php index 66f494a1e..7c7ca268b 100644 --- a/tests/Denmark/GreatPrayerDayTest.php +++ b/tests/Denmark/GreatPrayerDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class GreatPrayerDayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-13", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-13", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/InternationalWorkersDayTest.php b/tests/Denmark/InternationalWorkersDayTest.php index a285a0425..6a3f518bb 100644 --- a/tests/Denmark/InternationalWorkersDayTest.php +++ b/tests/Denmark/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends DenmarkBaseTestCase implements Holiday * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { @@ -60,7 +55,7 @@ public function InternationalWorkersDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/MaundyThursdayTest.php b/tests/Denmark/MaundyThursdayTest.php index e3f6c5336..94b0cb434 100644 --- a/tests/Denmark/MaundyThursdayTest.php +++ b/tests/Denmark/MaundyThursdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class MaundyThursdayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-29", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/NewYearsDayTest.php b/tests/Denmark/NewYearsDayTest.php index 1d4290197..54d3d255d 100644 --- a/tests/Denmark/NewYearsDayTest.php +++ b/tests/Denmark/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends DenmarkBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/NewYearsEveTest.php b/tests/Denmark/NewYearsEveTest.php index 955bfb3e1..5cbc9c53e 100644 --- a/tests/Denmark/NewYearsEveTest.php +++ b/tests/Denmark/NewYearsEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsEveTest extends DenmarkBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/PentecostMondayTest.php b/tests/Denmark/PentecostMondayTest.php index b62d2db43..8330a56ae 100644 --- a/tests/Denmark/PentecostMondayTest.php +++ b/tests/Denmark/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/PentecostTest.php b/tests/Denmark/PentecostTest.php index 79f58903c..ad32ab8e2 100644 --- a/tests/Denmark/PentecostTest.php +++ b/tests/Denmark/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends DenmarkBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/SecondChristmasDayTest.php b/tests/Denmark/SecondChristmasDayTest.php index 678928845..d70c8be23 100644 --- a/tests/Denmark/SecondChristmasDayTest.php +++ b/tests/Denmark/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Denmark; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends DenmarkBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Denmark/SummerTimeTest.php b/tests/Denmark/SummerTimeTest.php index d7af59a0c..f524c69dc 100644 --- a/tests/Denmark/SummerTimeTest.php +++ b/tests/Denmark/SummerTimeTest.php @@ -1,10 +1,11 @@ '1916-05-14', + 1940 => '1940-05-14', + 1943 => '1943-03-29', + 1944 => '1944-04-03', + 1945 => '1945-04-02', + 1946 => '1946-05-01', + 1947 => '1947-05-04', + 1948 => '1948-05-09', + ]; + + public function __construct() + { + parent::__construct(); + + // no summertime defined in 1942 + if (false !== ($key = array_search(1942, $this->observedYears, true))) { + unset($this->observedYears[(int) $key]); + } + + // In version 2022f of the tz db, a correction for some years weere made for the summertime + // transitions. See: https://github.com/eggert/tz/blob/2022f/europe + if (1 === strcmp(\intltz_get_tz_data_version(), '2022f')) { + $this->swapObservation([1917, 1918, 1949]); + + $this->deviantTransitions[1916] = '1916-04-30'; + $this->deviantTransitions[1917] = '1917-04-16'; + $this->deviantTransitions[1918] = '1918-04-15'; + $this->deviantTransitions[1940] = '1940-04-01'; + $this->deviantTransitions[1946] = '1946-04-14'; + $this->deviantTransitions[1947] = '1947-04-06'; + $this->deviantTransitions[1948] = '1948-04-18'; + $this->deviantTransitions[1949] = '1949-04-10'; + } + } + /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSummerTime(): void { - $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1949, 1979)); + $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->randomYearFromArray($this->unobservedYears)); - $year = $this->generateRandomYear(1980, 2036); - $expectedDate = new DateTime("last sunday of march $year", new DateTimeZone(self::TIMEZONE)); + $year = $this->randomYearFromArray($this->observedYears); + $expectedDate = new \DateTime("last sunday of march $year", new \DateTimeZone(self::TIMEZONE)); + + if (array_key_exists($year, $this->deviantTransitions)) { + $expectedDate = new \DateTime($this->deviantTransitions[$year], new \DateTimeZone(self::TIMEZONE)); + } // Since 1980 Summertime in Denmark starts on the last day of March. In 1980 itself however, it started on April, 6th. if (1980 === $year) { - $expectedDate = new DateTime('1980-04-06', new DateTimeZone(self::TIMEZONE)); + $expectedDate = new \DateTime('1980-04-06', new \DateTimeZone(self::TIMEZONE)); } $this->assertHoliday( @@ -60,14 +98,14 @@ public function testSummerTime(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(1980, 2037), + $this->randomYearFromArray($this->observedYears), [self::LOCALE => 'sommertid starter'] ); } @@ -75,10 +113,15 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(1980, 2037), Holiday::TYPE_SEASON); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + Holiday::TYPE_SEASON + ); } } diff --git a/tests/Denmark/WinterTimeTest.php b/tests/Denmark/WinterTimeTest.php index 792499428..3c97024d6 100644 --- a/tests/Denmark/WinterTimeTest.php +++ b/tests/Denmark/WinterTimeTest.php @@ -1,10 +1,11 @@ '1916-09-30', + 1942 => '1942-11-02', + 1943 => '1943-10-04', + 1944 => '1944-10-02', + 1945 => '1945-08-15', + 1946 => '1946-09-01', + 1947 => '1947-08-10', + 1948 => '1948-08-08', + ]; + + public function __construct() + { + parent::__construct(); + + // no wintertime defined for 1940 + if (false !== ($key = array_search(1940, $this->observedYears, true))) { + unset($this->observedYears[(int) $key]); + } + + // In version 2022f of the tz db, a correction for some years weere made for the wintertime + // transitions. See: https://github.com/eggert/tz/blob/2022f/europe + if (1 === strcmp(\intltz_get_tz_data_version(), '2022f')) { + $this->swapObservation([1918, 1917, 1945, 1946, 1948, 1949]); + + $this->deviantTransitions[1917] = '1917-09-17'; + $this->deviantTransitions[1918] = '1918-09-16'; + $this->deviantTransitions[1945] = '1945-11-18'; + $this->deviantTransitions[1946] = '1946-10-07'; + $this->deviantTransitions[1947] = '1947-10-05'; + $this->deviantTransitions[1948] = '1948-10-03'; + $this->deviantTransitions[1949] = '1949-10-02'; + } + } + /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testWinterTime(): void { - $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1949, 1979)); + $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->randomYearFromArray($this->unobservedYears)); - $year = $this->generateRandomYear(1980, 1995); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("last sunday of september $year", new DateTimeZone(self::TIMEZONE)) - ); + $year = $this->randomYearFromArray($this->observedYears); + $expectedDate = new \DateTime("last sunday of september $year", new \DateTimeZone(self::TIMEZONE)); + + if ($year >= 1996) { + $expectedDate = new \DateTime("last sunday of october $year", new \DateTimeZone(self::TIMEZONE)); + } + + if (array_key_exists($year, $this->deviantTransitions)) { + $expectedDate = new \DateTime($this->deviantTransitions[$year], new \DateTimeZone(self::TIMEZONE)); + } - $year = $this->generateRandomYear(1996, 2036); $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("last sunday of october $year", new DateTimeZone(self::TIMEZONE)) + $expectedDate ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { $this->assertTranslatedHolidayName( self::REGION, self::HOLIDAY, - $this->generateRandomYear(1980, 2037), + $this->randomYearFromArray($this->observedYears), [self::LOCALE => 'sommertid slutter'] ); } @@ -76,10 +111,15 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(1980, 2037), Holiday::TYPE_SEASON); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + Holiday::TYPE_SEASON + ); } } diff --git a/tests/Estonia/ChristmasDayTest.php b/tests/Estonia/ChristmasDayTest.php index 091cb53a9..e10a22346 100644 --- a/tests/Estonia/ChristmasDayTest.php +++ b/tests/Estonia/ChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'christmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/ChristmasEveDayTest.php b/tests/Estonia/ChristmasEveDayTest.php index 4198750b6..0e38b0be7 100644 --- a/tests/Estonia/ChristmasEveDayTest.php +++ b/tests/Estonia/ChristmasEveDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasEveDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'christmasEve'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/EasterDayTest.php b/tests/Estonia/EasterDayTest.php index 166d01949..9fbaf56ca 100644 --- a/tests/Estonia/EasterDayTest.php +++ b/tests/Estonia/EasterDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class EasterDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'easter'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/EstoniaBaseTestCase.php b/tests/Estonia/EstoniaBaseTestCase.php index bea64f428..bdc93e31f 100644 --- a/tests/Estonia/EstoniaBaseTestCase.php +++ b/tests/Estonia/EstoniaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Estonia/EstoniaTest.php b/tests/Estonia/EstoniaTest.php index ec85bda72..04d2e2a88 100644 --- a/tests/Estonia/EstoniaTest.php +++ b/tests/Estonia/EstoniaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Estonia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Estonia; use Yasumi\tests\ProviderTestCase; @@ -30,7 +29,7 @@ class EstoniaTest extends EstoniaBaseTestCase implements ProviderTestCase /** * Tests if all official holidays in Estonia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOfficialHolidays(): void { @@ -66,7 +65,7 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Estonia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testObservedHolidays(): void { @@ -76,7 +75,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Estonia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -86,7 +85,7 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Estonia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testBankHolidays(): void { @@ -96,7 +95,7 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Estonia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOtherHolidays(): void { @@ -104,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Estonia/GoodFridayDayTest.php b/tests/Estonia/GoodFridayDayTest.php index 87ac7574a..962d823b0 100644 --- a/tests/Estonia/GoodFridayDayTest.php +++ b/tests/Estonia/GoodFridayDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class GoodFridayDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'goodFriday'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/IndependenceDayTest.php b/tests/Estonia/IndependenceDayTest.php index 4423b2ff3..4d84c3726 100644 --- a/tests/Estonia/IndependenceDayTest.php +++ b/tests/Estonia/IndependenceDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Estonia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class IndependenceDayTest extends EstoniaBaseTestCase implements HolidayTestCase /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -52,8 +48,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -63,14 +58,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-02-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-02-24", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/InternationalWorkersDayTest.php b/tests/Estonia/InternationalWorkersDayTest.php index dd20c54a2..e73c9bcb1 100644 --- a/tests/Estonia/InternationalWorkersDayTest.php +++ b/tests/Estonia/InternationalWorkersDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class InternationalWorkersDayTest extends EstoniaBaseTestCase implements Holiday public const HOLIDAY = 'internationalWorkersDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/NewYearsDayTest.php b/tests/Estonia/NewYearsDayTest.php index e9cb9cbee..4015d450d 100644 --- a/tests/Estonia/NewYearsDayTest.php +++ b/tests/Estonia/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearsDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'newYearsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/PentecostTest.php b/tests/Estonia/PentecostTest.php index 118c5da78..58b0ea2be 100644 --- a/tests/Estonia/PentecostTest.php +++ b/tests/Estonia/PentecostTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class PentecostTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'pentecost'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/RestorationOfIndependenceDayTest.php b/tests/Estonia/RestorationOfIndependenceDayTest.php index a375a50ae..41927ac3d 100644 --- a/tests/Estonia/RestorationOfIndependenceDayTest.php +++ b/tests/Estonia/RestorationOfIndependenceDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Estonia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class RestorationOfIndependenceDayTest extends EstoniaBaseTestCase implements Ho /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -52,8 +48,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -63,14 +58,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-08-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-08-20", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/SecondChristmasDayTest.php b/tests/Estonia/SecondChristmasDayTest.php index 71810c769..955858d1d 100644 --- a/tests/Estonia/SecondChristmasDayTest.php +++ b/tests/Estonia/SecondChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class SecondChristmasDayTest extends EstoniaBaseTestCase implements HolidayTestC public const HOLIDAY = 'secondChristmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/StJohnsDayTest.php b/tests/Estonia/StJohnsDayTest.php index 290307606..ee512c28d 100644 --- a/tests/Estonia/StJohnsDayTest.php +++ b/tests/Estonia/StJohnsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class StJohnsDayTest extends EstoniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'stJohnsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Estonia/VictoryDayTest.php b/tests/Estonia/VictoryDayTest.php index 7ff5fda2a..2e31799ff 100644 --- a/tests/Estonia/VictoryDayTest.php +++ b/tests/Estonia/VictoryDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Estonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Estonia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class VictoryDayTest extends EstoniaBaseTestCase implements HolidayTestCase /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -52,8 +48,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -63,14 +58,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-23", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/AllSaintsDayTest.php b/tests/Finland/AllSaintsDayTest.php index 577913abe..14f6125d2 100644 --- a/tests/Finland/AllSaintsDayTest.php +++ b/tests/Finland/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Finland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -37,12 +32,10 @@ class AllSaintsDayTest extends FinlandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -50,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +53,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE)); // Check between 31 October and 6th of November the day that is a Saturday for ($d = 0; $d <= 7; ++$d) { @@ -68,7 +61,7 @@ public function HolidayDataProvider(): array $data[] = [$year, $date]; break; } - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } } @@ -78,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/AscensionDayTest.php b/tests/Finland/AscensionDayTest.php index a0dde23d2..416669b3d 100644 --- a/tests/Finland/AscensionDayTest.php +++ b/tests/Finland/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/ChristmasDayTest.php b/tests/Finland/ChristmasDayTest.php index b8ec6de84..0e823bdb6 100644 --- a/tests/Finland/ChristmasDayTest.php +++ b/tests/Finland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends FinlandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/EasterMondayTest.php b/tests/Finland/EasterMondayTest.php index 51b1da3f0..b7956d983 100644 --- a/tests/Finland/EasterMondayTest.php +++ b/tests/Finland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/EasterTest.php b/tests/Finland/EasterTest.php index 6f2170361..1f5335466 100644 --- a/tests/Finland/EasterTest.php +++ b/tests/Finland/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/EpiphanyTest.php b/tests/Finland/EpiphanyTest.php index f0e44d674..237a45735 100644 --- a/tests/Finland/EpiphanyTest.php +++ b/tests/Finland/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends FinlandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/FinlandBaseTestCase.php b/tests/Finland/FinlandBaseTestCase.php index b58b07892..bed59e383 100644 --- a/tests/Finland/FinlandBaseTestCase.php +++ b/tests/Finland/FinlandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Finland/FinlandTest.php b/tests/Finland/FinlandTest.php index 7f98f2580..d2d5590a9 100644 --- a/tests/Finland/FinlandTest.php +++ b/tests/Finland/FinlandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Finland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class FinlandTest extends FinlandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -62,8 +61,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -72,8 +69,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +77,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +85,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +92,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Finland/GoodFridayTest.php b/tests/Finland/GoodFridayTest.php index 466d97c0b..9cb336101 100644 --- a/tests/Finland/GoodFridayTest.php +++ b/tests/Finland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/IndependenceDayTest.php b/tests/Finland/IndependenceDayTest.php index 07581f40b..7c03da55a 100644 --- a/tests/Finland/IndependenceDayTest.php +++ b/tests/Finland/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndependenceDayTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/InternationalWorkersDayTest.php b/tests/Finland/InternationalWorkersDayTest.php index c35742127..6cfc42ecd 100644 --- a/tests/Finland/InternationalWorkersDayTest.php +++ b/tests/Finland/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends FinlandBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Finland/NewYearsDayTest.php b/tests/Finland/NewYearsDayTest.php index 068aa1717..dc483c085 100644 --- a/tests/Finland/NewYearsDayTest.php +++ b/tests/Finland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends FinlandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/PentecostTest.php b/tests/Finland/PentecostTest.php index dd67ed761..6885b0d37 100644 --- a/tests/Finland/PentecostTest.php +++ b/tests/Finland/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/SecondChristmasDayTest.php b/tests/Finland/SecondChristmasDayTest.php index 246c26068..0159b699f 100644 --- a/tests/Finland/SecondChristmasDayTest.php +++ b/tests/Finland/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends FinlandBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Finland/stJohnsDayTest.php b/tests/Finland/stJohnsDayTest.php index 207ea0e67..67b2b8b8d 100644 --- a/tests/Finland/stJohnsDayTest.php +++ b/tests/Finland/stJohnsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Finland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -43,8 +39,7 @@ class stJohnsDayTest extends FinlandBaseTestCase implements HolidayTestCase /** * Tests the holiday before it was adjusted. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeAdjustment(): void { @@ -53,14 +48,14 @@ public function testHolidayBeforeAdjustment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday before it was adjusted. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterAdjustment(): void { @@ -84,7 +79,7 @@ public function testHolidayAfterAdjustment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -99,7 +94,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/AllSaintsDayTest.php b/tests/France/AllSaintsDayTest.php index c78ee5151..0d3abdaf0 100644 --- a/tests/France/AllSaintsDayTest.php +++ b/tests/France/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends FranceBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/France/ArmisticeDayTest.php b/tests/France/ArmisticeDayTest.php index d467049df..7123c05ec 100644 --- a/tests/France/ArmisticeDayTest.php +++ b/tests/France/ArmisticeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ArmisticeDayTest extends FranceBaseTestCase implements HolidayTestCase /** * Tests Armistice Day on or after 1919. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testArmisticeDayOnAfter1919(): void { @@ -49,14 +44,14 @@ public function testArmisticeDayOnAfter1919(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Armistice Day before 1919. * - * @throws ReflectionException + * @throws \Exception */ public function testArmisticeDayBefore1919(): void { @@ -70,7 +65,7 @@ public function testArmisticeDayBefore1919(): void /** * Tests translated name of Armistice Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/AscensionDayTest.php b/tests/France/AscensionDayTest.php index 484e1e18c..c50ebc2a5 100644 --- a/tests/France/AscensionDayTest.php +++ b/tests/France/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends FranceBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/AssumptionOfMaryTest.php b/tests/France/AssumptionOfMaryTest.php index 6de074804..ce7535678 100644 --- a/tests/France/AssumptionOfMaryTest.php +++ b/tests/France/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends FranceBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/France/BasRhin/BasRhinBaseTestCase.php b/tests/France/BasRhin/BasRhinBaseTestCase.php index f9a46f307..afba46dbd 100644 --- a/tests/France/BasRhin/BasRhinBaseTestCase.php +++ b/tests/France/BasRhin/BasRhinBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/France/BasRhin/BasRhinTest.php b/tests/France/BasRhin/BasRhinTest.php index fe0242897..bc7c6c418 100644 --- a/tests/France/BasRhin/BasRhinTest.php +++ b/tests/France/BasRhin/BasRhinTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,8 @@ namespace Yasumi\tests\France\BasRhin; -use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\France; use Yasumi\tests\ProviderTestCase; /** @@ -30,6 +30,8 @@ class BasRhinTest extends BasRhinBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,42 +40,46 @@ protected function setUp(): void /** * Tests if all official holidays in Bas-Rhin are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', - 'victoryInEuropeDay', - 'goodFriday', - 'easterMonday', - 'internationalWorkersDay', - 'ascensionDay', - 'pentecostMonday', - 'assumptionOfMary', - 'allSaintsDay', - 'armisticeDay', - 'christmasDay', - 'stStephensDay', - 'bastilleDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + $holidays = + [ + 'newYearsDay', + 'victoryInEuropeDay', + 'easterMonday', + 'internationalWorkersDay', + 'ascensionDay', + 'assumptionOfMary', + 'allSaintsDay', + 'armisticeDay', + 'christmasDay', + 'bastilleDay', + ]; + + if ($this->year < France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Bas-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { - $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + $holidays = []; + + if ($this->year >= France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } /** * Tests if all seasonal holidays in Bas-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Bas-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Bas-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/France/BasRhin/GoodFridayTest.php b/tests/France/BasRhin/GoodFridayTest.php index f4900022b..b1795632f 100644 --- a/tests/France/BasRhin/GoodFridayTest.php +++ b/tests/France/BasRhin/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France\BasRhin; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends BasRhinBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/BasRhin/stStephensDayTest.php b/tests/France/BasRhin/stStephensDayTest.php index c51777bcb..6e37e86ba 100644 --- a/tests/France/BasRhin/stStephensDayTest.php +++ b/tests/France/BasRhin/stStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France\BasRhin; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stStephensDayTest extends BasRhinBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/BastilleDayTest.php b/tests/France/BastilleDayTest.php index 7e5904013..6ffaa25bf 100644 --- a/tests/France/BastilleDayTest.php +++ b/tests/France/BastilleDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class BastilleDayTest extends FranceBaseTestCase implements HolidayTestCase /** * Tests Bastille Day on or after 1790. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testBastilleDayOnAfter1790(): void { @@ -49,14 +44,14 @@ public function testBastilleDayOnAfter1790(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Bastille Day before 1790. * - * @throws ReflectionException + * @throws \Exception */ public function testBastilleDayBefore1790(): void { @@ -70,7 +65,7 @@ public function testBastilleDayBefore1790(): void /** * Tests translated name of Bastille Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/ChristmasDayTest.php b/tests/France/ChristmasDayTest.php index a32d39000..e0d853de1 100644 --- a/tests/France/ChristmasDayTest.php +++ b/tests/France/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends FranceBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/EasterMondayTest.php b/tests/France/EasterMondayTest.php index 55a90cdf5..7d4263ab2 100644 --- a/tests/France/EasterMondayTest.php +++ b/tests/France/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends FranceBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/FranceBaseTestCase.php b/tests/France/FranceBaseTestCase.php index ce4c78c46..c4793fb34 100644 --- a/tests/France/FranceBaseTestCase.php +++ b/tests/France/FranceBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/France/FranceTest.php b/tests/France/FranceTest.php index 518a2bd3b..7282e0136 100644 --- a/tests/France/FranceTest.php +++ b/tests/France/FranceTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,8 @@ namespace Yasumi\tests\France; -use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\France; use Yasumi\tests\ProviderTestCase; /** @@ -30,6 +30,8 @@ class FranceTest extends FranceBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,40 +40,46 @@ protected function setUp(): void /** * Tests if all official holidays in France are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', - 'victoryInEuropeDay', - 'easterMonday', - 'internationalWorkersDay', - 'ascensionDay', - 'pentecostMonday', - 'assumptionOfMary', - 'allSaintsDay', - 'armisticeDay', - 'christmasDay', - 'bastilleDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + $holidays = + [ + 'newYearsDay', + 'victoryInEuropeDay', + 'easterMonday', + 'internationalWorkersDay', + 'ascensionDay', + 'assumptionOfMary', + 'allSaintsDay', + 'armisticeDay', + 'christmasDay', + 'bastilleDay', + ]; + + if ($this->year < France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in France are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { - $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + $holidays = []; + + if ($this->year >= France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } /** * Tests if all seasonal holidays in France are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in France are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in France are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -99,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/France/HautRhin/GoodFridayTest.php b/tests/France/HautRhin/GoodFridayTest.php index 421e5c5dd..5aaffa101 100644 --- a/tests/France/HautRhin/GoodFridayTest.php +++ b/tests/France/HautRhin/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France\HautRhin; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends HautRhinBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/HautRhin/HautRhinBaseTestCase.php b/tests/France/HautRhin/HautRhinBaseTestCase.php index 51bae272e..d47bd8606 100644 --- a/tests/France/HautRhin/HautRhinBaseTestCase.php +++ b/tests/France/HautRhin/HautRhinBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/France/HautRhin/HautRhinTest.php b/tests/France/HautRhin/HautRhinTest.php index d7e3964bf..086042ee2 100644 --- a/tests/France/HautRhin/HautRhinTest.php +++ b/tests/France/HautRhin/HautRhinTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,8 @@ namespace Yasumi\tests\France\HautRhin; -use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\France; use Yasumi\tests\ProviderTestCase; /** @@ -30,6 +30,8 @@ class HautRhinTest extends HautRhinBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,42 +40,46 @@ protected function setUp(): void /** * Tests if all official holidays in Haut-Rhin are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', - 'victoryInEuropeDay', - 'goodFriday', - 'easterMonday', - 'internationalWorkersDay', - 'ascensionDay', - 'pentecostMonday', - 'assumptionOfMary', - 'allSaintsDay', - 'armisticeDay', - 'christmasDay', - 'stStephensDay', - 'bastilleDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + $holidays = + [ + 'newYearsDay', + 'victoryInEuropeDay', + 'easterMonday', + 'internationalWorkersDay', + 'ascensionDay', + 'assumptionOfMary', + 'allSaintsDay', + 'armisticeDay', + 'christmasDay', + 'bastilleDay', + ]; + + if ($this->year < France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Haut-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { - $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + $holidays = []; + + if ($this->year >= France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } /** * Tests if all seasonal holidays in Haut-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Haut-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Haut-Rhin (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/France/HautRhin/stStephensDayTest.php b/tests/France/HautRhin/stStephensDayTest.php index 7d57039ac..774b4d8c6 100644 --- a/tests/France/HautRhin/stStephensDayTest.php +++ b/tests/France/HautRhin/stStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France\HautRhin; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stStephensDayTest extends HautRhinBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/InternationalWorkersDayTest.php b/tests/France/InternationalWorkersDayTest.php index 1d962eb9d..8dd4a0a95 100644 --- a/tests/France/InternationalWorkersDayTest.php +++ b/tests/France/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends FranceBaseTestCase implements HolidayT * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/France/Moselle/GoodFridayTest.php b/tests/France/Moselle/GoodFridayTest.php index a39f5025b..0bcc21b40 100644 --- a/tests/France/Moselle/GoodFridayTest.php +++ b/tests/France/Moselle/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France\Moselle; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends MoselleBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/Moselle/MoselleBaseTestCase.php b/tests/France/Moselle/MoselleBaseTestCase.php index 0747fdf52..8775a82bf 100644 --- a/tests/France/Moselle/MoselleBaseTestCase.php +++ b/tests/France/Moselle/MoselleBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/France/Moselle/MoselleTest.php b/tests/France/Moselle/MoselleTest.php index 71842d52c..f59030501 100644 --- a/tests/France/Moselle/MoselleTest.php +++ b/tests/France/Moselle/MoselleTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,8 @@ namespace Yasumi\tests\France\Moselle; -use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\France; use Yasumi\tests\ProviderTestCase; /** @@ -30,6 +30,8 @@ class MoselleTest extends MoselleBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,42 +40,46 @@ protected function setUp(): void /** * Tests if all official holidays in Moselle are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', - 'victoryInEuropeDay', - 'goodFriday', - 'easterMonday', - 'internationalWorkersDay', - 'ascensionDay', - 'pentecostMonday', - 'assumptionOfMary', - 'allSaintsDay', - 'armisticeDay', - 'christmasDay', - 'stStephensDay', - 'bastilleDay', - ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + $holidays = + [ + 'newYearsDay', + 'victoryInEuropeDay', + 'easterMonday', + 'internationalWorkersDay', + 'ascensionDay', + 'assumptionOfMary', + 'allSaintsDay', + 'armisticeDay', + 'christmasDay', + 'bastilleDay', + ]; + + if ($this->year < France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Moselle (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { - $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + $holidays = []; + + if ($this->year >= France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY) { + $holidays[] = 'pentecostMonday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } /** * Tests if all seasonal holidays in Moselle (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Moselle (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Moselle (France) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/France/Moselle/stStephensDayTest.php b/tests/France/Moselle/stStephensDayTest.php index 439be3ced..6c6de6ad2 100644 --- a/tests/France/Moselle/stStephensDayTest.php +++ b/tests/France/Moselle/stStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France\Moselle; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stStephensDayTest extends MoselleBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/France/NewYearsDayTest.php b/tests/France/NewYearsDayTest.php index 7dce92684..9488b67fb 100644 --- a/tests/France/NewYearsDayTest.php +++ b/tests/France/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends FranceBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/France/PentecostMondayTest.php b/tests/France/PentecostMondayTest.php index c422a82e0..e82922520 100644 --- a/tests/France/PentecostMondayTest.php +++ b/tests/France/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,8 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; +use Yasumi\Provider\France; use Yasumi\tests\HolidayTestCase; /** @@ -34,8 +31,7 @@ class PentecostMondayTest extends FranceBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +40,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,10 +62,22 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(null, France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY - 1), + Holiday::TYPE_OFFICIAL + ); + + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(France::EST_YEAR_DAY_OF_SOLIDARITY_WITH_ELDERLY), + Holiday::TYPE_OBSERVANCE + ); } } diff --git a/tests/France/VictoryInEuropeDayTest.php b/tests/France/VictoryInEuropeDayTest.php index 7d5359a43..2feb1e54d 100644 --- a/tests/France/VictoryInEuropeDayTest.php +++ b/tests/France/VictoryInEuropeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\France; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class VictoryInEuropeDayTest extends FranceBaseTestCase implements HolidayTestCa /** * Tests Victory In Europe Day on or after 1945. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testVictoryInEuropeDayOnAfter1945(): void { @@ -49,14 +44,14 @@ public function testVictoryInEuropeDayOnAfter1945(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Victory In Europe Day before 1945. * - * @throws ReflectionException + * @throws \Exception */ public function testVictoryInEuropeDayBefore1945(): void { @@ -70,7 +65,7 @@ public function testVictoryInEuropeDayBefore1945(): void /** * Tests translated name of Victory in Europe Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/EasterTest.php b/tests/Georgia/EasterTest.php index 8a2801be8..4cfb47237 100644 --- a/tests/Georgia/EasterTest.php +++ b/tests/Georgia/EasterTest.php @@ -4,10 +4,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -21,8 +17,7 @@ class EasterTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -32,14 +27,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -54,7 +49,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/GeorgiaBaseTestCase.php b/tests/Georgia/GeorgiaBaseTestCase.php index a56cebef3..86f12fb7b 100644 --- a/tests/Georgia/GeorgiaBaseTestCase.php +++ b/tests/Georgia/GeorgiaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Georgia/GeorgiaTest.php b/tests/Georgia/GeorgiaTest.php index d86642c37..7f05845d1 100644 --- a/tests/Georgia/GeorgiaTest.php +++ b/tests/Georgia/GeorgiaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Georgia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Georgia; use Yasumi\tests\ProviderTestCase; @@ -34,6 +33,8 @@ class GeorgiaTest extends GeorgiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -42,8 +43,6 @@ protected function setUp(): void /** * Tests if all official holidays in Georgia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -74,8 +73,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Georgia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -84,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Georgia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -94,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Georgia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -104,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Georgia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -113,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Georgia/IndependenceDayTest.php b/tests/Georgia/IndependenceDayTest.php index 79b53ed0b..ffcfec384 100644 --- a/tests/Georgia/IndependenceDayTest.php +++ b/tests/Georgia/IndependenceDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,8 +26,7 @@ class IndependenceDayTest extends GeorgiaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'independenceDay'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { @@ -40,14 +35,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-05-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-05-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -63,8 +56,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Georgia/InternationalWomensDayTest.php b/tests/Georgia/InternationalWomensDayTest.php index d79a5704c..e45d76b20 100644 --- a/tests/Georgia/InternationalWomensDayTest.php +++ b/tests/Georgia/InternationalWomensDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class InternationalWomensDayTest extends GeorgiaBaseTestCase implements HolidayT /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/MtskhetobaDayTest.php b/tests/Georgia/MtskhetobaDayTest.php index 1af9ff2e0..a3f606f3b 100644 --- a/tests/Georgia/MtskhetobaDayTest.php +++ b/tests/Georgia/MtskhetobaDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class MtskhetobaDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/NewYearsDayTest.php b/tests/Georgia/NewYearsDayTest.php index 269db3c52..bdbd8d9ff 100644 --- a/tests/Georgia/NewYearsDayTest.php +++ b/tests/Georgia/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class NewYearsDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/OrthodoxChristmasDayTest.php b/tests/Georgia/OrthodoxChristmasDayTest.php index 2aa786d90..48e985dcf 100644 --- a/tests/Georgia/OrthodoxChristmasDayTest.php +++ b/tests/Georgia/OrthodoxChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class OrthodoxChristmasDayTest extends GeorgiaBaseTestCase implements HolidayTes /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/OrthodoxEpiphanyDayTest.php b/tests/Georgia/OrthodoxEpiphanyDayTest.php index 5d788be6e..85b834580 100644 --- a/tests/Georgia/OrthodoxEpiphanyDayTest.php +++ b/tests/Georgia/OrthodoxEpiphanyDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class OrthodoxEpiphanyDayTest extends GeorgiaBaseTestCase implements HolidayTest /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/SecondNewYearDayTest.php b/tests/Georgia/SecondNewYearDayTest.php index 332122cea..f97e9faf7 100644 --- a/tests/Georgia/SecondNewYearDayTest.php +++ b/tests/Georgia/SecondNewYearDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class SecondNewYearDayTest extends GeorgiaBaseTestCase implements HolidayTestCas /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/StAndrewsDayTest.php b/tests/Georgia/StAndrewsDayTest.php index 366fd2e57..99947bcd3 100644 --- a/tests/Georgia/StAndrewsDayTest.php +++ b/tests/Georgia/StAndrewsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class StAndrewsDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/StGeorgesDayTest.php b/tests/Georgia/StGeorgesDayTest.php index b52ddb52e..4b3491792 100644 --- a/tests/Georgia/StGeorgesDayTest.php +++ b/tests/Georgia/StGeorgesDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class StGeorgesDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/StMarysDayTest.php b/tests/Georgia/StMarysDayTest.php index 4e9685f02..91eb60a5e 100644 --- a/tests/Georgia/StMarysDayTest.php +++ b/tests/Georgia/StMarysDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class StMarysDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Georgia/UnityDayTest.php b/tests/Georgia/UnityDayTest.php index 0b3492da3..0cf687028 100644 --- a/tests/Georgia/UnityDayTest.php +++ b/tests/Georgia/UnityDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,8 +26,7 @@ class UnityDayTest extends GeorgiaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'unityDay'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { @@ -40,14 +35,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-09", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-09", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -63,8 +56,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Georgia/VictoryDayTest.php b/tests/Georgia/VictoryDayTest.php index ef56d84c2..ac28a0bab 100644 --- a/tests/Georgia/VictoryDayTest.php +++ b/tests/Georgia/VictoryDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Georgia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +27,8 @@ class VictoryDayTest extends GeorgiaBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -41,9 +36,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -53,7 +48,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +63,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/AscensionDayTest.php b/tests/Germany/AscensionDayTest.php index a3950edc5..7f452e8fd 100644 --- a/tests/Germany/AscensionDayTest.php +++ b/tests/Germany/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, 'ascensionDay', $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php b/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php index 7a6db7fe5..9b80ea766 100644 --- a/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php +++ b/tests/Germany/BadenWurttemberg/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\BadenWurttemberg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends BadenWurttembergBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/BadenWurttemberg/BadenWurttembergBaseTestCase.php b/tests/Germany/BadenWurttemberg/BadenWurttembergBaseTestCase.php index 850a69695..3883d571c 100644 --- a/tests/Germany/BadenWurttemberg/BadenWurttembergBaseTestCase.php +++ b/tests/Germany/BadenWurttemberg/BadenWurttembergBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/BadenWurttemberg/BadenWurttembergTest.php b/tests/Germany/BadenWurttemberg/BadenWurttembergTest.php index c409c9c17..3e11eafcd 100644 --- a/tests/Germany/BadenWurttemberg/BadenWurttembergTest.php +++ b/tests/Germany/BadenWurttemberg/BadenWurttembergTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\BadenWurttemberg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BadenWurttembergTest extends BadenWurttembergBaseTestCase implements Provi /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,13 +39,12 @@ protected function setUp(): void /** * Tests if all official holidays in Baden-Württemberg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { $this->assertDefinedHolidays([ 'newYearsDay', + 'epiphany', 'goodFriday', 'easterMonday', 'internationalWorkersDay', @@ -60,8 +60,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Baden-Württemberg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +68,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Baden-Württemberg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +76,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Baden-Württemberg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,13 +84,11 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Baden-Württemberg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { $this->assertDefinedHolidays( - ['epiphany'], + [], self::REGION, $this->year, Holiday::TYPE_OTHER @@ -104,7 +96,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/BadenWurttemberg/CorpusChristiTest.php b/tests/Germany/BadenWurttemberg/CorpusChristiTest.php index 8b17388f3..870e7702f 100644 --- a/tests/Germany/BadenWurttemberg/CorpusChristiTest.php +++ b/tests/Germany/BadenWurttemberg/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\BadenWurttemberg; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends BadenWurttembergBaseTestCase implements HolidayT /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/BadenWurttemberg/EpiphanyTest.php b/tests/Germany/BadenWurttemberg/EpiphanyTest.php index 254dc7b15..3a37baf9f 100644 --- a/tests/Germany/BadenWurttemberg/EpiphanyTest.php +++ b/tests/Germany/BadenWurttemberg/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\BadenWurttemberg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends BadenWurttembergBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,10 +70,10 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Germany/BadenWurttemberg/GermanUnityDayTest.php b/tests/Germany/BadenWurttemberg/GermanUnityDayTest.php index 9bdefaf71..d938a4c46 100644 --- a/tests/Germany/BadenWurttemberg/GermanUnityDayTest.php +++ b/tests/Germany/BadenWurttemberg/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/BadenWurttemberg/ReformationDay2017Test.php b/tests/Germany/BadenWurttemberg/ReformationDay2017Test.php index dfb7b6641..981fda8a2 100644 --- a/tests/Germany/BadenWurttemberg/ReformationDay2017Test.php +++ b/tests/Germany/BadenWurttemberg/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bavaria/AllSaintsDayTest.php b/tests/Germany/Bavaria/AllSaintsDayTest.php index 80f7be042..97d825d28 100644 --- a/tests/Germany/Bavaria/AllSaintsDayTest.php +++ b/tests/Germany/Bavaria/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\Bavaria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends BavariaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Bavaria/BavariaBaseTestCase.php b/tests/Germany/Bavaria/BavariaBaseTestCase.php index e666c8a7e..1d029c872 100644 --- a/tests/Germany/Bavaria/BavariaBaseTestCase.php +++ b/tests/Germany/Bavaria/BavariaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bavaria/BavariaTest.php b/tests/Germany/Bavaria/BavariaTest.php index d9dbe3947..96497aae4 100644 --- a/tests/Germany/Bavaria/BavariaTest.php +++ b/tests/Germany/Bavaria/BavariaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Bavaria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BavariaTest extends BavariaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,13 +39,12 @@ protected function setUp(): void /** * Tests if all official holidays in Bavaria (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { $this->assertDefinedHolidays([ 'newYearsDay', + 'epiphany', 'goodFriday', 'easterMonday', 'internationalWorkersDay', @@ -60,8 +60,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Bavaria (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +68,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Bavaria (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +76,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Bavaria (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,13 +84,11 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Bavaria (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { $this->assertDefinedHolidays( - ['epiphany'], + [], self::REGION, $this->year, Holiday::TYPE_OTHER @@ -104,7 +96,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Bavaria/CorpusChristiTest.php b/tests/Germany/Bavaria/CorpusChristiTest.php index b806ff93c..a02dd434f 100644 --- a/tests/Germany/Bavaria/CorpusChristiTest.php +++ b/tests/Germany/Bavaria/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\Bavaria; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends BavariaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Bavaria/EpiphanyTest.php b/tests/Germany/Bavaria/EpiphanyTest.php index 50ba9182b..21a420b00 100644 --- a/tests/Germany/Bavaria/EpiphanyTest.php +++ b/tests/Germany/Bavaria/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\Bavaria; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends BavariaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,10 +70,10 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Germany/Bavaria/GermanUnityDayTest.php b/tests/Germany/Bavaria/GermanUnityDayTest.php index e452d1bf3..34ea48052 100644 --- a/tests/Germany/Bavaria/GermanUnityDayTest.php +++ b/tests/Germany/Bavaria/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bavaria/ReformationDay2017Test.php b/tests/Germany/Bavaria/ReformationDay2017Test.php index 5a08ea0a2..c11c67e2f 100644 --- a/tests/Germany/Bavaria/ReformationDay2017Test.php +++ b/tests/Germany/Bavaria/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Berlin/BerlinBaseTestCase.php b/tests/Germany/Berlin/BerlinBaseTestCase.php index b1f824478..4f02847d3 100644 --- a/tests/Germany/Berlin/BerlinBaseTestCase.php +++ b/tests/Germany/Berlin/BerlinBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Berlin/BerlinTest.php b/tests/Germany/Berlin/BerlinTest.php index fa551e4ec..caf7dab59 100644 --- a/tests/Germany/Berlin/BerlinTest.php +++ b/tests/Germany/Berlin/BerlinTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Berlin; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BerlinTest extends BerlinBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Berlin (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Berlin (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Berlin (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Berlin (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Berlin (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Berlin/DayOfLiberation2020Test.php b/tests/Germany/Berlin/DayOfLiberation2020Test.php index 75c724390..0445cdadf 100644 --- a/tests/Germany/Berlin/DayOfLiberation2020Test.php +++ b/tests/Germany/Berlin/DayOfLiberation2020Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Berlin; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class DayOfLiberation2020Test extends BerlinBaseTestCase implements HolidayTestC /** * Test the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayInYear(): void { @@ -48,14 +43,14 @@ public function testHolidayInYear(): void self::REGION, self::HOLIDAY, self::YEAR, - new DateTime(self::YEAR.'-05-08', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::YEAR.'-05-08', new \DateTimeZone(self::TIMEZONE)) ); } /** * Test the holiday defined in this test in the years before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeYear(): void { @@ -69,7 +64,7 @@ public function testHolidayBeforeYear(): void /** * Test the holiday defined in this test in the years after. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterYear(): void { @@ -82,8 +77,6 @@ public function testHolidayAfterYear(): void /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -97,8 +90,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Germany/Berlin/GermanUnityDayTest.php b/tests/Germany/Berlin/GermanUnityDayTest.php index 2b9e1183a..a41153d68 100644 --- a/tests/Germany/Berlin/GermanUnityDayTest.php +++ b/tests/Germany/Berlin/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Berlin/InternationalWomensDay2019Test.php b/tests/Germany/Berlin/InternationalWomensDay2019Test.php index d339363e0..7c5f89080 100644 --- a/tests/Germany/Berlin/InternationalWomensDay2019Test.php +++ b/tests/Germany/Berlin/InternationalWomensDay2019Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Berlin; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class InternationalWomensDay2019Test extends BerlinBaseTestCase implements Holid /** * Test the holiday defined in this test upon establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnEstablishment(): void { @@ -48,14 +43,14 @@ public function testHolidayOnEstablishment(): void self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR, - new DateTime(self::ESTABLISHMENT_YEAR.'-03-08', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::ESTABLISHMENT_YEAR.'-03-08', new \DateTimeZone(self::TIMEZONE)) ); } /** * Test the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -69,7 +64,7 @@ public function testHolidayBeforeEstablishment(): void /** * Test the holiday defined in this test after completion. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterCompletion(): void { @@ -79,7 +74,7 @@ public function testHolidayAfterCompletion(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +89,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Berlin/ReformationDay2017Test.php b/tests/Germany/Berlin/ReformationDay2017Test.php index af10a497c..77f2f666c 100644 --- a/tests/Germany/Berlin/ReformationDay2017Test.php +++ b/tests/Germany/Berlin/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Brandenburg/BrandenburgBaseTestCase.php b/tests/Germany/Brandenburg/BrandenburgBaseTestCase.php index 5f193724f..ec073542a 100644 --- a/tests/Germany/Brandenburg/BrandenburgBaseTestCase.php +++ b/tests/Germany/Brandenburg/BrandenburgBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Brandenburg/BrandenburgTest.php b/tests/Germany/Brandenburg/BrandenburgTest.php index 3fda8a19d..224b2f528 100644 --- a/tests/Germany/Brandenburg/BrandenburgTest.php +++ b/tests/Germany/Brandenburg/BrandenburgTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Brandenburg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BrandenburgTest extends BrandenburgBaseTestCase implements ProviderTestCas /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Brandenburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -69,8 +68,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Brandenburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -79,8 +76,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Brandenburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -89,8 +84,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Brandenburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -99,8 +92,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Brandenburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -108,7 +99,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Brandenburg/GermanUnityDayTest.php b/tests/Germany/Brandenburg/GermanUnityDayTest.php index ad6bf1fd1..9f701bd94 100644 --- a/tests/Germany/Brandenburg/GermanUnityDayTest.php +++ b/tests/Germany/Brandenburg/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Brandenburg/ReformationDayTest.php b/tests/Germany/Brandenburg/ReformationDayTest.php index 29c0658c0..0cdc1d9fb 100644 --- a/tests/Germany/Brandenburg/ReformationDayTest.php +++ b/tests/Germany/Brandenburg/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Brandenburg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends BrandenburgBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Bremen/BremenBaseTestCase.php b/tests/Germany/Bremen/BremenBaseTestCase.php index defced46b..a6d6142d5 100644 --- a/tests/Germany/Bremen/BremenBaseTestCase.php +++ b/tests/Germany/Bremen/BremenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bremen/BremenTest.php b/tests/Germany/Bremen/BremenTest.php index 49ae20575..4487c7b3a 100644 --- a/tests/Germany/Bremen/BremenTest.php +++ b/tests/Germany/Bremen/BremenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Bremen; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BremenTest extends BremenBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Bremen (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Bremen (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Bremen (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Bremen (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Bremen (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Bremen/GermanUnityDayTest.php b/tests/Germany/Bremen/GermanUnityDayTest.php index 3f3c93422..8b375bfbf 100644 --- a/tests/Germany/Bremen/GermanUnityDayTest.php +++ b/tests/Germany/Bremen/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bremen/ReformationDay2017Test.php b/tests/Germany/Bremen/ReformationDay2017Test.php index a3d3cc519..c3de1c197 100644 --- a/tests/Germany/Bremen/ReformationDay2017Test.php +++ b/tests/Germany/Bremen/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Bremen/ReformationDayTest.php b/tests/Germany/Bremen/ReformationDayTest.php index e06af97c9..e070cf7fa 100644 --- a/tests/Germany/Bremen/ReformationDayTest.php +++ b/tests/Germany/Bremen/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Bremen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends BremenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/ChristmasTest.php b/tests/Germany/ChristmasTest.php index 07f2877a6..1bf1f9121 100644 --- a/tests/Germany/ChristmasTest.php +++ b/tests/Germany/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends GermanyBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/EasterMondayTest.php b/tests/Germany/EasterMondayTest.php index 745eed5ee..bd2a96684 100644 --- a/tests/Germany/EasterMondayTest.php +++ b/tests/Germany/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/GermanUnityDayTest.php b/tests/Germany/GermanUnityDayTest.php index 26633b7eb..ff4503bcc 100644 --- a/tests/Germany/GermanUnityDayTest.php +++ b/tests/Germany/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class GermanUnityDayTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/GermanyBaseTestCase.php b/tests/Germany/GermanyBaseTestCase.php index b60fa04a1..58c5a1e8f 100644 --- a/tests/Germany/GermanyBaseTestCase.php +++ b/tests/Germany/GermanyBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/GermanyTest.php b/tests/Germany/GermanyTest.php index 6c0fde0ba..26ac85210 100644 --- a/tests/Germany/GermanyTest.php +++ b/tests/Germany/GermanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class GermanyTest extends GermanyBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Finland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Germany are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Germany are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Germany are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Germany are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/GoodFridayTest.php b/tests/Germany/GoodFridayTest.php index d37bbd56e..2a36b4f47 100644 --- a/tests/Germany/GoodFridayTest.php +++ b/tests/Germany/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests Good Friday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testGoodFriday(): void { @@ -44,14 +39,14 @@ public function testGoodFriday(): void self::REGION, 'goodFriday', $year, - new DateTime("$year-4-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Hamburg/DayOfReformationTest.php b/tests/Germany/Hamburg/DayOfReformationTest.php index 838e8cb3e..49ed5fefc 100644 --- a/tests/Germany/Hamburg/DayOfReformationTest.php +++ b/tests/Germany/Hamburg/DayOfReformationTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Hamburg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class DayOfReformationTest extends HamburgBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Hamburg/GermanUnityDay.php b/tests/Germany/Hamburg/GermanUnityDay.php index f99bd5a6e..92da625e9 100644 --- a/tests/Germany/Hamburg/GermanUnityDay.php +++ b/tests/Germany/Hamburg/GermanUnityDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Hamburg/HamburgBaseTestCase.php b/tests/Germany/Hamburg/HamburgBaseTestCase.php index d34f7112c..3c501da82 100644 --- a/tests/Germany/Hamburg/HamburgBaseTestCase.php +++ b/tests/Germany/Hamburg/HamburgBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Hamburg/HamburgTest.php b/tests/Germany/Hamburg/HamburgTest.php index 5b84a54ae..fac9bcdc1 100644 --- a/tests/Germany/Hamburg/HamburgTest.php +++ b/tests/Germany/Hamburg/HamburgTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Hamburg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class HamburgTest extends HamburgBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Hamburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Hamburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Hamburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Hamburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Hamburg (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Hamburg/ReformationDay2017Test.php b/tests/Germany/Hamburg/ReformationDay2017Test.php index b5f059ca7..b82a0b79d 100644 --- a/tests/Germany/Hamburg/ReformationDay2017Test.php +++ b/tests/Germany/Hamburg/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Hesse/CorpusChristiTest.php b/tests/Germany/Hesse/CorpusChristiTest.php index dd6871470..27abe85c6 100644 --- a/tests/Germany/Hesse/CorpusChristiTest.php +++ b/tests/Germany/Hesse/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\Hesse; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends HesseBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Hesse/GermanUnityDayTest.php b/tests/Germany/Hesse/GermanUnityDayTest.php index 68c6b5f57..446664c9a 100644 --- a/tests/Germany/Hesse/GermanUnityDayTest.php +++ b/tests/Germany/Hesse/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Hesse/HesseBaseTestCase.php b/tests/Germany/Hesse/HesseBaseTestCase.php index 407749f0c..a4763ad71 100644 --- a/tests/Germany/Hesse/HesseBaseTestCase.php +++ b/tests/Germany/Hesse/HesseBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Hesse/HesseTest.php b/tests/Germany/Hesse/HesseTest.php index 21d6b8610..f8ba25a34 100644 --- a/tests/Germany/Hesse/HesseTest.php +++ b/tests/Germany/Hesse/HesseTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Hesse; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class HesseTest extends HesseBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Hesse (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Hesse (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Hesse (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Hesse (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Hesse (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Hesse/ReformationDay2017Test.php b/tests/Germany/Hesse/ReformationDay2017Test.php index 61367bb80..2d8061de2 100644 --- a/tests/Germany/Hesse/ReformationDay2017Test.php +++ b/tests/Germany/Hesse/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/InternationalWorkersDayTest.php b/tests/Germany/InternationalWorkersDayTest.php index c6f610643..da7da7d37 100644 --- a/tests/Germany/InternationalWorkersDayTest.php +++ b/tests/Germany/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends GermanyBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Germany/LowerSaxony/GermanUnityDayTest.php b/tests/Germany/LowerSaxony/GermanUnityDayTest.php index 1125f0862..8e0dc561e 100644 --- a/tests/Germany/LowerSaxony/GermanUnityDayTest.php +++ b/tests/Germany/LowerSaxony/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/LowerSaxony/LowerSaxonyBaseTestCase.php b/tests/Germany/LowerSaxony/LowerSaxonyBaseTestCase.php index 64fadf5ac..dabc6732e 100644 --- a/tests/Germany/LowerSaxony/LowerSaxonyBaseTestCase.php +++ b/tests/Germany/LowerSaxony/LowerSaxonyBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/LowerSaxony/LowerSaxonyTest.php b/tests/Germany/LowerSaxony/LowerSaxonyTest.php index b27d90e32..a057ee57d 100644 --- a/tests/Germany/LowerSaxony/LowerSaxonyTest.php +++ b/tests/Germany/LowerSaxony/LowerSaxonyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\LowerSaxony; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class LowerSaxonyTest extends LowerSaxonyBaseTestCase implements ProviderTestCas /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Lower Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Lower Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Lower Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Lower Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Lower Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/LowerSaxony/ReformationDay2017Test.php b/tests/Germany/LowerSaxony/ReformationDay2017Test.php index c55e63c28..0141b794c 100644 --- a/tests/Germany/LowerSaxony/ReformationDay2017Test.php +++ b/tests/Germany/LowerSaxony/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/LowerSaxony/ReformationDayTest.php b/tests/Germany/LowerSaxony/ReformationDayTest.php index 3374eab95..0f9998264 100644 --- a/tests/Germany/LowerSaxony/ReformationDayTest.php +++ b/tests/Germany/LowerSaxony/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\LowerSaxony; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends LowerSaxonyBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/MecklenburgWesternPomerania/GermanUnityDayTest.php b/tests/Germany/MecklenburgWesternPomerania/GermanUnityDayTest.php index f2d3104af..6a08aa040 100644 --- a/tests/Germany/MecklenburgWesternPomerania/GermanUnityDayTest.php +++ b/tests/Germany/MecklenburgWesternPomerania/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaBaseTestCase.php b/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaBaseTestCase.php index f67e3d374..8e3ac8cc5 100644 --- a/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaBaseTestCase.php +++ b/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaTest.php b/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaTest.php index 78bd9b14c..7a3f7b160 100644 --- a/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaTest.php +++ b/tests/Germany/MecklenburgWesternPomerania/MecklenburgWesternPomeraniaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\MecklenburgWesternPomerania; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class MecklenburgWesternPomeraniaTest extends MecklenburgWesternPomeraniaBaseTes /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Mecklenburg-Western Pomerania (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -67,8 +66,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Mecklenburg-Western Pomerania (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -77,8 +74,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Mecklenburg-Western Pomerania (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -87,8 +82,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Mecklenburg-Western Pomerania (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -97,8 +90,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Mecklenburg-Western Pomerania (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -106,7 +97,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php b/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php index 68a81e2fc..ef61f2535 100644 --- a/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php +++ b/tests/Germany/MecklenburgWesternPomerania/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\MecklenburgWesternPomerania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,9 +35,9 @@ class ReformationDayTest extends MecklenburgWesternPomeraniaBaseTestCase impleme /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -49,7 +45,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -58,7 +54,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -72,7 +68,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -87,7 +83,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/NewYearsDayTest.php b/tests/Germany/NewYearsDayTest.php index 00b370e3f..88731cfd2 100644 --- a/tests/Germany/NewYearsDayTest.php +++ b/tests/Germany/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends GermanyBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/NewYearsEveTest.php b/tests/Germany/NewYearsEveTest.php index a42d000f4..d3d913ac1 100644 --- a/tests/Germany/NewYearsEveTest.php +++ b/tests/Germany/NewYearsEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsEveTest extends GermanyBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php b/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php index 4c346b57e..cfc7eb283 100644 --- a/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php +++ b/tests/Germany/NorthRhineWestphalia/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\NorthRhineWestphalia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends NorthRhineWestphaliaBaseTestCase implements Holid * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php b/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php index 3066cdd03..bac7d4d64 100644 --- a/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php +++ b/tests/Germany/NorthRhineWestphalia/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\NorthRhineWestphalia; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends NorthRhineWestphaliaBaseTestCase implements Holi /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/NorthRhineWestphalia/GermanUnityDayTest.php b/tests/Germany/NorthRhineWestphalia/GermanUnityDayTest.php index 54f6caa86..0a1131f67 100644 --- a/tests/Germany/NorthRhineWestphalia/GermanUnityDayTest.php +++ b/tests/Germany/NorthRhineWestphalia/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaBaseTestCase.php b/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaBaseTestCase.php index ff0bd6829..ba52cc796 100644 --- a/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaBaseTestCase.php +++ b/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaTest.php b/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaTest.php index 35751c641..4a5c79eac 100644 --- a/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaTest.php +++ b/tests/Germany/NorthRhineWestphalia/NorthRhineWestphaliaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\NorthRhineWestphalia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NorthRhineWestphaliaTest extends NorthRhineWestphaliaBaseTestCase implemen /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in North Rhine-Westphalia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in North Rhine-Westphalia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +67,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in North Rhine-Westphalia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +75,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in North Rhine-Westphalia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,8 +83,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in North Rhine-Westphalia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -99,7 +90,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/NorthRhineWestphalia/ReformationDay2017Test.php b/tests/Germany/NorthRhineWestphalia/ReformationDay2017Test.php index c77a7efa0..d05a3cd84 100644 --- a/tests/Germany/NorthRhineWestphalia/ReformationDay2017Test.php +++ b/tests/Germany/NorthRhineWestphalia/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/PentecostMondayTest.php b/tests/Germany/PentecostMondayTest.php index 7a84d6265..67027fb77 100644 --- a/tests/Germany/PentecostMondayTest.php +++ b/tests/Germany/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/PentecostTest.php b/tests/Germany/PentecostTest.php index 221ce94cb..d4a3d35bc 100644 --- a/tests/Germany/PentecostTest.php +++ b/tests/Germany/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends GermanyBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime($date, new DateTimeZone(self::TIMEZONE)) + new \DateTime($date, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -71,7 +66,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/ReformationDay2017Test.php b/tests/Germany/ReformationDay2017Test.php index c12b505a1..95fbb45aa 100644 --- a/tests/Germany/ReformationDay2017Test.php +++ b/tests/Germany/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ReformationDay2017Test extends GermanyBaseTestCase implements HolidayTestC /** * Test the holiday defined in this test upon establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnEstablishment(): void { @@ -48,14 +43,14 @@ public function testHolidayOnEstablishment(): void self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR, - new DateTime(self::ESTABLISHMENT_YEAR.'-10-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::ESTABLISHMENT_YEAR.'-10-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Test the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -69,7 +64,7 @@ public function testHolidayBeforeEstablishment(): void /** * Test the holiday defined in this test after completion. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterCompletion(): void { @@ -79,7 +74,7 @@ public function testHolidayAfterCompletion(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +89,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php b/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php index 2ab9e52aa..fe7913de9 100644 --- a/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php +++ b/tests/Germany/RhinelandPalatinate/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\RhinelandPalatinate; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends RhinelandPalatinateBaseTestCase implements Holida * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php b/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php index 445ebc955..9b44f3439 100644 --- a/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php +++ b/tests/Germany/RhinelandPalatinate/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\RhinelandPalatinate; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends RhinelandPalatinateBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/RhinelandPalatinate/GermanUnityDayTest.php b/tests/Germany/RhinelandPalatinate/GermanUnityDayTest.php index eb2838e66..a0d21d25f 100644 --- a/tests/Germany/RhinelandPalatinate/GermanUnityDayTest.php +++ b/tests/Germany/RhinelandPalatinate/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/RhinelandPalatinate/ReformationDay2017Test.php b/tests/Germany/RhinelandPalatinate/ReformationDay2017Test.php index 3a0c68321..1e0d83a07 100644 --- a/tests/Germany/RhinelandPalatinate/ReformationDay2017Test.php +++ b/tests/Germany/RhinelandPalatinate/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/RhinelandPalatinate/RhinelandPalatinateBaseTestCase.php b/tests/Germany/RhinelandPalatinate/RhinelandPalatinateBaseTestCase.php index 552da7458..8097acc84 100644 --- a/tests/Germany/RhinelandPalatinate/RhinelandPalatinateBaseTestCase.php +++ b/tests/Germany/RhinelandPalatinate/RhinelandPalatinateBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/RhinelandPalatinate/RhinelandPalatinateTest.php b/tests/Germany/RhinelandPalatinate/RhinelandPalatinateTest.php index de2f76461..d3ba46919 100644 --- a/tests/Germany/RhinelandPalatinate/RhinelandPalatinateTest.php +++ b/tests/Germany/RhinelandPalatinate/RhinelandPalatinateTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\RhinelandPalatinate; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class RhinelandPalatinateTest extends RhinelandPalatinateBaseTestCase implements /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Rhineland Palatinate (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Rhineland Palatinate (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +67,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Rhineland Palatinate (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +75,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Rhineland Palatinate (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,8 +83,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Rhineland Palatinate (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -99,7 +90,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Saarland/AllSaintsDayTest.php b/tests/Germany/Saarland/AllSaintsDayTest.php index ac5819e0d..23a5b20af 100644 --- a/tests/Germany/Saarland/AllSaintsDayTest.php +++ b/tests/Germany/Saarland/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\Saarland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends SaarlandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Saarland/AssumptionOfMaryTest.php b/tests/Germany/Saarland/AssumptionOfMaryTest.php index a86130098..9167da741 100644 --- a/tests/Germany/Saarland/AssumptionOfMaryTest.php +++ b/tests/Germany/Saarland/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\Saarland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends SaarlandBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Saarland/CorpusChristiTest.php b/tests/Germany/Saarland/CorpusChristiTest.php index a266d6bd7..48014d4a2 100644 --- a/tests/Germany/Saarland/CorpusChristiTest.php +++ b/tests/Germany/Saarland/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\Germany\Saarland; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +30,7 @@ class CorpusChristiTest extends SaarlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,7 +47,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -65,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Saarland/GermanUnityDayTest.php b/tests/Germany/Saarland/GermanUnityDayTest.php index d4d2ef2c3..6722e6969 100644 --- a/tests/Germany/Saarland/GermanUnityDayTest.php +++ b/tests/Germany/Saarland/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Saarland/ReformationDay2017Test.php b/tests/Germany/Saarland/ReformationDay2017Test.php index b4e3cd323..ee2ed7e3f 100644 --- a/tests/Germany/Saarland/ReformationDay2017Test.php +++ b/tests/Germany/Saarland/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Saarland/SaarlandBaseTestCase.php b/tests/Germany/Saarland/SaarlandBaseTestCase.php index 9f197aabe..127d1af10 100644 --- a/tests/Germany/Saarland/SaarlandBaseTestCase.php +++ b/tests/Germany/Saarland/SaarlandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Saarland/SaarlandTest.php b/tests/Germany/Saarland/SaarlandTest.php index 2524fbdec..213c3827f 100644 --- a/tests/Germany/Saarland/SaarlandTest.php +++ b/tests/Germany/Saarland/SaarlandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Saarland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SaarlandTest extends SaarlandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Saarland (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Saarland (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -70,8 +67,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Saarland (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -80,8 +75,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Saarland (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -90,8 +83,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Saarland (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -99,7 +90,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Saxony/GermanUnityDayTest.php b/tests/Germany/Saxony/GermanUnityDayTest.php index dcce24f21..ac1de7c9a 100644 --- a/tests/Germany/Saxony/GermanUnityDayTest.php +++ b/tests/Germany/Saxony/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Saxony/ReformationDayTest.php b/tests/Germany/Saxony/ReformationDayTest.php index 393243a2e..2027c298c 100644 --- a/tests/Germany/Saxony/ReformationDayTest.php +++ b/tests/Germany/Saxony/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Saxony; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends SaxonyBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php b/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php index ef9429e7d..6f1f3de4b 100644 --- a/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php +++ b/tests/Germany/Saxony/RepentanceAndPrayerDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Saxony; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,14 +40,13 @@ class RepentanceAndPrayerDayTest extends SaxonyBaseTestCase implements HolidayTe /** * Tests the holiday defined in this test on or after establishment. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { // Check between the 16th and 22nd day the one that is a Wednesday $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $holiday = new DateTime("next wednesday $year-11-15", new DateTimeZone(self::TIMEZONE)); // Default date + $holiday = new \DateTime("next wednesday $year-11-15", new \DateTimeZone(self::TIMEZONE)); // Default date $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $holiday); @@ -64,7 +59,7 @@ public function testHolidayOnAfterEstablishment(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -78,7 +73,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Saxony/SaxonyBaseTestCase.php b/tests/Germany/Saxony/SaxonyBaseTestCase.php index 5b6e4a831..83905bc6c 100644 --- a/tests/Germany/Saxony/SaxonyBaseTestCase.php +++ b/tests/Germany/Saxony/SaxonyBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Saxony/SaxonyTest.php b/tests/Germany/Saxony/SaxonyTest.php index b3713cc58..8f45e12c0 100644 --- a/tests/Germany/Saxony/SaxonyTest.php +++ b/tests/Germany/Saxony/SaxonyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Saxony; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SaxonyTest extends SaxonyBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Saxony (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/SaxonyAnhalt/EpiphanyTest.php b/tests/Germany/SaxonyAnhalt/EpiphanyTest.php index e1968ac96..c2b3d5619 100644 --- a/tests/Germany/SaxonyAnhalt/EpiphanyTest.php +++ b/tests/Germany/SaxonyAnhalt/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany\SaxonyAnhalt; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends SaxonyAnhaltBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,10 +70,10 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); + $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); } } diff --git a/tests/Germany/SaxonyAnhalt/GermanUnityDayTest.php b/tests/Germany/SaxonyAnhalt/GermanUnityDayTest.php index a3ba82f65..716e688ef 100644 --- a/tests/Germany/SaxonyAnhalt/GermanUnityDayTest.php +++ b/tests/Germany/SaxonyAnhalt/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/SaxonyAnhalt/ReformationDayTest.php b/tests/Germany/SaxonyAnhalt/ReformationDayTest.php index dbec24d74..513857af5 100644 --- a/tests/Germany/SaxonyAnhalt/ReformationDayTest.php +++ b/tests/Germany/SaxonyAnhalt/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\SaxonyAnhalt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends SaxonyAnhaltBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/SaxonyAnhalt/SaxonyAnhaltBaseTestCase.php b/tests/Germany/SaxonyAnhalt/SaxonyAnhaltBaseTestCase.php index f7972c328..3b1548959 100644 --- a/tests/Germany/SaxonyAnhalt/SaxonyAnhaltBaseTestCase.php +++ b/tests/Germany/SaxonyAnhalt/SaxonyAnhaltBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/SaxonyAnhalt/SaxonyAnhaltTest.php b/tests/Germany/SaxonyAnhalt/SaxonyAnhaltTest.php index f15d9d599..3cb8a9258 100644 --- a/tests/Germany/SaxonyAnhalt/SaxonyAnhaltTest.php +++ b/tests/Germany/SaxonyAnhalt/SaxonyAnhaltTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\SaxonyAnhalt; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SaxonyAnhaltTest extends SaxonyAnhaltBaseTestCase implements ProviderTestC /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,13 +39,12 @@ protected function setUp(): void /** * Tests if all official holidays in Saxony-Anhalt (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { $holidays = [ 'newYearsDay', + 'epiphany', 'goodFriday', 'easterMonday', 'internationalWorkersDay', @@ -67,8 +67,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Saxony-Anhalt (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -77,8 +75,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Saxony-Anhalt (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -87,8 +83,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Saxony-Anhalt (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -97,16 +91,15 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Saxony-Anhalt (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { - $this->assertDefinedHolidays(['epiphany'], self::REGION, $this->year, Holiday::TYPE_OTHER); + $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/SchleswigHolstein/GermanUnityDayTest.php b/tests/Germany/SchleswigHolstein/GermanUnityDayTest.php index 729a8acc9..eaed998b7 100644 --- a/tests/Germany/SchleswigHolstein/GermanUnityDayTest.php +++ b/tests/Germany/SchleswigHolstein/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/SchleswigHolstein/ReformationDay2017Test.php b/tests/Germany/SchleswigHolstein/ReformationDay2017Test.php index 8e2c34032..10b351db4 100644 --- a/tests/Germany/SchleswigHolstein/ReformationDay2017Test.php +++ b/tests/Germany/SchleswigHolstein/ReformationDay2017Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/SchleswigHolstein/ReformationDayTest.php b/tests/Germany/SchleswigHolstein/ReformationDayTest.php index 03767debb..2f32416b9 100644 --- a/tests/Germany/SchleswigHolstein/ReformationDayTest.php +++ b/tests/Germany/SchleswigHolstein/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\SchleswigHolstein; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends SchleswigHolsteinBaseTestCase implements Holida * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/SchleswigHolstein/SchleswigHolsteinBaseTestCase.php b/tests/Germany/SchleswigHolstein/SchleswigHolsteinBaseTestCase.php index 8067dc9d5..d6da74e1d 100644 --- a/tests/Germany/SchleswigHolstein/SchleswigHolsteinBaseTestCase.php +++ b/tests/Germany/SchleswigHolstein/SchleswigHolsteinBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/SchleswigHolstein/SchleswigHolsteinTest.php b/tests/Germany/SchleswigHolstein/SchleswigHolsteinTest.php index 28eb39bc6..06e53063f 100644 --- a/tests/Germany/SchleswigHolstein/SchleswigHolsteinTest.php +++ b/tests/Germany/SchleswigHolstein/SchleswigHolsteinTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\SchleswigHolstein; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SchleswigHolsteinTest extends SchleswigHolsteinBaseTestCase implements Pro /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Schleswig-Holstein (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Schleswig-Holstein (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Schleswig-Holstein (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Schleswig-Holstein (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Schleswig-Holstein (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/SecondChristmasDayTest.php b/tests/Germany/SecondChristmasDayTest.php index b4b819b10..8989db8b2 100644 --- a/tests/Germany/SecondChristmasDayTest.php +++ b/tests/Germany/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Germany; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends GermanyBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Thuringia/GermanUnityDayTest.php b/tests/Germany/Thuringia/GermanUnityDayTest.php index 48b9853df..cbc9090e1 100644 --- a/tests/Germany/Thuringia/GermanUnityDayTest.php +++ b/tests/Germany/Thuringia/GermanUnityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Thuringia/ReformationDayTest.php b/tests/Germany/Thuringia/ReformationDayTest.php index 1bc00a392..8fa07a559 100644 --- a/tests/Germany/Thuringia/ReformationDayTest.php +++ b/tests/Germany/Thuringia/ReformationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Thuringia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class ReformationDayTest extends ThuringiaBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Germany/Thuringia/ThuringiaBaseTestCase.php b/tests/Germany/Thuringia/ThuringiaBaseTestCase.php index 5233b8b17..160931d0f 100644 --- a/tests/Germany/Thuringia/ThuringiaBaseTestCase.php +++ b/tests/Germany/Thuringia/ThuringiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Germany/Thuringia/ThuringiaTest.php b/tests/Germany/Thuringia/ThuringiaTest.php index de62a7adf..90177db63 100644 --- a/tests/Germany/Thuringia/ThuringiaTest.php +++ b/tests/Germany/Thuringia/ThuringiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Germany\Thuringia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ThuringiaTest extends ThuringiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Thuringia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Thuringia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Thuringia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Thuringia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Thuringia (Germany) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Germany/Thuringia/WorldChildrensDayTest.php b/tests/Germany/Thuringia/WorldChildrensDayTest.php index 6141fb6ab..86335f728 100644 --- a/tests/Germany/Thuringia/WorldChildrensDayTest.php +++ b/tests/Germany/Thuringia/WorldChildrensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Germany\Thuringia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +37,10 @@ class WorldChildrensDayTest extends ThuringiaBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +48,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +58,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $data[] = [$year, new DateTime("$year-09-20", new DateTimeZone(self::TIMEZONE))]; + $data[] = [$year, new \DateTime("$year-09-20", new \DateTimeZone(self::TIMEZONE))]; } return $data; @@ -73,7 +67,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/AnnunciationTest.php b/tests/Greece/AnnunciationTest.php index e3a664e79..e8406fe03 100644 --- a/tests/Greece/AnnunciationTest.php +++ b/tests/Greece/AnnunciationTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AnnunciationTest extends GreeceBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/AscensionDayTest.php b/tests/Greece/AscensionDayTest.php index 442ac7ab8..5d30465cb 100644 --- a/tests/Greece/AscensionDayTest.php +++ b/tests/Greece/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/AssumptionOfMaryTest.php b/tests/Greece/AssumptionOfMaryTest.php index 38a321417..73a706638 100644 --- a/tests/Greece/AssumptionOfMaryTest.php +++ b/tests/Greece/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends GreeceBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/ChristmasDayTest.php b/tests/Greece/ChristmasDayTest.php index f7e6e60ec..07eedffe4 100644 --- a/tests/Greece/ChristmasDayTest.php +++ b/tests/Greece/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends GreeceBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/CleanMondayTest.php b/tests/Greece/CleanMondayTest.php index 025fc6c1e..22d1a8c9c 100644 --- a/tests/Greece/CleanMondayTest.php +++ b/tests/Greece/CleanMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class CleanMondayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/EasterMondayTest.php b/tests/Greece/EasterMondayTest.php index 000efc060..29127257f 100644 --- a/tests/Greece/EasterMondayTest.php +++ b/tests/Greece/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/EasterTest.php b/tests/Greece/EasterTest.php index d8c44a9ec..79e6f5dd4 100644 --- a/tests/Greece/EasterTest.php +++ b/tests/Greece/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/EpiphanyTest.php b/tests/Greece/EpiphanyTest.php index b73ba79e8..52156cd50 100644 --- a/tests/Greece/EpiphanyTest.php +++ b/tests/Greece/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends GreeceBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Epiphany. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/GreeceBaseTestCase.php b/tests/Greece/GreeceBaseTestCase.php index b734bf4fc..331f5fc7f 100644 --- a/tests/Greece/GreeceBaseTestCase.php +++ b/tests/Greece/GreeceBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Greece/GreeceTest.php b/tests/Greece/GreeceTest.php index 78024df39..9fb13e4ea 100644 --- a/tests/Greece/GreeceTest.php +++ b/tests/Greece/GreeceTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Greece; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class GreeceTest extends GreeceBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Greece are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -64,8 +63,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Greece are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Greece are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Greece are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Greece are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -108,7 +99,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Greece/IndepencenceDayTest.php b/tests/Greece/IndepencenceDayTest.php index 4f96f8c92..92b79cbbf 100644 --- a/tests/Greece/IndepencenceDayTest.php +++ b/tests/Greece/IndepencenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndepencenceDayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/InternationalWorkersDayTest.php b/tests/Greece/InternationalWorkersDayTest.php index 3b30e9528..3f03d107e 100644 --- a/tests/Greece/InternationalWorkersDayTest.php +++ b/tests/Greece/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends GreeceBaseTestCase implements HolidayT * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Greece/NewYearsDayTest.php b/tests/Greece/NewYearsDayTest.php index c2e8ec7dc..504575b83 100644 --- a/tests/Greece/NewYearsDayTest.php +++ b/tests/Greece/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends GreeceBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testHoliday(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Greece/OhiDayTest.php b/tests/Greece/OhiDayTest.php index 6ba7b42ca..1bc8d17ad 100644 --- a/tests/Greece/OhiDayTest.php +++ b/tests/Greece/OhiDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class OhiDayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/PentecostMondayTest.php b/tests/Greece/PentecostMondayTest.php index 593b8c9d7..3d630e64f 100644 --- a/tests/Greece/PentecostMondayTest.php +++ b/tests/Greece/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/PentecostTest.php b/tests/Greece/PentecostTest.php index fb255be6a..0bca0640c 100644 --- a/tests/Greece/PentecostTest.php +++ b/tests/Greece/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-19", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-19", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/PolytechnioTest.php b/tests/Greece/PolytechnioTest.php index a68c70b56..c5a657eeb 100644 --- a/tests/Greece/PolytechnioTest.php +++ b/tests/Greece/PolytechnioTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PolytechnioTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/ThreeHolyHierarchsTest.php b/tests/Greece/ThreeHolyHierarchsTest.php index eae7698b8..4bf21b272 100644 --- a/tests/Greece/ThreeHolyHierarchsTest.php +++ b/tests/Greece/ThreeHolyHierarchsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ThreeHolyHierarchsTest extends GreeceBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Greece/goodFridayTest.php b/tests/Greece/goodFridayTest.php index c328a7578..663891c6f 100644 --- a/tests/Greece/goodFridayTest.php +++ b/tests/Greece/goodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Greece; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class goodFridayTest extends GreeceBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-29", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/HolidayTestCase.php b/tests/HolidayTestCase.php index 6124be808..4e0ae559c 100644 --- a/tests/HolidayTestCase.php +++ b/tests/HolidayTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Hungary/AllSaintsDayTest.php b/tests/Hungary/AllSaintsDayTest.php index 35f85c4c1..4bb742a5d 100644 --- a/tests/Hungary/AllSaintsDayTest.php +++ b/tests/Hungary/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends HungaryBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/ChristmasTest.php b/tests/Hungary/ChristmasTest.php index c459b593d..1025918f8 100644 --- a/tests/Hungary/ChristmasTest.php +++ b/tests/Hungary/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends HungaryBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/EasterMondayTest.php b/tests/Hungary/EasterMondayTest.php index 1de531198..b034493fb 100644 --- a/tests/Hungary/EasterMondayTest.php +++ b/tests/Hungary/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/EasterTest.php b/tests/Hungary/EasterTest.php index 97eb06ec2..b5e8dbab1 100644 --- a/tests/Hungary/EasterTest.php +++ b/tests/Hungary/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/HungaryBaseTestCase.php b/tests/Hungary/HungaryBaseTestCase.php index 55221b86e..4da1d0098 100644 --- a/tests/Hungary/HungaryBaseTestCase.php +++ b/tests/Hungary/HungaryBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Hungary/HungaryTest.php b/tests/Hungary/HungaryTest.php index 2189669f4..e57cabdc4 100644 --- a/tests/Hungary/HungaryTest.php +++ b/tests/Hungary/HungaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Hungary; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class HungaryTest extends HungaryBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Hungary are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -75,8 +74,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Hungary are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -85,8 +82,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Hungary are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -95,8 +90,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Hungary are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -105,8 +98,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Hungary are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -114,7 +105,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Hungary/InternationalWorkersDayTest.php b/tests/Hungary/InternationalWorkersDayTest.php index 116161df1..c968d45fb 100644 --- a/tests/Hungary/InternationalWorkersDayTest.php +++ b/tests/Hungary/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends HungaryBaseTestCase implements Holiday * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/MemorialDay1848Test.php b/tests/Hungary/MemorialDay1848Test.php index 97b4d32a0..1d256c967 100644 --- a/tests/Hungary/MemorialDay1848Test.php +++ b/tests/Hungary/MemorialDay1848Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MemorialDay1848Test extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/MemorialDay1956Test.php b/tests/Hungary/MemorialDay1956Test.php index ce181e8c3..77d080cf7 100644 --- a/tests/Hungary/MemorialDay1956Test.php +++ b/tests/Hungary/MemorialDay1956Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MemorialDay1956Test extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/NewYearsDayTest.php b/tests/Hungary/NewYearsDayTest.php index 8b8cd3e57..7b4264071 100644 --- a/tests/Hungary/NewYearsDayTest.php +++ b/tests/Hungary/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends HungaryBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/PentecostMondayTest.php b/tests/Hungary/PentecostMondayTest.php index c5c7d1cc3..86d93f0ba 100644 --- a/tests/Hungary/PentecostMondayTest.php +++ b/tests/Hungary/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/PentecostTest.php b/tests/Hungary/PentecostTest.php index 6518f5c55..35bdb6f53 100644 --- a/tests/Hungary/PentecostTest.php +++ b/tests/Hungary/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends HungaryBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/SecondChristmasDayTest.php b/tests/Hungary/SecondChristmasDayTest.php index 01ab9eb04..96cfd8d1c 100644 --- a/tests/Hungary/SecondChristmasDayTest.php +++ b/tests/Hungary/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends HungaryBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Hungary/StateFoundationDayTest.php b/tests/Hungary/StateFoundationDayTest.php index 50aff2bdd..7e11aaef7 100644 --- a/tests/Hungary/StateFoundationDayTest.php +++ b/tests/Hungary/StateFoundationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Hungary; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class StateFoundationDayTest extends HungaryBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/AugustHolidayTest.php b/tests/Ireland/AugustHolidayTest.php index 18b78e383..a2d138f2b 100644 --- a/tests/Ireland/AugustHolidayTest.php +++ b/tests/Ireland/AugustHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AugustHolidayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,7 +43,7 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); $this->assertDayOfWeek(self::REGION, self::HOLIDAY, $year, 'Monday'); } @@ -56,9 +51,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("next monday $year-7-31", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("next monday $year-7-31", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -77,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -98,7 +93,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/ChristmasDayTest.php b/tests/Ireland/ChristmasDayTest.php index 74196e2e7..10afb24e9 100644 --- a/tests/Ireland/ChristmasDayTest.php +++ b/tests/Ireland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +35,11 @@ class ChristmasDayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -56,9 +51,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/EasterMondayTest.php b/tests/Ireland/EasterMondayTest.php index fb681c971..84f262888 100644 --- a/tests/Ireland/EasterMondayTest.php +++ b/tests/Ireland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -99,7 +93,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/EasterTest.php b/tests/Ireland/EasterTest.php index 31482138b..756f6a9ef 100644 --- a/tests/Ireland/EasterTest.php +++ b/tests/Ireland/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EasterTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -48,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/GoodFridayTest.php b/tests/Ireland/GoodFridayTest.php index 40a1203d9..eaac49c00 100644 --- a/tests/Ireland/GoodFridayTest.php +++ b/tests/Ireland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class GoodFridayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->sub(new DateInterval('P2D')); + $date->sub(new \DateInterval('P2D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -98,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/IrelandBaseTestCase.php b/tests/Ireland/IrelandBaseTestCase.php index fb9fed554..e38649ffb 100644 --- a/tests/Ireland/IrelandBaseTestCase.php +++ b/tests/Ireland/IrelandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Ireland/IrelandTest.php b/tests/Ireland/IrelandTest.php index dd9787043..fa7b197f6 100644 --- a/tests/Ireland/IrelandTest.php +++ b/tests/Ireland/IrelandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Ireland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class IrelandTest extends IrelandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -70,8 +69,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -80,8 +77,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -90,8 +85,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -100,8 +93,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -109,7 +100,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Ireland/JuneHolidayTest.php b/tests/Ireland/JuneHolidayTest.php index 2bf25296e..dcf68cb0b 100644 --- a/tests/Ireland/JuneHolidayTest.php +++ b/tests/Ireland/JuneHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class JuneHolidayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,7 +48,7 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); $this->assertDayOfWeek(self::REGION, self::HOLIDAY, $year, 'Monday'); } @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("next monday $year-5-31", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("next monday $year-5-31", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -96,7 +91,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -117,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/MayDayTest.php b/tests/Ireland/MayDayTest.php index b6e5f655a..5e5b3b10d 100644 --- a/tests/Ireland/MayDayTest.php +++ b/tests/Ireland/MayDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class MayDayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,7 +48,7 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); $this->assertDayOfWeek(self::REGION, self::HOLIDAY, $year, 'Monday'); } @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("next monday $year-4-30", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("next monday $year-4-30", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -96,7 +91,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -117,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/NewYearsDayTest.php b/tests/Ireland/NewYearsDayTest.php index 1d72380ab..f8dcf8728 100644 --- a/tests/Ireland/NewYearsDayTest.php +++ b/tests/Ireland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,12 +40,11 @@ class NewYearsDayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (0 === (int) $date->format('w')) { @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -81,7 +76,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -95,7 +90,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +111,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/OctoberHolidayTest.php b/tests/Ireland/OctoberHolidayTest.php index 62a48a31d..37d90254f 100644 --- a/tests/Ireland/OctoberHolidayTest.php +++ b/tests/Ireland/OctoberHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class OctoberHolidayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,7 +48,7 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); $this->assertDayOfWeek(self::REGION, self::HOLIDAY, $year, 'Monday'); } @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("previous monday $year-11-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("previous monday $year-11-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -82,7 +77,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -96,7 +91,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -117,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/PentecostTest.php b/tests/Ireland/PentecostTest.php index 5d560850a..d8f57fc58 100644 --- a/tests/Ireland/PentecostTest.php +++ b/tests/Ireland/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class PentecostTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,26 +43,26 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { $data = []; - //for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { + // for ($y = 0; $y < self::TEST_ITERATIONS; $y++) { for ($y = 0; $y < 2; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P49D')); + $date->add(new \DateInterval('P49D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -99,7 +93,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/StPatricksDayTest.php b/tests/Ireland/StPatricksDayTest.php index 25c6a16fe..47793963b 100644 --- a/tests/Ireland/StPatricksDayTest.php +++ b/tests/Ireland/StPatricksDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,12 +40,11 @@ class StPatricksDayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-3-17", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-3-17", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -81,7 +76,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -95,7 +90,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +111,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/StStephensDayTest.php b/tests/Ireland/StStephensDayTest.php index d4f5939d4..70839ea25 100644 --- a/tests/Ireland/StStephensDayTest.php +++ b/tests/Ireland/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +35,11 @@ class StStephensDayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -56,9 +51,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -76,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -97,7 +92,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ireland/pentecostMondayTest.php b/tests/Ireland/pentecostMondayTest.php index bf47459cf..66255c0fd 100644 --- a/tests/Ireland/pentecostMondayTest.php +++ b/tests/Ireland/pentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Ireland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -45,8 +40,7 @@ class pentecostMondayTest extends IrelandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -54,16 +48,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -72,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(1000, self::ABOLISHMENT_YEAR); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P50D')); + $date->add(new \DateInterval('P50D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -82,7 +76,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test after abolishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayDayAfterAbolishment(): void { @@ -92,7 +86,7 @@ public function testHolidayDayAfterAbolishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -113,7 +107,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/AllSaintsDayTest.php b/tests/Italy/AllSaintsDayTest.php index 897d1931a..e3e80cbed 100644 --- a/tests/Italy/AllSaintsDayTest.php +++ b/tests/Italy/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function AllSaintsDayDataProvider(): array /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/AssumptionOfMaryTest.php b/tests/Italy/AssumptionOfMaryTest.php index c0784d0cf..42bcd3088 100644 --- a/tests/Italy/AssumptionOfMaryTest.php +++ b/tests/Italy/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { @@ -60,7 +55,7 @@ public function AssumptionOfMaryDataProvider(): array /** * Tests translated name of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/ChristmasTest.php b/tests/Italy/ChristmasTest.php index b587483dd..d5e5bbe12 100644 --- a/tests/Italy/ChristmasTest.php +++ b/tests/Italy/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/EasterMondayTest.php b/tests/Italy/EasterMondayTest.php index 96ee4fdf1..d465f1629 100644 --- a/tests/Italy/EasterMondayTest.php +++ b/tests/Italy/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends ItalyBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/EasterTest.php b/tests/Italy/EasterTest.php index 9b3780730..a84798b65 100644 --- a/tests/Italy/EasterTest.php +++ b/tests/Italy/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends ItalyBaseTestCase implements HolidayTestCase /** * Tests Easter. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEaster(): void { @@ -44,14 +39,14 @@ public function testEaster(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/EpiphanyTest.php b/tests/Italy/EpiphanyTest.php index 65b9dab0b..1aa4013d0 100644 --- a/tests/Italy/EpiphanyTest.php +++ b/tests/Italy/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider EpiphanyDataProvider * - * @param int $year the year for which Epiphany needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Epiphany needs to be tested + * @param \DateTime $expected the expected date */ - public function testEpiphany(int $year, DateTime $expected): void + public function testEpiphany(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testEpiphany(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Epiphany. * - * @return array list of test dates for Epiphany + * @return array list of test dates for Epiphany * - * @throws Exception + * @throws \Exception */ public function EpiphanyDataProvider(): array { @@ -60,7 +55,7 @@ public function EpiphanyDataProvider(): array /** * Tests translated name of Epiphany. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/ImmaculateConceptionTest.php b/tests/Italy/ImmaculateConceptionTest.php index 0e63b489e..9f9c177d9 100644 --- a/tests/Italy/ImmaculateConceptionTest.php +++ b/tests/Italy/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends ItalyBaseTestCase implements HolidayTestC * * @dataProvider ImmaculateConceptionDataProvider * - * @param int $year the year for which the day of Immaculate Conception needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of Immaculate Conception needs to be tested + * @param \DateTime $expected the expected date */ - public function testImmaculateConception(int $year, DateTime $expected): void + public function testImmaculateConception(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testImmaculateConception(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the day of Immaculate Conception. * - * @return array list of test dates for the day of Immaculate Conception + * @return array list of test dates for the day of Immaculate Conception * - * @throws Exception + * @throws \Exception */ public function ImmaculateConceptionDataProvider(): array { @@ -60,7 +55,7 @@ public function ImmaculateConceptionDataProvider(): array /** * Tests translated name of the day of Immaculate Conception. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/InternationalWorkersDayTest.php b/tests/Italy/InternationalWorkersDayTest.php index 5e0c78834..30e4c0637 100644 --- a/tests/Italy/InternationalWorkersDayTest.php +++ b/tests/Italy/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends ItalyBaseTestCase implements HolidayTe * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { @@ -60,7 +55,7 @@ public function InternationalWorkersDayDataProvider(): array /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/ItalyBaseTestCase.php b/tests/Italy/ItalyBaseTestCase.php index d610973c8..fc967ab0c 100644 --- a/tests/Italy/ItalyBaseTestCase.php +++ b/tests/Italy/ItalyBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Italy/ItalyTest.php b/tests/Italy/ItalyTest.php index 5f17253e9..c4f0a27ef 100644 --- a/tests/Italy/ItalyTest.php +++ b/tests/Italy/ItalyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Italy; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ItalyTest extends ItalyBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Italy are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -61,8 +60,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Italy are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -71,8 +68,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Italy are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -81,8 +76,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Italy are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -91,8 +84,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Italy are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -100,7 +91,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Italy/LiberationDayTest.php b/tests/Italy/LiberationDayTest.php index 7d4845fdf..62d615c87 100644 --- a/tests/Italy/LiberationDayTest.php +++ b/tests/Italy/LiberationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -46,8 +42,7 @@ class LiberationDayTest extends ItalyBaseTestCase implements HolidayTestCase /** * Tests Liberation Day on or after 1949. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLiberationDayOnAfter1949(): void { @@ -56,14 +51,14 @@ public function testLiberationDayOnAfter1949(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Liberation Day before 1949. * - * @throws ReflectionException + * @throws \Exception */ public function testLiberationDayBefore1949(): void { @@ -77,7 +72,7 @@ public function testLiberationDayBefore1949(): void /** * Tests translated name of Liberation Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/NewYearsDayTest.php b/tests/Italy/NewYearsDayTest.php index ded8bb194..2d8d31d69 100644 --- a/tests/Italy/NewYearsDayTest.php +++ b/tests/Italy/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function NewYearsDayDataProvider(): array /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/RepublicDayTest.php b/tests/Italy/RepublicDayTest.php index 859bd5d75..4aa6259c8 100644 --- a/tests/Italy/RepublicDayTest.php +++ b/tests/Italy/RepublicDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -46,8 +42,7 @@ class RepublicDayTest extends ItalyBaseTestCase implements HolidayTestCase /** * Tests Republic Day on or after 1946. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRepublicDayOnAfter1946(): void { @@ -56,14 +51,14 @@ public function testRepublicDayOnAfter1946(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Republic Day before 1946. * - * @throws ReflectionException + * @throws \Exception */ public function testRepublicDayBefore1946(): void { @@ -77,7 +72,7 @@ public function testRepublicDayBefore1946(): void /** * Tests translated name of Republic Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Italy/stStephensDayTest.php b/tests/Italy/stStephensDayTest.php index 918138e98..ecaceac4f 100644 --- a/tests/Italy/stStephensDayTest.php +++ b/tests/Italy/stStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Italy; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stStephensDayTest extends ItalyBaseTestCase implements HolidayTestCase * * @dataProvider stStephensDayDataProvider * - * @param int $year the year for which St. Stephen's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Stephen's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function teststStephensDay(int $year, DateTime $expected): void + public function teststStephensDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function teststStephensDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Stephen's Day. * - * @return array list of test dates for St. Stephen's Day + * @return array list of test dates for St. Stephen's Day * - * @throws Exception + * @throws \Exception */ public function stStephensDayDataProvider(): array { @@ -60,7 +55,7 @@ public function stStephensDayDataProvider(): array /** * Tests translated name of St. Stephen's Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/AutumnalEquinoxDayTest.php b/tests/Japan/AutumnalEquinoxDayTest.php index f480ab92c..7e3aa02d5 100644 --- a/tests/Japan/AutumnalEquinoxDayTest.php +++ b/tests/Japan/AutumnalEquinoxDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -43,7 +39,7 @@ class AutumnalEquinoxDayTest extends JapanBaseTestCase implements HolidayTestCas * * After 2150 no calculations are available yet. * - * @throws ReflectionException + * @throws \Exception */ public function testAutumnalEquinoxDayOnAfter2150(): void { @@ -63,8 +59,7 @@ public function testAutumnalEquinoxDayOnAfter2150(): void * @param int $month month (number) of example data to be tested * @param int $day day of the month (number) of example data to be tested * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testAutumnalEquinoxDayBetween1948And2150(int $year, int $month, int $day): void { @@ -72,14 +67,14 @@ public function testAutumnalEquinoxDayBetween1948And2150(int $year, int $month, self::REGION, self::HOLIDAY, $year, - new DateTime("$year-$month-$day", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-$month-$day", new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of all Japanese Autumnal Equinox holidays used for assertions. * - * @return array list of Japanese Autumnal Equinox holidays + * @return array list of test dates for the holiday defined in this test */ public function autumnalEquinoxHolidaysProvider(): array { @@ -97,7 +92,7 @@ public function autumnalEquinoxHolidaysProvider(): array * one's ancestors and remember the dead. Prior to 1948, the autumnal equinox was an imperial ancestor worship * festival called Shūki kōrei-sai (秋季皇霊祭). * - * @throws ReflectionException + * @throws \Exception */ public function testAutumnalEquinoxDayBefore1948(): void { @@ -111,7 +106,7 @@ public function testAutumnalEquinoxDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -126,7 +121,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/ChildrensDayTest.php b/tests/Japan/ChildrensDayTest.php index e5f4aef89..4f31f266c 100644 --- a/tests/Japan/ChildrensDayTest.php +++ b/tests/Japan/ChildrensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ChildrensDayTest extends JapanBaseTestCase implements HolidayTestCase /** * Tests Children's Day after 1948. Children's Day was established after 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChildrensDayOnAfter1948(): void { @@ -49,15 +44,14 @@ public function testChildrensDayOnAfter1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Children's Day after 1948 substituted next working day (when Children's Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay(): void { @@ -66,14 +60,14 @@ public function testChildrensDayOnAfter1948SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-5-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Children's Day before 1948. Children's Day was established after 1948. * - * @throws ReflectionException + * @throws \Exception */ public function testChildrensDayBefore1948(): void { @@ -87,7 +81,7 @@ public function testChildrensDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/ComingOfAgeDayTest.php b/tests/Japan/ComingOfAgeDayTest.php index 5fe9295e0..257b92297 100644 --- a/tests/Japan/ComingOfAgeDayTest.php +++ b/tests/Japan/ComingOfAgeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ComingOfAgeDayTest extends JapanBaseTestCase implements HolidayTestCase * Tests Coming of Age Day after 2000. Coming of Age Day was established after 1948 on January 15th. After 2000 it * was changed to be the second monday of January. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testComingOfAgeDayOnAfter2000(): void { @@ -50,7 +45,7 @@ public function testComingOfAgeDayOnAfter2000(): void self::REGION, self::HOLIDAY, $year, - new DateTime("second monday of january $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("second monday of january $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testComingOfAgeDayOnAfter2000(): void * Tests Coming of Age Day between 1948 and 2000. Coming of Age Day was established after 1948 on January 15th. * After 2000 it was changed to be the second monday of January. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testComingOfAgeDayBetween1948And2000(): void { @@ -68,7 +62,7 @@ public function testComingOfAgeDayBetween1948And2000(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-15", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,7 +70,7 @@ public function testComingOfAgeDayBetween1948And2000(): void * Tests Coming of Age Day before 1948. Coming of Age Day was established after 1948 on January 15th. After 2000 it * was changed to be the second monday of January. * - * @throws ReflectionException + * @throws \Exception */ public function testConstitutionMemorialDayBefore1948(): void { @@ -90,7 +84,7 @@ public function testConstitutionMemorialDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/ConstitutionMemorialDayTest.php b/tests/Japan/ConstitutionMemorialDayTest.php index 37bb00c3a..f2d1e0eea 100644 --- a/tests/Japan/ConstitutionMemorialDayTest.php +++ b/tests/Japan/ConstitutionMemorialDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstitutionMemorialDayTest extends JapanBaseTestCase implements HolidayTe /** * Tests Constitution Memorial Day after 1948. Constitution Memorial Day was established after 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testConstitutionMemorialDayOnAfter1948(): void { @@ -49,7 +44,7 @@ public function testConstitutionMemorialDayOnAfter1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-3", new \DateTimeZone(self::TIMEZONE)) ); } @@ -57,8 +52,7 @@ public function testConstitutionMemorialDayOnAfter1948(): void * Tests Constitution Memorial Day after 1948 substituted next working day (when Constitution Memorial Day falls on * a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testConstitutionMemorialDayOnAfter1948SubstitutedNextWorkingDay(): void { @@ -67,14 +61,14 @@ public function testConstitutionMemorialDayOnAfter1948SubstitutedNextWorkingDay( self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-5-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Constitution Memorial Day before 1948. Constitution Memorial Day was established after 1948. * - * @throws ReflectionException + * @throws \Exception */ public function testConstitutionMemorialDayBefore1948(): void { @@ -88,7 +82,7 @@ public function testConstitutionMemorialDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -103,7 +97,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/CoronationDayTest.php b/tests/Japan/CoronationDayTest.php index d3f1a05c6..90c71bd5c 100644 --- a/tests/Japan/CoronationDayTest.php +++ b/tests/Japan/CoronationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -37,8 +33,7 @@ class CoronationDayTest extends JapanBaseTestCase implements HolidayTestCase public const ESTABLISHMENT_YEAR = 2019; /** - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsCoronationDay(): void { @@ -46,12 +41,12 @@ public function testEmperorsCoronationDay(): void self::REGION, self::HOLIDAY, 2019, - new DateTime('2019-5-1', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2019-5-1', new \DateTimeZone(self::TIMEZONE)) ); } /** - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayBefore2019(): void { @@ -63,7 +58,7 @@ public function testEmperorsBirthdayBefore2019(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayAfter2020(): void { @@ -76,8 +71,6 @@ public function testEmperorsBirthdayAfter2020(): void /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -91,8 +84,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Japan/CultureDayTest.php b/tests/Japan/CultureDayTest.php index c068223cb..a6d1cc986 100644 --- a/tests/Japan/CultureDayTest.php +++ b/tests/Japan/CultureDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CultureDayTest extends JapanBaseTestCase implements HolidayTestCase /** * Tests Culture Day after 1948. Culture Day Day was established after 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCultureDayOnAfter1948(): void { @@ -49,15 +44,14 @@ public function testCultureDayOnAfter1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Culture Day after 1948 substituted next working day (when Culture Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCultureDayOnAfter1948SubstitutedNextWorkingDay(): void { @@ -66,14 +60,14 @@ public function testCultureDayOnAfter1948SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-11-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Culture Day before 1948. Culture Day was established after 1948. * - * @throws ReflectionException + * @throws \Exception */ public function testCultureDayBefore1948(): void { @@ -87,7 +81,7 @@ public function testCultureDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/EmperorsBirthdayTest.php b/tests/Japan/EmperorsBirthdayTest.php index 3791aa770..a3c1502dc 100644 --- a/tests/Japan/EmperorsBirthdayTest.php +++ b/tests/Japan/EmperorsBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,15 +14,13 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; /** * Class testing the Emperors Birthday in Japan. + * + * @source https://en.wikipedia.org/wiki/The_Emperor's_Birthday */ class EmperorsBirthdayTest extends JapanBaseTestCase implements HolidayTestCase { @@ -35,23 +33,21 @@ class EmperorsBirthdayTest extends JapanBaseTestCase implements HolidayTestCase * The year in which the holiday was first established. */ public const ESTABLISHMENT_YEAR = 1949; - // public const ESTABLISHMENT_YEAR = 1989; /** * Tests the Emperors Birthday after 1949 to 1988. The Emperors Birthday is on April 28rd and celebrated as such since * 1949. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayOnAfter1949(): void { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1987); + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1988); $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-29", new \DateTimeZone(self::TIMEZONE)) ); } @@ -60,8 +56,7 @@ public function testEmperorsBirthdayOnAfter1949(): void * 1989. Prior to the death of Emperor Hirohito in 1989, this holiday was celebrated on April 29. See also "Shōwa * Day". * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayOnAfter1989(): void { @@ -70,7 +65,7 @@ public function testEmperorsBirthdayOnAfter1989(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-23", new \DateTimeZone(self::TIMEZONE)) ); } @@ -78,8 +73,7 @@ public function testEmperorsBirthdayOnAfter1989(): void * Tests the Emperors Birthday after 2020. The Emperors Birthday is on February 23rd and celebrated as such since * 2020. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayOnAfter2020(): void { @@ -88,7 +82,7 @@ public function testEmperorsBirthdayOnAfter2020(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-23", new \DateTimeZone(self::TIMEZONE)) ); } @@ -96,8 +90,7 @@ public function testEmperorsBirthdayOnAfter2020(): void * Tests the Emperors Birthday after 1989 substituted next working day (when the Emperors Birthday falls on a * Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayOnAfter1989SubstitutedNextWorkingDay(): void { @@ -106,18 +99,16 @@ public function testEmperorsBirthdayOnAfter1989SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-12-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-24", new \DateTimeZone(self::TIMEZONE)) ); } /** - * Tests the Emperors Birthday before 1989. The Emperors Birthday is on December 23rd and celebrated as such since - * 1989. Prior to the death of Emperor Hirohito in 1989, this holiday was celebrated on April 29. See also "Shōwa - * Day"/"Greenery Day". + * Tests the Emperors Birthday before 1949. * - * @throws ReflectionException + * @throws \Exception */ - public function testEmperorsBirthdayBefore1989(): void + public function testEmperorsBirthdayBefore1949(): void { $this->assertNotHoliday( self::REGION, @@ -127,11 +118,9 @@ public function testEmperorsBirthdayBefore1989(): void } /** - * Tests the Emperors Birthday at 2019. - * - * @throws ReflectionException + * Tests the Emperors Birthday in 2019. */ - public function testEmperorsBirthdayAt2019(): void + public function testEmperorsBirthdayIn2019(): void { $this->assertNotHoliday( self::REGION, @@ -143,7 +132,7 @@ public function testEmperorsBirthdayAt2019(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -158,7 +147,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/EnthronementProclamationCeremonyTest.php b/tests/Japan/EnthronementProclamationCeremonyTest.php index 7ab798f3c..34b3521ad 100644 --- a/tests/Japan/EnthronementProclamationCeremonyTest.php +++ b/tests/Japan/EnthronementProclamationCeremonyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -37,8 +33,7 @@ class EnthronementProclamationCeremonyTest extends JapanBaseTestCase implements public const IMPLEMENT_YEAR = 2019; /** - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsCoronationDay(): void { @@ -46,12 +41,12 @@ public function testEmperorsCoronationDay(): void self::REGION, self::HOLIDAY, 2019, - new DateTime('2019-10-22', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2019-10-22', new \DateTimeZone(self::TIMEZONE)) ); } /** - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayBefore2019(): void { @@ -63,7 +58,7 @@ public function testEmperorsBirthdayBefore2019(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testEmperorsBirthdayAfter2020(): void { @@ -76,8 +71,6 @@ public function testEmperorsBirthdayAfter2020(): void /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -91,8 +84,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Japan/GreeneryDayTest.php b/tests/Japan/GreeneryDayTest.php index 55158feff..81fa18830 100644 --- a/tests/Japan/GreeneryDayTest.php +++ b/tests/Japan/GreeneryDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class GreeneryDayTest extends JapanBaseTestCase implements HolidayTestCase * Tests Greenery Day after 2007. Greenery Day was established from 1989 on April 29th. After 2007 * it was changed to be May 4th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfter2007(): void { @@ -50,15 +45,14 @@ public function testHolidayOnAfter2007(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Greenery Day after 2007 substituted next working day (when Greenery Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfter2007SubstitutedNextWorkingDay(): void { @@ -67,7 +61,7 @@ public function testHolidayOnAfter2007SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-5-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-6", new \DateTimeZone(self::TIMEZONE)) ); } @@ -75,8 +69,7 @@ public function testHolidayOnAfter2007SubstitutedNextWorkingDay(): void * Tests Greenery Day between 1989 and 2007. Greenery Day was established from 1989 on April 29th. After 2007 * it was changed to be May 4th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBetween1989And2007(): void { @@ -85,15 +78,14 @@ public function testHolidayBetween1989And2007(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-29", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Greenery Day between 1989 and 2007 substituted next working day (when Greenery Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBetween1989And2007SubstitutedNextWorkingDay(): void { @@ -102,7 +94,7 @@ public function testHolidayBetween1989And2007SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-4-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-30", new \DateTimeZone(self::TIMEZONE)) ); } @@ -110,7 +102,7 @@ public function testHolidayBetween1989And2007SubstitutedNextWorkingDay(): void * Tests Greenery Day before 1989. Greenery Day was established from 1989 on April 29th. After 2007 * it was changed to be May 4th. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore1989(): void { @@ -124,7 +116,7 @@ public function testHolidayBefore1989(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -139,7 +131,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/JapanBaseTestCase.php b/tests/Japan/JapanBaseTestCase.php index 8c688e76f..478eda4d1 100644 --- a/tests/Japan/JapanBaseTestCase.php +++ b/tests/Japan/JapanBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Japan/JapanTest.php b/tests/Japan/JapanTest.php index ec22e3eeb..68c7a51fc 100644 --- a/tests/Japan/JapanTest.php +++ b/tests/Japan/JapanTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Japan; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class JapanTest extends JapanBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Japan are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -65,8 +64,6 @@ public function testOfficialHolidays(): void /** * Tests if all official holidays in Japan At 2019 are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidaysAt2019(): void { @@ -93,8 +90,6 @@ public function testOfficialHolidaysAt2019(): void /** * Tests if all observed holidays in Japan are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -103,8 +98,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Japan are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -113,8 +106,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Japan are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -123,8 +114,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Japan are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -132,7 +121,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Japan/LabourThanksgivingDayTest.php b/tests/Japan/LabourThanksgivingDayTest.php index 2f3183bdc..d3a94e61b 100644 --- a/tests/Japan/LabourThanksgivingDayTest.php +++ b/tests/Japan/LabourThanksgivingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class LabourThanksgivingDayTest extends JapanBaseTestCase implements HolidayTest * Tests Labor Thanksgiving Day after 1948. Labor Thanksgiving Day is held on November 23rd and established since * 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLabourThanksgivingDayOnAfter1948(): void { @@ -50,7 +45,7 @@ public function testLabourThanksgivingDayOnAfter1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-23", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testLabourThanksgivingDayOnAfter1948(): void * Tests Labor Thanksgiving Day after 1948 substituted next working day (when Labor Thanksgiving Day falls on a * Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay(): void { @@ -68,7 +62,7 @@ public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay(): self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-11-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-24", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,7 +70,7 @@ public function testLabourThanksgivingDayOnAfter1948SubstitutedNextWorkingDay(): * Tests Labor Thanksgiving Day before 1948. Labor Thanksgiving Day is held on November 23rd and established since * 1948. * - * @throws ReflectionException + * @throws \Exception */ public function testLabourThanksgivingDayBefore1948(): void { @@ -90,7 +84,7 @@ public function testLabourThanksgivingDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/MarineDayTest.php b/tests/Japan/MarineDayTest.php index c1c11ed1e..dc1171cbf 100644 --- a/tests/Japan/MarineDayTest.php +++ b/tests/Japan/MarineDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,33 +14,40 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; -/** - * Class for testing Marine Day in Japan. - */ -class MarineDayTest extends JapanBaseTestCase implements HolidayTestCase +final class MarineDayTest extends JapanBaseTestCase implements HolidayTestCase { - /** - * The name of the holiday. - */ public const HOLIDAY = 'marineDay'; + // The year in which the holiday was first established. + public const ESTABLISHMENT_YEAR = 1996; + /** - * The year in which the holiday was first established. + * Tests Marine Day in 2020. Marine Day in 2020 is July 23th for rescheduled Olympic Games after COVID-19. + * + * @see https://en.wikipedia.org/wiki/Marine_Day + * + * @throws \Exception */ - public const ESTABLISHMENT_YEAR = 1996; + public function testMarineDayIn2020(): void + { + $year = 2020; + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("$year-7-23", new \DateTimeZone(self::TIMEZONE)) + ); + } /** * Tests Marine Day in 2021. Marine Day in 2021 is July 22th for rescheduled Olympic Games after COVID-19. * - * @throws Exception - * @throws ReflectionException + * @see https://en.wikipedia.org/wiki/Marine_Day + * + * @throws \Exception */ public function testMarineDayIn2021(): void { @@ -49,7 +56,7 @@ public function testMarineDayIn2021(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-22", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-22", new \DateTimeZone(self::TIMEZONE)) ); } @@ -57,22 +64,21 @@ public function testMarineDayIn2021(): void * Tests Marine Day after 2003. Marine Day was established since 1996 on July 20th. After 2003 it was changed * to be the third monday of July. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMarineDayOnAfter2003(): void { $year = $this->generateRandomYear(2004); - if (2021 === $year) { - $this->testMarineDayIn2021(); + if (in_array($year, [2020, 2021])) { + return; } $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("third monday of july $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third monday of july $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -80,8 +86,7 @@ public function testMarineDayOnAfter2003(): void * Tests Marine Day between 1996 and 2003. Marine Day was established since 1996 on July 20th. After 2003 it was * changed to be the third monday of July. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMarineDayBetween1996And2003(): void { @@ -90,15 +95,14 @@ public function testMarineDayBetween1996And2003(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Marine Day between 1996 and 2003 substituted next working day (when Marine Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay(): void { @@ -107,7 +111,7 @@ public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-7-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-21", new \DateTimeZone(self::TIMEZONE)) ); } @@ -115,7 +119,7 @@ public function testMarineDayBetween1996And2003SubstitutedNextWorkingDay(): void * Tests Marine Day before 1996. Marine Day was established since 1996 on July 20th. After 2003 it was changed * to be the third monday of July. * - * @throws ReflectionException + * @throws \Exception */ public function testMarineDayBefore1996(): void { @@ -129,7 +133,7 @@ public function testMarineDayBefore1996(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -144,7 +148,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/MountainDayTest.php b/tests/Japan/MountainDayTest.php index 302298864..173c94769 100644 --- a/tests/Japan/MountainDayTest.php +++ b/tests/Japan/MountainDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MountainDayTest extends JapanBaseTestCase implements HolidayTestCase /** * Tests Mountain Day in 2021. Mountain Day in 2021 is August 8th for rescheduled Olympic Games after COVID-19. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMountainDayIn2021(): void { @@ -49,15 +44,14 @@ public function testMountainDayIn2021(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Mountain Day in 2020. Mountain Day in 2020 is August 10th for the Olympic Games. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMountainDayIn2020(): void { @@ -66,15 +60,14 @@ public function testMountainDayIn2020(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Mountain Day after 2016. Mountain Day was established in 2014 and is held from 2016 on August 11th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMountainDayOnAfter2016(): void { @@ -83,15 +76,14 @@ public function testMountainDayOnAfter2016(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Mountain Day after 2016 substituted next working day (when Mountain Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMountainDayOnAfter2016SubstitutedNextWorkingDay(): void { @@ -100,14 +92,14 @@ public function testMountainDayOnAfter2016SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-8-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Mountain Day before 2016. Mountain Day was established in 2014 and is held from 2016 on August 11th. * - * @throws ReflectionException + * @throws \Exception */ public function testMountainDayBefore2016(): void { @@ -121,7 +113,7 @@ public function testMountainDayBefore2016(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -136,7 +128,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/NationalFoundationDayTest.php b/tests/Japan/NationalFoundationDayTest.php index 052d2f81f..2209a1ab0 100644 --- a/tests/Japan/NationalFoundationDayTest.php +++ b/tests/Japan/NationalFoundationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NationalFoundationDayTest extends JapanBaseTestCase implements HolidayTest /** * Tests National Foundation Day after 1966. National Foundation day was established after 1966. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalFoundationDayOnAfter1966(): void { @@ -49,7 +44,7 @@ public function testNationalFoundationDayOnAfter1966(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-11", new \DateTimeZone(self::TIMEZONE)) ); } @@ -57,8 +52,7 @@ public function testNationalFoundationDayOnAfter1966(): void * Tests National Foundation Day after 1966. substituted next working day (when National Foundation Day falls on a * Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalFoundationDayOnAfter1966SubstitutedNextWorkingDay(): void { @@ -67,14 +61,14 @@ public function testNationalFoundationDayOnAfter1966SubstitutedNextWorkingDay(): self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-2-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests National Foundation Day before 1966. National Foundation day was established after 1966. * - * @throws ReflectionException + * @throws \Exception */ public function testNationalFoundationDayBefore1966(): void { @@ -88,7 +82,7 @@ public function testNationalFoundationDayBefore1966(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -103,7 +97,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/NewYearsDayTest.php b/tests/Japan/NewYearsDayTest.php index 5a7e19e8c..f6c36a4d4 100644 --- a/tests/Japan/NewYearsDayTest.php +++ b/tests/Japan/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NewYearsDayTest extends JapanBaseTestCase implements HolidayTestCase /** * Tests New Years Day after 1948. New Years Day was established after 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDayOnAfter1948(): void { @@ -49,15 +44,14 @@ public function testNewYearsDayOnAfter1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests New Years Day after 1948 substituted next working day (when New Years Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDayOnAfter1948SubstitutedNextWorkingDay(): void { @@ -66,14 +60,14 @@ public function testNewYearsDayOnAfter1948SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-1-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests New Years Day before 1948. New Years Day was established after 1948. * - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDayBefore1948(): void { @@ -87,7 +81,7 @@ public function testNewYearsDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/PublicBridgeDayTest.php b/tests/Japan/PublicBridgeDayTest.php index ae02cc53d..482237bd5 100644 --- a/tests/Japan/PublicBridgeDayTest.php +++ b/tests/Japan/PublicBridgeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -30,10 +26,11 @@ class PublicBridgeDayTest extends JapanBaseTestCase implements HolidayTestCase * The name of the holiday. */ public const HOLIDAY = 'bridgeDay'; + /** * @var number representing the calendar year to be tested against */ - private $year; + private int $year; /** * Initial setup of this Test Case. @@ -46,8 +43,7 @@ protected function setUp(): void /** * Tests public bridge days. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPublicBridgeDay(): void { @@ -55,20 +51,18 @@ public function testPublicBridgeDay(): void self::REGION, self::HOLIDAY.'1', $this->year, - new DateTime("$this->year-4-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$this->year-4-30", new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY.'2', $this->year, - new DateTime("$this->year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$this->year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -77,8 +71,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Japan/RespectForTheAgedDayTest.php b/tests/Japan/RespectForTheAgedDayTest.php index bd3739435..7e5f5e442 100644 --- a/tests/Japan/RespectForTheAgedDayTest.php +++ b/tests/Japan/RespectForTheAgedDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class RespectForTheAgedDayTest extends JapanBaseTestCase implements HolidayTestC * Tests Respect for the Aged Day after 2003. Respect for the Aged Day was established since 1996 on September * 15th. After 2003 it was changed to be the third monday of September. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRespectForTheAgedDayOnAfter2003(): void { @@ -50,7 +45,7 @@ public function testRespectForTheAgedDayOnAfter2003(): void self::REGION, self::HOLIDAY, $year, - new DateTime("third monday of september $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third monday of september $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testRespectForTheAgedDayOnAfter2003(): void * Tests Respect for the Aged Day between 1996 and 2003. Respect for the Aged Day was established since 1996 on * September 15th. After 2003 it was changed to be the third monday of September. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRespectForTheAgedDayBetween1996And2003(): void { @@ -68,7 +62,7 @@ public function testRespectForTheAgedDayBetween1996And2003(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-15", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,8 +70,7 @@ public function testRespectForTheAgedDayBetween1996And2003(): void * Tests Respect for the Aged Day between 1996 and 2003 substituted next working day (when Respect for the Aged Day * falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorkingDay(): void { @@ -86,7 +79,7 @@ public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorking self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-9-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-16", new \DateTimeZone(self::TIMEZONE)) ); } @@ -94,7 +87,7 @@ public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorking * Tests Respect for the Aged Day before 1996. Respect for the Aged Day was established since 1996 on September * 15th. After 2003 it was changed to be the third monday of September. * - * @throws ReflectionException + * @throws \Exception */ public function testRespectForTheAgedDayBefore1996(): void { @@ -108,7 +101,7 @@ public function testRespectForTheAgedDayBefore1996(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -123,7 +116,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/ShowaDayTest.php b/tests/Japan/ShowaDayTest.php index 251f03674..dc77c1e04 100644 --- a/tests/Japan/ShowaDayTest.php +++ b/tests/Japan/ShowaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ShowaDayTest extends JapanBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in the test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfter2007(): void { @@ -49,15 +44,14 @@ public function testHolidayOnAfter2007(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-29", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in the test on or after the establishment and substituted next working day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishmentSubstitutedNextWorkingDay(): void { @@ -66,14 +60,14 @@ public function testHolidayOnAfterEstablishmentSubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-4-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in the test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -87,7 +81,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/SportsDayTest.php b/tests/Japan/SportsDayTest.php index 80bb0cf79..9b43642aa 100644 --- a/tests/Japan/SportsDayTest.php +++ b/tests/Japan/SportsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class SportsDayTest extends JapanBaseTestCase implements HolidayTestCase * Tests Health And Sports Day in 2021. Health And Sports Day in 2021 is July 23th for rescheduled Olympic Games * after COVID-19. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSportsDayIn2021(): void { @@ -50,15 +45,14 @@ public function testSportsDayIn2021(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Health And Sports Day in 2020. Health And Sports Day in 2020 is July 24th for the Olympic Games. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSportsDayIn2020(): void { @@ -67,7 +61,7 @@ public function testSportsDayIn2020(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-24", new \DateTimeZone(self::TIMEZONE)) ); } @@ -75,26 +69,28 @@ public function testSportsDayIn2020(): void * Tests Health And Sports Day after 2000. Health And Sports Day was established since 1996 on October 10th. After * 2000 it was changed to be the second monday of October. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ - public function testSportsDayOnAfter2000(): void + public function testSportsDayAfter2000(): void { $year = $this->generateRandomYear(2001); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("second monday of october $year", new DateTimeZone(self::TIMEZONE)) - ); + + // Some years the date has changed, so in this test we neeed to skip them. + if (!in_array($year, [2020, 2021])) { + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("second monday of october $year", new \DateTimeZone(self::TIMEZONE)) + ); + } } /** * Tests Health And Sports Day between 1996 and 2000. Health And Sports Day was established since 1996 on October * 10th. After 2000 it was changed to be the second monday of October. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSportsDayBetween1996And2000(): void { @@ -103,7 +99,7 @@ public function testSportsDayBetween1996And2000(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-10", new \DateTimeZone(self::TIMEZONE)) ); } @@ -111,8 +107,7 @@ public function testSportsDayBetween1996And2000(): void * Tests Health And Sports Day between 1996 and 2000 substituted next working day (when Health And Sports Day falls * on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay(): void { @@ -121,7 +116,7 @@ public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay(): void self::REGION, self::SUBSTITUTE_PREFIX.self::HOLIDAY, $year, - new DateTime("$year-10-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-11", new \DateTimeZone(self::TIMEZONE)) ); } @@ -129,7 +124,7 @@ public function testSportsDayBetween1996And2000SubstitutedNextWorkingDay(): void * Tests Health And Sports Day before. Health And Sports Day was established since 1996 on October 10th. After * 2000 it was changed to be the second monday of October. * - * @throws ReflectionException + * @throws \Exception */ public function testSportsDayBefore1996(): void { @@ -144,7 +139,7 @@ public function testSportsDayBefore1996(): void * Tests the translated name of the holiday defined in this test. * 1996-2019:Health And Sports Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -160,7 +155,7 @@ public function testTranslation(): void * Tests the translated name of the holiday defined in this test. * 2020 - :Sports Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslationFrom2020(): void { @@ -176,7 +171,7 @@ public function testTranslationFrom2020(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Japan/VernalEquinoxDayTest.php b/tests/Japan/VernalEquinoxDayTest.php index 332df9e8e..746fbb8bf 100644 --- a/tests/Japan/VernalEquinoxDayTest.php +++ b/tests/Japan/VernalEquinoxDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Japan; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -43,7 +39,7 @@ class VernalEquinoxDayTest extends JapanBaseTestCase implements HolidayTestCase * * After 2150 no calculations are available yet. * - * @throws ReflectionException + * @throws \Exception */ public function testVernalEquinoxDayOnAfter2150(): void { @@ -63,8 +59,7 @@ public function testVernalEquinoxDayOnAfter2150(): void * @param int $month month (number) of example data to be tested * @param int $day day of the month (number) of example data to be tested * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testVernalEquinoxDayBetween1948And2150(int $year, int $month, int $day): void { @@ -72,14 +67,14 @@ public function testVernalEquinoxDayBetween1948And2150(int $year, int $month, in self::REGION, self::HOLIDAY, $year, - new DateTime("$year-$month-$day", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-$month-$day", new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of all Japanese Vernal Equinox holidays used for assertions. * - * @return array list of Japanese Vernal Equinox holidays + * @return array list of test dates for the holiday defined in this test */ public function vernalEquinoxHolidaysProvider(): array { @@ -97,7 +92,7 @@ public function vernalEquinoxHolidaysProvider(): array * of nature and the love of living things. Prior to 1948, the vernal equinox was an imperial ancestor worship * festival called Shunki kōrei-sai (春季皇霊祭). * - * @throws ReflectionException + * @throws \Exception */ public function testVernalEquinoxDayBefore1948(): void { @@ -111,7 +106,7 @@ public function testVernalEquinoxDayBefore1948(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -126,7 +121,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/ChristmasDayTest.php b/tests/Latvia/ChristmasDayTest.php index 4a1be1a82..5c94e0eef 100644 --- a/tests/Latvia/ChristmasDayTest.php +++ b/tests/Latvia/ChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'christmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/ChristmasEveDayTest.php b/tests/Latvia/ChristmasEveDayTest.php index e26f7ec65..2ff427ba1 100644 --- a/tests/Latvia/ChristmasEveDayTest.php +++ b/tests/Latvia/ChristmasEveDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasEveDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'christmasEve'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/EasterDayTest.php b/tests/Latvia/EasterDayTest.php index f997a4c38..0f3df229d 100644 --- a/tests/Latvia/EasterDayTest.php +++ b/tests/Latvia/EasterDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class EasterDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'easter'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/EasterMondayDayTest.php b/tests/Latvia/EasterMondayDayTest.php index 6f8b4dd24..87a8693ca 100644 --- a/tests/Latvia/EasterMondayDayTest.php +++ b/tests/Latvia/EasterMondayDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class EasterMondayDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'easterMonday'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/GoodFridayDayTest.php b/tests/Latvia/GoodFridayDayTest.php index a62d51e9e..e6011ac80 100644 --- a/tests/Latvia/GoodFridayDayTest.php +++ b/tests/Latvia/GoodFridayDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class GoodFridayDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'goodFriday'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/InternationalWorkersDayTest.php b/tests/Latvia/InternationalWorkersDayTest.php index 01c59ac4f..e08de99ec 100644 --- a/tests/Latvia/InternationalWorkersDayTest.php +++ b/tests/Latvia/InternationalWorkersDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class InternationalWorkersDayTest extends LatviaBaseTestCase implements HolidayT public const HOLIDAY = 'internationalWorkersDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/LatviaBaseTestCase.php b/tests/Latvia/LatviaBaseTestCase.php index 5c25188e4..ac0dad518 100644 --- a/tests/Latvia/LatviaBaseTestCase.php +++ b/tests/Latvia/LatviaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Latvia/LatviaTest.php b/tests/Latvia/LatviaTest.php index c2ba79116..76f19d674 100644 --- a/tests/Latvia/LatviaTest.php +++ b/tests/Latvia/LatviaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Latvia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Latvia; use Yasumi\tests\ProviderTestCase; @@ -30,7 +29,7 @@ class LatviaTest extends LatviaBaseTestCase implements ProviderTestCase /** * Tests if all official holidays in Latvia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOfficialHolidays(): void { @@ -64,7 +63,7 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Latvia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testObservedHolidays(): void { @@ -74,7 +73,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Latvia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -84,7 +83,7 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Latvia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testBankHolidays(): void { @@ -94,7 +93,7 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Latvia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOtherHolidays(): void { @@ -102,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Latvia/MidsummerEveDayTest.php b/tests/Latvia/MidsummerEveDayTest.php index 2efc2262e..5fbafb10c 100644 --- a/tests/Latvia/MidsummerEveDayTest.php +++ b/tests/Latvia/MidsummerEveDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class MidsummerEveDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'midsummerEveDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/NewYearsDayTest.php b/tests/Latvia/NewYearsDayTest.php index db7462582..72bb73ccf 100644 --- a/tests/Latvia/NewYearsDayTest.php +++ b/tests/Latvia/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearsDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'newYearsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/NewYearsEveDayTest.php b/tests/Latvia/NewYearsEveDayTest.php index 003e7bd7b..81c5d6652 100644 --- a/tests/Latvia/NewYearsEveDayTest.php +++ b/tests/Latvia/NewYearsEveDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearsEveDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'newYearsEve'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php b/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php index 16a8fb447..14a21ffca 100644 --- a/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php +++ b/tests/Latvia/ProclamationOfTheRepublicOfLatviaDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Latvia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class ProclamationOfTheRepublicOfLatviaDayTest extends LatviaBaseTestCase implem /** * Test if holiday is not defined before proclamation. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHoliday(): void { @@ -50,7 +46,9 @@ public function testNotHoliday(): void } /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -71,8 +69,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -80,14 +77,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -103,9 +98,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/RestorationOfIndependenceDayTest.php b/tests/Latvia/RestorationOfIndependenceDayTest.php index f201a4479..c9d54ba1f 100644 --- a/tests/Latvia/RestorationOfIndependenceDayTest.php +++ b/tests/Latvia/RestorationOfIndependenceDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Latvia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class RestorationOfIndependenceDayTest extends LatviaBaseTestCase implements Hol /** * Test if holiday is not defined before restoration. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHoliday(): void { @@ -50,7 +46,9 @@ public function testNotHoliday(): void } /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -71,8 +69,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -80,14 +77,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -103,9 +98,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/SecondChristmasDayTest.php b/tests/Latvia/SecondChristmasDayTest.php index 3f03e31b5..a65de926a 100644 --- a/tests/Latvia/SecondChristmasDayTest.php +++ b/tests/Latvia/SecondChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class SecondChristmasDayTest extends LatviaBaseTestCase implements HolidayTestCa public const HOLIDAY = 'secondChristmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Latvia/StJohnsDayTest.php b/tests/Latvia/StJohnsDayTest.php index daf71dd61..89e153165 100644 --- a/tests/Latvia/StJohnsDayTest.php +++ b/tests/Latvia/StJohnsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Latvia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class StJohnsDayTest extends LatviaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'stJohnsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/AllSaintsDayTest.php b/tests/Lithuania/AllSaintsDayTest.php index a43f7f778..5db341b06 100644 --- a/tests/Lithuania/AllSaintsDayTest.php +++ b/tests/Lithuania/AllSaintsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class AllSaintsDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'allSaintsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/AllSoulsDayTest.php b/tests/Lithuania/AllSoulsDayTest.php index 7373e3376..3a2e63c3e 100644 --- a/tests/Lithuania/AllSoulsDayTest.php +++ b/tests/Lithuania/AllSoulsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Lithuania; use Yasumi\tests\HolidayTestCase; @@ -36,7 +32,7 @@ class AllSoulsDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'allSoulsDay'; /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeAnnounce(): void { @@ -50,8 +46,7 @@ public function testHolidayBeforeAnnounce(): void /** * Test if holiday is defined after restoration. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterAnnounce(): void { @@ -61,14 +56,12 @@ public function testHolidayAfterAnnounce(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-02", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-02", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -81,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/AssumptionOfMaryDayTest.php b/tests/Lithuania/AssumptionOfMaryDayTest.php index dcc56b2eb..bf873e4bf 100644 --- a/tests/Lithuania/AssumptionOfMaryDayTest.php +++ b/tests/Lithuania/AssumptionOfMaryDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class AssumptionOfMaryDayTest extends LithuaniaBaseTestCase implements HolidayTe public const HOLIDAY = 'assumptionOfMary'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/ChristmasDayTest.php b/tests/Lithuania/ChristmasDayTest.php index 77120c4f4..587b51ea8 100644 --- a/tests/Lithuania/ChristmasDayTest.php +++ b/tests/Lithuania/ChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'christmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/ChristmasEveDayTest.php b/tests/Lithuania/ChristmasEveDayTest.php index c803e3e28..12df3db53 100644 --- a/tests/Lithuania/ChristmasEveDayTest.php +++ b/tests/Lithuania/ChristmasEveDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class ChristmasEveDayTest extends LithuaniaBaseTestCase implements HolidayTestCa public const HOLIDAY = 'christmasEve'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/EasterDayTest.php b/tests/Lithuania/EasterDayTest.php index e6eb0edf2..396148868 100644 --- a/tests/Lithuania/EasterDayTest.php +++ b/tests/Lithuania/EasterDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class EasterDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'easter'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/EasterMondayDayTest.php b/tests/Lithuania/EasterMondayDayTest.php index 55654a943..30f7850c2 100644 --- a/tests/Lithuania/EasterMondayDayTest.php +++ b/tests/Lithuania/EasterMondayDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,7 +31,9 @@ class EasterMondayDayTest extends LithuaniaBaseTestCase implements HolidayTestCa public const HOLIDAY = 'easterMonday'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -50,8 +48,7 @@ public function holidayDataProvider(): array * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -59,14 +56,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,9 +74,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/InternationalWorkersDayTest.php b/tests/Lithuania/InternationalWorkersDayTest.php index 838833339..6c425cc8a 100644 --- a/tests/Lithuania/InternationalWorkersDayTest.php +++ b/tests/Lithuania/InternationalWorkersDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class InternationalWorkersDayTest extends LithuaniaBaseTestCase implements Holid public const HOLIDAY = 'internationalWorkersDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/LithuaniaBaseTestCase.php b/tests/Lithuania/LithuaniaBaseTestCase.php index 67ae05369..babf59c3f 100644 --- a/tests/Lithuania/LithuaniaBaseTestCase.php +++ b/tests/Lithuania/LithuaniaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Lithuania/LithuaniaTest.php b/tests/Lithuania/LithuaniaTest.php index bfce4afb0..03e023ee0 100644 --- a/tests/Lithuania/LithuaniaTest.php +++ b/tests/Lithuania/LithuaniaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Lithuania; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Lithuania; @@ -29,7 +28,7 @@ class LithuaniaTest extends LithuaniaBaseTestCase /** * Tests if all official holidays in Lithuania are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOfficialHolidays(): void { @@ -66,7 +65,7 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Lithuania are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testObservedHolidays(): void { @@ -76,7 +75,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Lithuania are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -86,7 +85,7 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Lithuania are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testBankHolidays(): void { @@ -96,7 +95,7 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Lithuania are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOtherHolidays(): void { @@ -104,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Lithuania/NewYearsDayTest.php b/tests/Lithuania/NewYearsDayTest.php index 2a159e726..7e866d468 100644 --- a/tests/Lithuania/NewYearsDayTest.php +++ b/tests/Lithuania/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearsDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'newYearsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php b/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php index 4881296de..166a0f103 100644 --- a/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php +++ b/tests/Lithuania/RestorationOfIndependenceOfLithuaniaDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Lithuania; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class RestorationOfIndependenceOfLithuaniaDayTest extends LithuaniaBaseTestCase /** * Test if holiday is not defined before restoration. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeRestoration(): void { @@ -52,8 +48,7 @@ public function testHolidayBeforeRestoration(): void /** * Test if holiday is defined after restoration. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRestoration(): void { @@ -63,14 +58,12 @@ public function testHolidayAfterRestoration(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-03-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-03-11", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php b/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php index 7ecf6c601..6f2627293 100644 --- a/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php +++ b/tests/Lithuania/RestorationOfTheStateOfLithuaniaDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Lithuania; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class RestorationOfTheStateOfLithuaniaDayTest extends LithuaniaBaseTestCase impl /** * Test if holiday is not defined before restoration. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeRestoration(): void { @@ -52,8 +48,7 @@ public function testHolidayBeforeRestoration(): void /** * Test if holiday is defined after restoration. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRestoration(): void { @@ -63,14 +58,12 @@ public function testHolidayAfterRestoration(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-02-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-02-16", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/SecondChristmasDayTest.php b/tests/Lithuania/SecondChristmasDayTest.php index 4980750b2..5b0136c0d 100644 --- a/tests/Lithuania/SecondChristmasDayTest.php +++ b/tests/Lithuania/SecondChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class SecondChristmasDayTest extends LithuaniaBaseTestCase implements HolidayTes public const HOLIDAY = 'secondChristmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/StJohnsDayTest.php b/tests/Lithuania/StJohnsDayTest.php index 8affc1f7f..740769d2f 100644 --- a/tests/Lithuania/StJohnsDayTest.php +++ b/tests/Lithuania/StJohnsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class StJohnsDayTest extends LithuaniaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'stJohnsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Lithuania/StatehoodDayTest.php b/tests/Lithuania/StatehoodDayTest.php index f3cf30983..6ac74520b 100644 --- a/tests/Lithuania/StatehoodDayTest.php +++ b/tests/Lithuania/StatehoodDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Lithuania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Lithuania; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class StatehoodDayTest extends LithuaniaBaseTestCase implements HolidayTestCase /** * Test if holiday is not defined before restoration. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeRestoration(): void { @@ -52,8 +48,7 @@ public function testHolidayBeforeRestoration(): void /** * Test if holiday is defined after restoration. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRestoration(): void { @@ -63,14 +58,12 @@ public function testHolidayAfterRestoration(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-07-06", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-07-06", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/AllSaintsDayTest.php b/tests/Luxembourg/AllSaintsDayTest.php index 1c7f25897..54172d6b8 100644 --- a/tests/Luxembourg/AllSaintsDayTest.php +++ b/tests/Luxembourg/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends LuxembourgBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Luxembourg/AscensionDayTest.php b/tests/Luxembourg/AscensionDayTest.php index 83cf3a9e4..64f27a4db 100644 --- a/tests/Luxembourg/AscensionDayTest.php +++ b/tests/Luxembourg/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends LuxembourgBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/AssumptionOfMaryTest.php b/tests/Luxembourg/AssumptionOfMaryTest.php index b7f39db4b..704a34430 100644 --- a/tests/Luxembourg/AssumptionOfMaryTest.php +++ b/tests/Luxembourg/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends LuxembourgBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/ChristmasDayTest.php b/tests/Luxembourg/ChristmasDayTest.php index cdc59359c..c62cad37c 100644 --- a/tests/Luxembourg/ChristmasDayTest.php +++ b/tests/Luxembourg/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends LuxembourgBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/EasterMondayTest.php b/tests/Luxembourg/EasterMondayTest.php index df5664acf..64ad9d85d 100644 --- a/tests/Luxembourg/EasterMondayTest.php +++ b/tests/Luxembourg/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends LuxembourgBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/EuropeDayTest.php b/tests/Luxembourg/EuropeDayTest.php index 3d89b3274..b829be03e 100644 --- a/tests/Luxembourg/EuropeDayTest.php +++ b/tests/Luxembourg/EuropeDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class EuropeDayTest extends LuxembourgBaseTestCase implements HolidayTestCase /** * Tests Europe Day on or after 2019. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEuropeDayOnAfter2019(): void { @@ -49,14 +44,14 @@ public function testEuropeDayOnAfter2019(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Europe Day before 2019. * - * @throws ReflectionException + * @throws \Exception */ public function testEuropeDayBefore2019(): void { @@ -70,7 +65,7 @@ public function testEuropeDayBefore2019(): void /** * Tests translated name of Europe Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/InternationalWorkersDayTest.php b/tests/Luxembourg/InternationalWorkersDayTest.php index 23c99e0ba..33915dfb3 100644 --- a/tests/Luxembourg/InternationalWorkersDayTest.php +++ b/tests/Luxembourg/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends LuxembourgBaseTestCase implements Holi * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of International Workers' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Luxembourg/LuxembourgBaseTestCase.php b/tests/Luxembourg/LuxembourgBaseTestCase.php index 59f9df8a2..b4bc1e1dc 100644 --- a/tests/Luxembourg/LuxembourgBaseTestCase.php +++ b/tests/Luxembourg/LuxembourgBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Luxembourg/LuxembourgTest.php b/tests/Luxembourg/LuxembourgTest.php index c262c2054..388013a2b 100644 --- a/tests/Luxembourg/LuxembourgTest.php +++ b/tests/Luxembourg/LuxembourgTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Luxembourg; use Yasumi\tests\ProviderTestCase; @@ -27,12 +26,12 @@ class LuxembourgTest extends LuxembourgBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Tests if all official holidays in Luxembourg are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOfficialHolidays(): void { @@ -61,7 +60,7 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Luxembourg are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testObservedHolidays(): void { @@ -71,7 +70,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Luxembourg are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -81,7 +80,7 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Luxembourg are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testBankHolidays(): void { @@ -91,7 +90,7 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Luxembourg are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOtherHolidays(): void { @@ -99,7 +98,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Luxembourg/NationalDayTest.php b/tests/Luxembourg/NationalDayTest.php index 611908d44..8a8cfd8e3 100644 --- a/tests/Luxembourg/NationalDayTest.php +++ b/tests/Luxembourg/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NationalDayTest extends LuxembourgBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/NewYearsDayTest.php b/tests/Luxembourg/NewYearsDayTest.php index 2a23fffb2..124a1b387 100644 --- a/tests/Luxembourg/NewYearsDayTest.php +++ b/tests/Luxembourg/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends LuxembourgBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Luxembourg/PentecostMondayTest.php b/tests/Luxembourg/PentecostMondayTest.php index 5546f1382..d18546108 100644 --- a/tests/Luxembourg/PentecostMondayTest.php +++ b/tests/Luxembourg/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends LuxembourgBaseTestCase implements HolidayTestC /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Luxembourg/SecondChristmasDayTest.php b/tests/Luxembourg/SecondChristmasDayTest.php index d545babc7..bf599d983 100644 --- a/tests/Luxembourg/SecondChristmasDayTest.php +++ b/tests/Luxembourg/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Luxembourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends LuxembourgBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/AscensionDayTest.php b/tests/Netherlands/AscensionDayTest.php index 9f8ad4ad0..bde238635 100644 --- a/tests/Netherlands/AscensionDayTest.php +++ b/tests/Netherlands/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends NetherlandsBaseTestCase implements HolidayTestCas /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/AshWednesdayTest.php b/tests/Netherlands/AshWednesdayTest.php index efddc1113..bce99d1d8 100644 --- a/tests/Netherlands/AshWednesdayTest.php +++ b/tests/Netherlands/AshWednesdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AshWednesdayTest extends NetherlandsBaseTestCase implements HolidayTestCas /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ash Wednesday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/ChristmasDayTest.php b/tests/Netherlands/ChristmasDayTest.php index 1f5e77695..65e7a8c2b 100644 --- a/tests/Netherlands/ChristmasDayTest.php +++ b/tests/Netherlands/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends NetherlandsBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/CommemorationDayTest.php b/tests/Netherlands/CommemorationDayTest.php index 28fdbf911..2b95ebe90 100644 --- a/tests/Netherlands/CommemorationDayTest.php +++ b/tests/Netherlands/CommemorationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,7 +35,7 @@ class CommemorationDayTest extends NetherlandsBaseTestCase implements HolidayTes /** * Tests Commemoration Day before 1947. Commemoration Day was established after WWII in 1947. * - * @throws ReflectionException + * @throws \Exception */ public function testCommemorationDayBefore1947(): void { @@ -53,8 +49,7 @@ public function testCommemorationDayBefore1947(): void /** * Tests Commemoration Day after 1947. Commemoration Day was established after WWII in 1947. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCommemorationDayOnAfter1947(): void { @@ -63,14 +58,14 @@ public function testCommemorationDayOnAfter1947(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/DaylightSavingTime.php b/tests/Netherlands/DaylightSavingTime.php new file mode 100644 index 000000000..f805b9313 --- /dev/null +++ b/tests/Netherlands/DaylightSavingTime.php @@ -0,0 +1,50 @@ + + */ + +namespace Yasumi\tests\Netherlands; + +use Yasumi\tests\HolidayTestCase; + +abstract class DaylightSavingTime extends NetherlandsBaseTestCase implements HolidayTestCase +{ + /** @var int[] */ + public array $observedYears; + + /** @var int[] */ + public array $unobservedYears; + + public function __construct() + { + $observedYears = range(1916, 1940); + $observedYears = array_merge($observedYears, range(1942, 1945)); + $observedYears = array_merge($observedYears, range(1977, 2037)); // PHP caps future DST transitions + + $this->observedYears = $observedYears; + $this->unobservedYears = array_diff(range(reset($observedYears), end($observedYears)), $observedYears); + + parent::__construct(); + } + + /* Swaps the observation from observed to unobserved for the given years */ + protected function swapObservation(array $years): void + { + foreach ($years as $y) { + $this->observedYears[] = $y; + if (false !== ($key = array_search($y, $this->unobservedYears, true))) { + unset($this->unobservedYears[(int) $key]); + } + } + } +} diff --git a/tests/Netherlands/EasterMondayTest.php b/tests/Netherlands/EasterMondayTest.php index 178912930..16967e5a9 100644 --- a/tests/Netherlands/EasterMondayTest.php +++ b/tests/Netherlands/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends NetherlandsBaseTestCase implements HolidayTestCas /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/EasterTest.php b/tests/Netherlands/EasterTest.php index 50eef008d..e48c5df08 100644 --- a/tests/Netherlands/EasterTest.php +++ b/tests/Netherlands/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Easter. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEaster(): void { @@ -44,14 +39,14 @@ public function testEaster(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/EpiphanyTest.php b/tests/Netherlands/EpiphanyTest.php index e212782d2..29ab57c48 100644 --- a/tests/Netherlands/EpiphanyTest.php +++ b/tests/Netherlands/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends NetherlandsBaseTestCase implements HolidayTestCase * * @dataProvider EpiphanyDataProvider * - * @param int $year the year for which Epiphany needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Epiphany needs to be tested + * @param \DateTime $expected the expected date */ - public function testEpiphany(int $year, DateTime $expected): void + public function testEpiphany(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testEpiphany(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Epiphany. * - * @return array list of test dates for Epiphany + * @return array list of test dates for Epiphany * - * @throws Exception + * @throws \Exception */ public function EpiphanyDataProvider(): array { @@ -60,7 +55,7 @@ public function EpiphanyDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/FathersDayTest.php b/tests/Netherlands/FathersDayTest.php index d90653786..e2b63f96b 100644 --- a/tests/Netherlands/FathersDayTest.php +++ b/tests/Netherlands/FathersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class FathersDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("third sunday of june $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third sunday of june $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/GoodFridayTest.php b/tests/Netherlands/GoodFridayTest.php index d674af476..0157df343 100644 --- a/tests/Netherlands/GoodFridayTest.php +++ b/tests/Netherlands/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Good Friday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testGoodFriday(): void { @@ -44,14 +39,14 @@ public function testGoodFriday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/HalloweenTest.php b/tests/Netherlands/HalloweenTest.php index 8d2e8d3a3..d8488dc88 100644 --- a/tests/Netherlands/HalloweenTest.php +++ b/tests/Netherlands/HalloweenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class HalloweenTest extends NetherlandsBaseTestCase implements HolidayTestCase * * @dataProvider HalloweenDataProvider * - * @param int $year the year for which Halloween needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Halloween needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Halloween. * - * @return array list of test dates for Halloween + * @return array list of test dates for Halloween * - * @throws Exception + * @throws \Exception */ public function HalloweenDataProvider(): array { @@ -60,7 +55,7 @@ public function HalloweenDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/InternationalWorkersDayTest.php b/tests/Netherlands/InternationalWorkersDayTest.php index 2a43d55ab..da02a74e0 100644 --- a/tests/Netherlands/InternationalWorkersDayTest.php +++ b/tests/Netherlands/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends NetherlandsBaseTestCase implements Hol * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { @@ -60,7 +55,7 @@ public function InternationalWorkersDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/KingsDayTest.php b/tests/Netherlands/KingsDayTest.php index 7ab2d81b1..f46bd4a44 100644 --- a/tests/Netherlands/KingsDayTest.php +++ b/tests/Netherlands/KingsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class KingsDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Kings Day on or after 2014. King's Day is celebrated from 2014 onwards on April 27th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testKingsDayOnAfter2014(): void { @@ -49,15 +44,14 @@ public function testKingsDayOnAfter2014(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-27", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-27", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Kings Day substituted on Saturday (when Kings Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testKingsDayOnAfter2014SubstitutedDay(): void { @@ -66,14 +60,14 @@ public function testKingsDayOnAfter2014SubstitutedDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Kings Day before 2014. King's Day is celebrated from 2014 onwards on April 27th. * - * @throws ReflectionException + * @throws \Exception */ public function testKingsDayBefore2014(): void { @@ -87,7 +81,7 @@ public function testKingsDayBefore2014(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +96,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/LiberationDayTest.php b/tests/Netherlands/LiberationDayTest.php index 24106ecfd..039b0a448 100644 --- a/tests/Netherlands/LiberationDayTest.php +++ b/tests/Netherlands/LiberationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,7 +35,7 @@ class LiberationDayTest extends NetherlandsBaseTestCase implements HolidayTestCa /** * Tests Liberation Day before 1947. Liberation Day was established after WWII in 1947. * - * @throws ReflectionException + * @throws \Exception */ public function testLiberationDayBefore1947(): void { @@ -53,8 +49,7 @@ public function testLiberationDayBefore1947(): void /** * Tests Liberation Day after 1947. Liberation Day was established after WWII in 1947. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLiberationDayOnAfter1947(): void { @@ -63,14 +58,14 @@ public function testLiberationDayOnAfter1947(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -83,16 +78,28 @@ public function testTranslation(): void } /** - * Tests type of the holiday defined in this test. + * Tests Liberation Day official holiday type every 5 years, observance type on other years. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { $this->assertHolidayType( self::REGION, self::HOLIDAY, - $this->generateRandomYear(self::ESTABLISHMENT_YEAR), + $this->generateRandomYear(2001, 2004), + Holiday::TYPE_OBSERVANCE + ); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + 2000, + Holiday::TYPE_OFFICIAL + ); + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + 2005, Holiday::TYPE_OFFICIAL ); } diff --git a/tests/Netherlands/MothersDayTest.php b/tests/Netherlands/MothersDayTest.php index e9ea418b6..d29ef9bd1 100644 --- a/tests/Netherlands/MothersDayTest.php +++ b/tests/Netherlands/MothersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class MothersDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Mother's Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMothersDay(): void { @@ -44,14 +39,14 @@ public function testMothersDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("second sunday of may $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("second sunday of may $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/NetherlandsBaseTestCase.php b/tests/Netherlands/NetherlandsBaseTestCase.php index b579498e7..0e1619d64 100644 --- a/tests/Netherlands/NetherlandsBaseTestCase.php +++ b/tests/Netherlands/NetherlandsBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Netherlands/NetherlandsTest.php b/tests/Netherlands/NetherlandsTest.php index 99387f1d0..4832f1d53 100644 --- a/tests/Netherlands/NetherlandsTest.php +++ b/tests/Netherlands/NetherlandsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Netherlands; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NetherlandsTest extends NetherlandsBaseTestCase implements ProviderTestCas /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Netherlands are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -51,16 +50,21 @@ public function testOfficialHolidays(): void 'ascensionDay', 'pentecost', 'pentecostMonday', - 'liberationDay', 'christmasDay', 'secondChristmasDay', ], self::REGION, $this->year, Holiday::TYPE_OFFICIAL); + + $this->assertDefinedHolidays([ + 'liberationDay', + ], self::REGION, 2015, Holiday::TYPE_OFFICIAL); + + $this->assertDefinedHolidays([ + 'liberationDay', + ], self::REGION, 2020, Holiday::TYPE_OFFICIAL); } /** * Tests if all observed holidays in Netherlands are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -75,12 +79,16 @@ public function testObservedHolidays(): void 'secondCarnivalDay', 'thirdCarnivalDay', ], self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); + + $this->assertDefinedHolidays([ + 'liberationDay', + ], self::REGION, $this->generateRandomYear(2011, 2014), Holiday::TYPE_OBSERVANCE); } /** * Tests if all seasonal holidays in Netherlands are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -90,8 +98,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Netherlands are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -100,8 +106,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Netherlands are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -117,7 +121,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Netherlands/NewYearsDayTest.php b/tests/Netherlands/NewYearsDayTest.php index 5cb5c308f..f4fd1da46 100644 --- a/tests/Netherlands/NewYearsDayTest.php +++ b/tests/Netherlands/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends NetherlandsBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function NewYearsDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/PentecostTest.php b/tests/Netherlands/PentecostTest.php index 2ee6e3a07..15e2f592a 100644 --- a/tests/Netherlands/PentecostTest.php +++ b/tests/Netherlands/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, 'pentecost', $year, - new DateTime("$year-5-31", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-31", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/QueensDayTest.php b/tests/Netherlands/QueensDayTest.php index ea9c5ff26..32f939113 100644 --- a/tests/Netherlands/QueensDayTest.php +++ b/tests/Netherlands/QueensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class QueensDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Queens Day between 1891 and 1948. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testQueensBetween1891and1948(): void { @@ -44,15 +39,14 @@ public function testQueensBetween1891and1948(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-31", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-31", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Queens Day between 1891 and 1948 substituted one day later (when Queens Day falls on a Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testQueensBetween1891and1948SubstitutedLater(): void { @@ -61,15 +55,14 @@ public function testQueensBetween1891and1948SubstitutedLater(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Queens Day between 1949 and 2013. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testQueensBetween1949and2013(): void { @@ -78,15 +71,14 @@ public function testQueensBetween1949and2013(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Queens Day between 1949 and 2013 substituted one day later. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testQueensBetween1949and2013SubstitutedLater(): void { @@ -95,15 +87,14 @@ public function testQueensBetween1949and2013SubstitutedLater(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Queens Day between 1949 and 2013 substituted one day earlier. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testQueensBetween1949and2013SubstitutedEarlier(): void { @@ -112,14 +103,14 @@ public function testQueensBetween1949and2013SubstitutedEarlier(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-29", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Queen's Day before 1891. * - * @throws ReflectionException + * @throws \Exception */ public function testQueensDayBefore1891(): void { @@ -129,7 +120,7 @@ public function testQueensDayBefore1891(): void /** * Tests Queen's Day after 2013. * - * @throws ReflectionException + * @throws \Exception */ public function testQueensDayAfter2013(): void { @@ -139,7 +130,7 @@ public function testQueensDayAfter2013(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -154,7 +145,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/SummerTimeTest.php b/tests/Netherlands/SummerTimeTest.php new file mode 100644 index 000000000..5e42bcbde --- /dev/null +++ b/tests/Netherlands/SummerTimeTest.php @@ -0,0 +1,155 @@ + + */ + +namespace Yasumi\tests\Netherlands; + +use Yasumi\Holiday; + +/** + * Class for testing Summertime in the Netherlands. + */ +final class SummerTimeTest extends DaylightSavingTime +{ + /** The name of the holiday */ + public const HOLIDAY = 'summerTime'; + + /* List of transition dates that deviate from the known/defined rules. + * PHP derives the transition dates from the tz database which are + * different for some years */ + private array $deviantTransitions = [ + 1916 => '1916-04-30', + 1917 => '1917-04-16', + 1919 => '1919-04-07', + 1918 => '1918-04-01', + 1920 => '1920-04-05', + 1921 => '1921-04-04', + 1922 => '1922-03-26', + 1923 => '1923-06-01', + 1924 => '1924-03-30', + 1925 => '1925-06-05', + 1932 => '1932-05-22', + 1937 => '1937-05-22', + 1943 => '1943-03-29', + 1944 => '1944-04-03', + 1945 => '1945-04-02', + ]; + + public function __construct() + { + parent::__construct(); + + // No summertime defined for 1942 + if (false !== ($key = array_search(1942, $this->observedYears, true))) { + unset($this->observedYears[(int) $key]); + } + + // In version 2022f of the tz db, a correction for some years weere made for the summertime + // transitions. See: https://github.com/eggert/tz/blob/2022f/europe + if (1 === strcmp(\intltz_get_tz_data_version(), '2022f')) { + $this->swapObservation([1946]); + + $this->deviantTransitions[1918] = '1918-04-15'; + $this->deviantTransitions[1919] = '1919-03-01'; + $this->deviantTransitions[1920] = '1920-02-14'; + $this->deviantTransitions[1921] = '1921-03-14'; + $this->deviantTransitions[1922] = '1922-03-25'; + $this->deviantTransitions[1923] = '1923-04-21'; + $this->deviantTransitions[1924] = '1924-03-29'; + $this->deviantTransitions[1925] = '1925-04-04'; + $this->deviantTransitions[1926] = '1926-04-17'; + $this->deviantTransitions[1927] = '1927-04-09'; + $this->deviantTransitions[1928] = '1928-04-14'; + $this->deviantTransitions[1929] = '1929-04-21'; + $this->deviantTransitions[1931] = '1931-04-19'; + $this->deviantTransitions[1930] = '1930-04-13'; + $this->deviantTransitions[1932] = '1932-04-03'; + $this->deviantTransitions[1933] = '1933-03-26'; + $this->deviantTransitions[1934] = '1934-04-08'; + $this->deviantTransitions[1935] = '1935-03-31'; + $this->deviantTransitions[1936] = '1936-04-19'; + $this->deviantTransitions[1937] = '1937-04-04'; + $this->deviantTransitions[1938] = '1938-03-27'; + $this->deviantTransitions[1939] = '1939-04-16'; + $this->deviantTransitions[1940] = '1940-02-25'; + $this->deviantTransitions[1946] = '1946-05-19'; + } + } + + /** + * Tests Summertime. + * + * @throws \Exception + */ + public function testSummertime(): void + { + $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->randomYearFromArray($this->unobservedYears)); + + $year = $this->randomYearFromArray($this->observedYears); + $expected = "first sunday of april $year"; + + if ($year >= 1922) { + $expected = "may 15th $year"; + } + + if ($year >= 1943) { + $expected = "first sunday of april $year"; + } + + if ($year >= 1981) { + $expected = "last sunday of march $year"; + } + + if (array_key_exists($year, $this->deviantTransitions)) { + $expected = $this->deviantTransitions[$year]; + } + + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + * + * @throws \Exception + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + [self::LOCALE => 'zomertijd'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * + * @throws \Exception + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + Holiday::TYPE_SEASON + ); + } +} diff --git a/tests/Netherlands/SummertimeTest.php b/tests/Netherlands/SummertimeTest.php deleted file mode 100644 index 1cf348cd8..000000000 --- a/tests/Netherlands/SummertimeTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ - -namespace Yasumi\tests\Netherlands; - -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; -use Yasumi\Holiday; -use Yasumi\tests\HolidayTestCase; - -/** - * Class for testing Summertime in the Netherlands. - */ -class SummertimeTest extends NetherlandsBaseTestCase implements HolidayTestCase -{ - /** - * The name of the holiday. - */ - public const HOLIDAY = 'summerTime'; - - /** - * Tests Summertime. - * - * @throws Exception - * @throws ReflectionException - */ - public function testSummertime(): void - { - $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1946, 1976)); - - $year = $this->generateRandomYear(1977, 1980); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("first sunday of april $year", new DateTimeZone(self::TIMEZONE)) - ); - - $year = $this->generateRandomYear(1981, 2036); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("last sunday of march $year", new DateTimeZone(self::TIMEZONE)) - ); - } - - /** - * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException - */ - public function testTranslation(): void - { - $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(1978, 2037), - [self::LOCALE => 'zomertijd'] - ); - } - - /** - * Tests type of the holiday defined in this test. - * - * @throws ReflectionException - */ - public function testHolidayType(): void - { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(1978, 2037), Holiday::TYPE_SEASON); - } -} diff --git a/tests/Netherlands/ValentinesDayTest.php b/tests/Netherlands/ValentinesDayTest.php index 0110d0702..74fdb2d1b 100644 --- a/tests/Netherlands/ValentinesDayTest.php +++ b/tests/Netherlands/ValentinesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ValentinesDayTest extends NetherlandsBaseTestCase implements HolidayTestCa * * @dataProvider ValentinesDayDataProvider * - * @param int $year the year for which Valentines Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Valentines Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testValentinesDay(int $year, DateTime $expected): void + public function testValentinesDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testValentinesDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Valentines Day. * - * @return array list of test dates for Valentines Day + * @return array list of test dates for Valentines Day * - * @throws Exception + * @throws \Exception */ public function ValentinesDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ValentinesDayDataProvider(): array /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -70,7 +65,7 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { diff --git a/tests/Netherlands/WinterTimeTest.php b/tests/Netherlands/WinterTimeTest.php new file mode 100644 index 000000000..ecb05c232 --- /dev/null +++ b/tests/Netherlands/WinterTimeTest.php @@ -0,0 +1,139 @@ + + */ + +namespace Yasumi\tests\Netherlands; + +use Yasumi\Holiday; + +/** + * Class for testing Wintertime in the Netherlands. + */ +final class WinterTimeTest extends DaylightSavingTime +{ + /** The name of the holiday */ + public const HOLIDAY = 'winterTime'; + + /* List of transition dates that deviate from the known/defined rules. + * PHP derives the transition dates from the tz database which are + * different for some years */ + private array $deviantTransitions = [ + 1916 => '1916-09-30', + 1917 => '1917-09-17', + 1922 => '1922-10-08', + 1933 => '1933-10-08', + 1939 => '1939-10-08', + 1942 => '1942-11-02', + 1943 => '1943-10-04', + 1944 => '1944-10-02', + 1945 => '1945-09-16', + 1978 => '1978-10-01', + ]; + + public function __construct() + { + parent::__construct(); + + // No wintertime defined for 1940 + if (false !== ($key = array_search(1940, $this->observedYears, true))) { + unset($this->observedYears[(int) $key]); + } + + // In version 2022f of the tz db, a correction for some years weere made for the wintertime + // transitions. See: https://github.com/eggert/tz/blob/2022f/europe + if (1 === strcmp(\intltz_get_tz_data_version(), '2022f')) { + $this->swapObservation([1946]); + + $this->deviantTransitions[1918] = '1918-09-16'; + $this->deviantTransitions[1919] = '1919-10-04'; + $this->deviantTransitions[1920] = '1920-10-23'; + $this->deviantTransitions[1921] = '1921-10-25'; + $this->deviantTransitions[1922] = '1922-10-07'; + $this->deviantTransitions[1923] = '1923-10-06'; + $this->deviantTransitions[1924] = '1924-10-04'; + $this->deviantTransitions[1925] = '1925-10-03'; + $this->deviantTransitions[1926] = '1926-10-02'; + $this->deviantTransitions[1927] = '1927-10-01'; + $this->deviantTransitions[1939] = '1939-11-19'; + $this->deviantTransitions[1944] = '1944-09-17'; + $this->deviantTransitions[1946] = '1946-10-07'; + } + } + + /** + * Tests Wintertime. + * + * @throws \Exception + */ + public function testWintertime(): void + { + $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->randomYearFromArray($this->unobservedYears)); + + $year = $this->randomYearFromArray($this->observedYears); + $expected = "last monday of september $year"; + + if ($year >= 1922) { + $expected = "first sunday of october $year"; + } + + if ($year >= 1977) { + $expected = "last sunday of september $year"; + } + + if ($year >= 1996) { + $expected = "last sunday of october $year"; + } + + if (array_key_exists($year, $this->deviantTransitions)) { + $expected = $this->deviantTransitions[$year]; + } + + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + * + * @throws \Exception + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + [self::LOCALE => 'wintertijd'] + ); + } + + /** + * Tests type of the holiday defined in this test. + * + * @throws \Exception + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->randomYearFromArray($this->observedYears), + Holiday::TYPE_SEASON + ); + } +} diff --git a/tests/Netherlands/WintertimeTest.php b/tests/Netherlands/WintertimeTest.php deleted file mode 100644 index 050024092..000000000 --- a/tests/Netherlands/WintertimeTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ - -namespace Yasumi\tests\Netherlands; - -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; -use Yasumi\Holiday; -use Yasumi\tests\HolidayTestCase; - -/** - * Class for testing Wintertime in the Netherlands. - */ -class WintertimeTest extends NetherlandsBaseTestCase implements HolidayTestCase -{ - /** - * The name of the holiday. - */ - public const HOLIDAY = 'winterTime'; - - /** - * Tests Wintertime. - * - * @throws Exception - * @throws ReflectionException - */ - public function testWintertime(): void - { - $this->assertNotHoliday(self::REGION, self::HOLIDAY, $this->generateRandomYear(1946, 1976)); - - $year = $this->generateRandomYear(1979, 1995); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("last sunday of september $year", new DateTimeZone(self::TIMEZONE)) - ); - - $year = $this->generateRandomYear(1996, 2037); - $this->assertHoliday( - self::REGION, - self::HOLIDAY, - $year, - new DateTime("last sunday of october $year", new DateTimeZone(self::TIMEZONE)) - ); - } - - /** - * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException - */ - public function testTranslation(): void - { - $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $this->generateRandomYear(1978, 2037), - [self::LOCALE => 'wintertijd'] - ); - } - - /** - * Tests type of the holiday defined in this test. - * - * @throws ReflectionException - */ - public function testHolidayType(): void - { - $this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(1978, 2037), Holiday::TYPE_SEASON); - } -} diff --git a/tests/Netherlands/WorldAnimalDayTest.php b/tests/Netherlands/WorldAnimalDayTest.php index cb4431624..5ab108128 100644 --- a/tests/Netherlands/WorldAnimalDayTest.php +++ b/tests/Netherlands/WorldAnimalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class WorldAnimalDayTest extends NetherlandsBaseTestCase implements HolidayTestC /** * Tests World Animal Day on or after 1931. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testWorldAnimalDayOnAfter1931(): void { @@ -49,14 +44,14 @@ public function testWorldAnimalDayOnAfter1931(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests World Animal Day before 1931. * - * @throws ReflectionException + * @throws \Exception */ public function testWorldAnimalBefore1931(): void { @@ -70,7 +65,7 @@ public function testWorldAnimalBefore1931(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -85,7 +80,7 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { diff --git a/tests/Netherlands/carnivalDayTest.php b/tests/Netherlands/carnivalDayTest.php index b860ef3be..2215c4dd6 100644 --- a/tests/Netherlands/carnivalDayTest.php +++ b/tests/Netherlands/carnivalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class carnivalDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -61,7 +56,7 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { diff --git a/tests/Netherlands/pentecostMondayTest.php b/tests/Netherlands/pentecostMondayTest.php index 07def2ae6..f84bdb9ba 100644 --- a/tests/Netherlands/pentecostMondayTest.php +++ b/tests/Netherlands/pentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class pentecostMondayTest extends NetherlandsBaseTestCase implements HolidayTest /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, 'pentecostMonday', $year, - new DateTime("$year-6-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/princesDayTest.php b/tests/Netherlands/princesDayTest.php index c561adc5f..7ed5a8239 100644 --- a/tests/Netherlands/princesDayTest.php +++ b/tests/Netherlands/princesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class princesDayTest extends NetherlandsBaseTestCase implements HolidayTestCase /** * Tests Prince's Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPrincesDay(): void { @@ -44,14 +39,14 @@ public function testPrincesDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("third tuesday of september $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third tuesday of september $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/secondCarnivalDay.php b/tests/Netherlands/secondCarnivalDay.php index d88173d66..bbec72ef0 100644 --- a/tests/Netherlands/secondCarnivalDay.php +++ b/tests/Netherlands/secondCarnivalDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,12 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use InvalidArgumentException; -use ReflectionException; -use RuntimeException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,10 +32,9 @@ class secondCarnivalDay extends NetherlandsBaseTestCase implements HolidayTestCa * Tests the holiday defined in this test. * * @throws UnknownLocaleException - * @throws InvalidArgumentException - * @throws RuntimeException - * @throws ReflectionException - * @throws Exception + * @throws \InvalidArgumentException + * @throws \RuntimeException + * @throws \Exception */ public function testHoliday(): void { @@ -50,17 +43,17 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests type of the holiday defined in this test. * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -70,10 +63,10 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { diff --git a/tests/Netherlands/secondChristmasdayTest.php b/tests/Netherlands/secondChristmasdayTest.php index a596dc7c9..ed4bdea11 100644 --- a/tests/Netherlands/secondChristmasdayTest.php +++ b/tests/Netherlands/secondChristmasdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class secondChristmasdayTest extends NetherlandsBaseTestCase implements HolidayT * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/stMartinsDayTest.php b/tests/Netherlands/stMartinsDayTest.php index c6ffe1466..70e2b0f28 100644 --- a/tests/Netherlands/stMartinsDayTest.php +++ b/tests/Netherlands/stMartinsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stMartinsDayTest extends NetherlandsBaseTestCase implements HolidayTestCas * * @dataProvider stMartinsDayDataProvider * - * @param int $year the year for which Sint Martins Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Sint Martins Day needs to be tested + * @param \DateTime $expected the expected date */ - public function teststMartinsDay(int $year, DateTime $expected): void + public function teststMartinsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function teststMartinsDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Sint Martins Day. * - * @return array list of test dates for Sint Martins Day + * @return array list of test dates for Sint Martins Day * - * @throws Exception + * @throws \Exception */ public function stMartinsDayDataProvider(): array { @@ -60,7 +55,7 @@ public function stMartinsDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/stNicholasDayTest.php b/tests/Netherlands/stNicholasDayTest.php index d05f3d308..2da0eef6b 100644 --- a/tests/Netherlands/stNicholasDayTest.php +++ b/tests/Netherlands/stNicholasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stNicholasDayTest extends NetherlandsBaseTestCase implements HolidayTestCa * * @dataProvider stNicholasDayDataProvider * - * @param int $year the year for which Sint Nicholas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Sint Nicholas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function teststNicholasDay(int $year, DateTime $expected): void + public function teststNicholasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function teststNicholasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Sint Nicholas Day. * - * @return array list of test dates for Sint Nicholas Day + * @return array list of test dates for Sint Nicholas Day * - * @throws Exception + * @throws \Exception */ public function stNicholasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function stNicholasDayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Netherlands/thirdCarnivalDay.php b/tests/Netherlands/thirdCarnivalDay.php index 33cd25a3a..d58f6fb1e 100644 --- a/tests/Netherlands/thirdCarnivalDay.php +++ b/tests/Netherlands/thirdCarnivalDay.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,12 +14,6 @@ namespace Yasumi\tests\Netherlands; -use DateTime; -use DateTimeZone; -use Exception; -use InvalidArgumentException; -use ReflectionException; -use RuntimeException; use Yasumi\Exception\UnknownLocaleException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,10 +32,9 @@ class thirdCarnivalDay extends NetherlandsBaseTestCase implements HolidayTestCas * Tests the holiday defined in this test. * * @throws UnknownLocaleException - * @throws InvalidArgumentException - * @throws RuntimeException - * @throws ReflectionException - * @throws Exception + * @throws \InvalidArgumentException + * @throws \RuntimeException + * @throws \Exception */ public function testHoliday(): void { @@ -50,17 +43,17 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests type of the holiday defined in this test. * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -70,10 +63,10 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { diff --git a/tests/NewZealand/AnzacDayTest.php b/tests/NewZealand/AnzacDayTest.php index c14c66111..ea6be2f74 100644 --- a/tests/NewZealand/AnzacDayTest.php +++ b/tests/NewZealand/AnzacDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class AnzacDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that Labour Day is not present before 1921. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -70,24 +63,30 @@ public function testNotHoliday(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { - return $this->generateRandomDatesWithModifier(4, 25, function ($year, DateTime $date) { + return $this->generateRandomDatesWithModifier(4, 25, function ($year, \DateTime $date): void { // in 2015 some policy was introduced to make sure this holiday was celebrated during the working week. - if ($year >= 2015 && $this->isWeekend($date)) { - $date->modify('next monday'); + if ($year < 2015) { + return; + } + + if (!$this->isWeekend($date)) { + return; } + + $date->modify('next monday'); }, 100, self::ESTABLISHMENT_YEAR, self::TIMEZONE); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +101,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/BoxingDayTest.php b/tests/NewZealand/BoxingDayTest.php index 4a70b6b4f..29e182e5a 100644 --- a/tests/NewZealand/BoxingDayTest.php +++ b/tests/NewZealand/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class BoxingDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,10 +60,10 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); } $data[] = [$year, $date->format('Y-m-d')]; @@ -81,7 +75,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -96,7 +90,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/ChristmasDayTest.php b/tests/NewZealand/ChristmasDayTest.php index d5430dfa0..659600c51 100644 --- a/tests/NewZealand/ChristmasDayTest.php +++ b/tests/NewZealand/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class ChristmasDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,10 +60,10 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); } $data[] = [$year, $date->format('Y-m-d')]; @@ -81,7 +75,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -96,7 +90,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/DayAfterNewYearsDayTest.php b/tests/NewZealand/DayAfterNewYearsDayTest.php index e845eabcb..a325687d5 100644 --- a/tests/NewZealand/DayAfterNewYearsDayTest.php +++ b/tests/NewZealand/DayAfterNewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class DayAfterNewYearsDayTest extends NewZealandBaseTestCase implements HolidayT * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,14 +43,14 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -71,7 +65,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -81,9 +75,9 @@ public function testHolidayType(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -91,15 +85,15 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-01-02", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-01-02", new \DateTimeZone(self::TIMEZONE)); switch ($date->format('w')) { case 0: case 6: - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); break; case 1: - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } $data[] = [$year, $date->format('Y-m-d')]; diff --git a/tests/NewZealand/EasterMondayTest.php b/tests/NewZealand/EasterMondayTest.php index d84fb09c2..0f6a1f1cc 100644 --- a/tests/NewZealand/EasterMondayTest.php +++ b/tests/NewZealand/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/GoodFridayTest.php b/tests/NewZealand/GoodFridayTest.php index de93445a0..33d4a5a6e 100644 --- a/tests/NewZealand/GoodFridayTest.php +++ b/tests/NewZealand/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class GoodFridayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->sub(new DateInterval('P2D')); + $date->sub(new \DateInterval('P2D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/LabourDayTest.php b/tests/NewZealand/LabourDayTest.php index 91c9ec0ad..1c4e46fe5 100644 --- a/tests/NewZealand/LabourDayTest.php +++ b/tests/NewZealand/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class LabourDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that Labour Day is not present before 1900. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -70,9 +63,9 @@ public function testNotHoliday(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -80,9 +73,9 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 100; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $expected = new DateTime( + $expected = new \DateTime( (($year < 1910) ? 'second wednesday of october' : 'fourth monday of october')." $year", - new DateTimeZone(self::TIMEZONE) + new \DateTimeZone(self::TIMEZONE) ); $data[] = [$year, $expected->format('Y-m-d')]; @@ -94,7 +87,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -109,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/NewYearsDayTest.php b/tests/NewZealand/NewYearsDayTest.php index 979d67a0f..ef2b653c5 100644 --- a/tests/NewZealand/NewYearsDayTest.php +++ b/tests/NewZealand/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class NewYearsDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,14 +60,14 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-01-01", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-01-01", new \DateTimeZone(self::TIMEZONE)); switch ($date->format('w')) { case 0: - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); break; case 6: - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); break; } @@ -86,7 +80,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -101,7 +95,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/NewZealandBaseTestCase.php b/tests/NewZealand/NewZealandBaseTestCase.php index 948f8eed4..31492f6ee 100644 --- a/tests/NewZealand/NewZealandBaseTestCase.php +++ b/tests/NewZealand/NewZealandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/NewZealand/NewZealandTest.php b/tests/NewZealand/NewZealandTest.php index a46c47b7d..51e0f58d1 100644 --- a/tests/NewZealand/NewZealandTest.php +++ b/tests/NewZealand/NewZealandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\NewZealand; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NewZealandTest extends NewZealandBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in New Zealand are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in New Zealand are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -68,8 +65,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in New Zealand are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -78,8 +73,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in New Zealand are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -88,8 +81,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in New Zealand are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +88,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/NewZealand/QueensBirthdayTest.php b/tests/NewZealand/QueensBirthdayTest.php index 46e7e999d..0f97d15ad 100644 --- a/tests/NewZealand/QueensBirthdayTest.php +++ b/tests/NewZealand/QueensBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,20 +37,16 @@ class QueensBirthdayTest extends NewZealandBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Tests that Holiday is not present before 1952. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -64,9 +56,9 @@ public function testNotHoliday(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -74,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 1; $y <= 100; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $expected = new DateTime("first monday of june $year", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("first monday of june $year", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $expected]; } @@ -84,7 +76,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -99,7 +91,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/NewZealand/WaitangiDayTest.php b/tests/NewZealand/WaitangiDayTest.php index 695974971..ea8a7effa 100644 --- a/tests/NewZealand/WaitangiDayTest.php +++ b/tests/NewZealand/WaitangiDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\NewZealand; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class WaitangiDayTest extends NewZealandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -53,14 +48,12 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests that Holiday is not present before 1974. - * - * @throws ReflectionException */ public function testNotHoliday(): void { @@ -70,7 +63,7 @@ public function testNotHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +78,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -100,17 +93,23 @@ public function testHolidayType(): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { - return $this->generateRandomDatesWithModifier(2, 06, function ($year, DateTime $date) { + return $this->generateRandomDatesWithModifier(2, 06, function ($year, \DateTime $date): void { // in 2015 some policy was introduced to make sure this holiday was celebrated during the working week. - if ($year >= 2015 && $this->isWeekend($date)) { - $date->modify('next monday'); + if ($year < 2015) { + return; + } + + if (!$this->isWeekend($date)) { + return; } + + $date->modify('next monday'); }, 100, self::ESTABLISHMENT_YEAR, self::TIMEZONE); } } diff --git a/tests/Norway/AscensionDayTest.php b/tests/Norway/AscensionDayTest.php index 92a7e9f75..dc4206721 100644 --- a/tests/Norway/AscensionDayTest.php +++ b/tests/Norway/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/ChristmasDayTest.php b/tests/Norway/ChristmasDayTest.php index 069fbe93c..68fe6d523 100644 --- a/tests/Norway/ChristmasDayTest.php +++ b/tests/Norway/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends NorwayBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/ConstitutionDayTest.php b/tests/Norway/ConstitutionDayTest.php index b59f06842..3df570745 100644 --- a/tests/Norway/ConstitutionDayTest.php +++ b/tests/Norway/ConstitutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstitutionDayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/EasterMondayTest.php b/tests/Norway/EasterMondayTest.php index 0d82ecaaa..5f0b52009 100644 --- a/tests/Norway/EasterMondayTest.php +++ b/tests/Norway/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/EasterTest.php b/tests/Norway/EasterTest.php index 6a41148d5..898f61eb9 100644 --- a/tests/Norway/EasterTest.php +++ b/tests/Norway/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/GoodFridayTest.php b/tests/Norway/GoodFridayTest.php index 032c80066..b8ab8af4e 100644 --- a/tests/Norway/GoodFridayTest.php +++ b/tests/Norway/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/InternationalWorkersDayTest.php b/tests/Norway/InternationalWorkersDayTest.php index a7de3128f..f35479c64 100644 --- a/tests/Norway/InternationalWorkersDayTest.php +++ b/tests/Norway/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends NorwayBaseTestCase implements HolidayT * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Norway/MaundyThursdayTest.php b/tests/Norway/MaundyThursdayTest.php index 9338ab5eb..fe01b9e44 100644 --- a/tests/Norway/MaundyThursdayTest.php +++ b/tests/Norway/MaundyThursdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class MaundyThursdayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/NewYearsDayTest.php b/tests/Norway/NewYearsDayTest.php index f71bfcd15..287cc7c61 100644 --- a/tests/Norway/NewYearsDayTest.php +++ b/tests/Norway/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends NorwayBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/NorwayBaseTestCase.php b/tests/Norway/NorwayBaseTestCase.php index 1524b407d..44ec359b9 100644 --- a/tests/Norway/NorwayBaseTestCase.php +++ b/tests/Norway/NorwayBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Norway/NorwayTest.php b/tests/Norway/NorwayTest.php index 426178240..a5c849a01 100644 --- a/tests/Norway/NorwayTest.php +++ b/tests/Norway/NorwayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Norway; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NorwayTest extends NorwayBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Norway are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -61,8 +60,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Norway are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -71,8 +68,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Norway are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -81,8 +76,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Norway are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -91,8 +84,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Norway are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -100,7 +91,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Norway/PentecostMondayTest.php b/tests/Norway/PentecostMondayTest.php index 3678bd599..2e114b24b 100644 --- a/tests/Norway/PentecostMondayTest.php +++ b/tests/Norway/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/PentecostTest.php b/tests/Norway/PentecostTest.php index 36bd46d12..867c34efe 100644 --- a/tests/Norway/PentecostTest.php +++ b/tests/Norway/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends NorwayBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Norway/SecondChristmasDayTest.php b/tests/Norway/SecondChristmasDayTest.php index ba0cc4e0b..665f6ea5e 100644 --- a/tests/Norway/SecondChristmasDayTest.php +++ b/tests/Norway/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Norway; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends NorwayBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/AllSaintsDayTest.php b/tests/Poland/AllSaintsDayTest.php index 0c361b020..1715d11e2 100644 --- a/tests/Poland/AllSaintsDayTest.php +++ b/tests/Poland/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends PolandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/AssumptionOfMaryTest.php b/tests/Poland/AssumptionOfMaryTest.php index 6d1432994..06af71e03 100644 --- a/tests/Poland/AssumptionOfMaryTest.php +++ b/tests/Poland/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends PolandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/ChristmasTest.php b/tests/Poland/ChristmasTest.php index 6e6d19324..684aad669 100644 --- a/tests/Poland/ChristmasTest.php +++ b/tests/Poland/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends PolandBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/ConstitutionDayTest.php b/tests/Poland/ConstitutionDayTest.php index f2817f7a7..a92764fad 100644 --- a/tests/Poland/ConstitutionDayTest.php +++ b/tests/Poland/ConstitutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstitutionDayTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/CorpusChristiTest.php b/tests/Poland/CorpusChristiTest.php index 7cee1e486..5c166b65a 100644 --- a/tests/Poland/CorpusChristiTest.php +++ b/tests/Poland/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class CorpusChristiTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Corpus Christi. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/EasterMondayTest.php b/tests/Poland/EasterMondayTest.php index 4a48c85e7..077834dc0 100644 --- a/tests/Poland/EasterMondayTest.php +++ b/tests/Poland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/EasterTest.php b/tests/Poland/EasterTest.php index 144b2cbb0..0090a2d44 100644 --- a/tests/Poland/EasterTest.php +++ b/tests/Poland/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/EpiphanyTest.php b/tests/Poland/EpiphanyTest.php index 2c57f56ea..41ce6a5ed 100644 --- a/tests/Poland/EpiphanyTest.php +++ b/tests/Poland/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends PolandBaseTestCase implements HolidayTestCase * * @dataProvider EpiphanyDataProvider * - * @param int $year the year for which Epiphany needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Epiphany needs to be tested + * @param \DateTime $expected the expected date */ - public function testEpiphany(int $year, DateTime $expected): void + public function testEpiphany(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testEpiphany(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Epiphany. * - * @return array list of test dates for Epiphany + * @return array list of test dates for Epiphany * - * @throws Exception + * @throws \Exception */ public function EpiphanyDataProvider(): array { @@ -60,7 +55,7 @@ public function EpiphanyDataProvider(): array /** * Tests translated name of Epiphany. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/IndependenceDayTest.php b/tests/Poland/IndependenceDayTest.php index 2a3a85c76..06b6f03a2 100644 --- a/tests/Poland/IndependenceDayTest.php +++ b/tests/Poland/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndependenceDayTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/InternationalWorkersDayTest.php b/tests/Poland/InternationalWorkersDayTest.php index 3b3dfbf12..e1e7d5377 100644 --- a/tests/Poland/InternationalWorkersDayTest.php +++ b/tests/Poland/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends PolandBaseTestCase implements HolidayT * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Poland/NewYearsDayTest.php b/tests/Poland/NewYearsDayTest.php index 73d104cc4..1e69de5e5 100644 --- a/tests/Poland/NewYearsDayTest.php +++ b/tests/Poland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends PolandBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/PentecostTest.php b/tests/Poland/PentecostTest.php index a1160c394..70ab8ae13 100644 --- a/tests/Poland/PentecostTest.php +++ b/tests/Poland/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends PolandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Poland/PolandBaseTestCase.php b/tests/Poland/PolandBaseTestCase.php index 8ffb69d12..aa4459ef6 100644 --- a/tests/Poland/PolandBaseTestCase.php +++ b/tests/Poland/PolandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Poland/PolandTest.php b/tests/Poland/PolandTest.php index 5c1cd0023..cac91cd32 100644 --- a/tests/Poland/PolandTest.php +++ b/tests/Poland/PolandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Poland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class PolandTest extends PolandBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Poland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -62,8 +61,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Poland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -72,8 +69,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Poland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -82,8 +77,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Poland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -92,8 +85,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Poland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -101,7 +92,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Poland/SecondChristmasDayTest.php b/tests/Poland/SecondChristmasDayTest.php index 358f31e89..40ac7ce2a 100644 --- a/tests/Poland/SecondChristmasDayTest.php +++ b/tests/Poland/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Poland; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends PolandBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/AllSaintsDayTest.php b/tests/Portugal/AllSaintsDayTest.php index ad72287bf..18820fedf 100644 --- a/tests/Portugal/AllSaintsDayTest.php +++ b/tests/Portugal/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,26 +40,23 @@ class AllSaintsDayTest extends PortugalBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { $year = 2016; - $expected = new DateTime("$year-11-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-11-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); $year = 2012; - $expected = new DateTime("$year-11-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-11-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Test that the holiday did not happen in 2013-2015. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHoliday(): void { @@ -74,7 +67,7 @@ public function testNotHoliday(): void /** * Tests translated name of Corpus Christi. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -90,7 +83,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/AssumptionOfMaryTest.php b/tests/Portugal/AssumptionOfMaryTest.php index 925fbd98b..23369214d 100644 --- a/tests/Portugal/AssumptionOfMaryTest.php +++ b/tests/Portugal/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends PortugalBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/CarnationRevolutionDayTest.php b/tests/Portugal/CarnationRevolutionDayTest.php index d7445b877..c27093bda 100644 --- a/tests/Portugal/CarnationRevolutionDayTest.php +++ b/tests/Portugal/CarnationRevolutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,20 +35,19 @@ class CarnationRevolutionDayTest extends PortugalBaseTestCase implements Holiday /** * Test that the holiday is valid after the year of establishment. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $expected = new DateTime("$year-04-25", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-04-25", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Tests that the holiday is not a holiday before the year of establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHolidayBeforeEstablishment(): void { @@ -63,7 +58,7 @@ public function testNotHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -74,7 +69,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/ChristmasTest.php b/tests/Portugal/ChristmasTest.php index e3a219b60..1e207f32c 100644 --- a/tests/Portugal/ChristmasTest.php +++ b/tests/Portugal/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends PortugalBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/CorpusChristiTest.php b/tests/Portugal/CorpusChristiTest.php index 8fa96fe05..3d4773dd0 100644 --- a/tests/Portugal/CorpusChristiTest.php +++ b/tests/Portugal/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,20 +40,19 @@ class CorpusChristiTest extends PortugalBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { $year = 2016; - $expected = new DateTime("$year-5-26", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-5-26", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Test that the holiday did not happen in 2013-2015. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHoliday(): void { @@ -68,7 +63,7 @@ public function testNotHoliday(): void /** * Tests translated name of Corpus Christi. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/EasterTest.php b/tests/Portugal/EasterTest.php index d3665dde3..4974c93b7 100644 --- a/tests/Portugal/EasterTest.php +++ b/tests/Portugal/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends PortugalBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-03-27", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-03-27", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/GoodFridayTest.php b/tests/Portugal/GoodFridayTest.php index ba58e83df..5ef232e50 100644 --- a/tests/Portugal/GoodFridayTest.php +++ b/tests/Portugal/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends PortugalBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/ImmaculateConceptionTest.php b/tests/Portugal/ImmaculateConceptionTest.php index da636f883..665d066b0 100644 --- a/tests/Portugal/ImmaculateConceptionTest.php +++ b/tests/Portugal/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends PortugalBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/InternationalWorkersDayTest.php b/tests/Portugal/InternationalWorkersDayTest.php index dab456d8a..5f36c8d6b 100644 --- a/tests/Portugal/InternationalWorkersDayTest.php +++ b/tests/Portugal/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends PortugalBaseTestCase implements Holida * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Portugal/NewYearsDayTest.php b/tests/Portugal/NewYearsDayTest.php index 764bbcf8b..a9a243852 100644 --- a/tests/Portugal/NewYearsDayTest.php +++ b/tests/Portugal/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends PortugalBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/PortugalBaseTestCase.php b/tests/Portugal/PortugalBaseTestCase.php index 073928915..03f11433b 100644 --- a/tests/Portugal/PortugalBaseTestCase.php +++ b/tests/Portugal/PortugalBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Portugal/PortugalDayTest.php b/tests/Portugal/PortugalDayTest.php index 4e82be7f6..2ff364dc8 100644 --- a/tests/Portugal/PortugalDayTest.php +++ b/tests/Portugal/PortugalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,12 +14,7 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; -use Yasumi\Provider\Portugal; use Yasumi\tests\HolidayTestCase; /** @@ -45,37 +40,35 @@ class PortugalDayTest extends PortugalBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test before it was abolished. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception * * @see Portugal::calculatePortugalDay() */ public function testHolidayBeforeAbolishment(): void { $year = $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR_BEFORE); - $expected = new DateTime("$year-06-10", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-06-10", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Tests the holiday defined in this test after it was restored. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception * * @see Portugal::calculatePortugalDay() */ public function testHolidayAfterRestoration(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR_AFTER); - $expected = new DateTime("$year-06-10", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-06-10", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Tests that the holiday defined in this test does not exist during the period that it was abolished. * - * @throws ReflectionException + * @throws \Exception * * @see Portugal::calculatePortugalDay() */ @@ -91,7 +84,7 @@ public function testNotHolidayDuringAbolishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +98,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Portugal/PortugalTest.php b/tests/Portugal/PortugalTest.php index c61842d08..d20b8666a 100644 --- a/tests/Portugal/PortugalTest.php +++ b/tests/Portugal/PortugalTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Portugal; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class PortugalTest extends PortugalBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Portugal are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -66,8 +65,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Portugal are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -76,8 +73,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Portugal are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -86,8 +81,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Portugal are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -96,8 +89,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in PortugalPortugal are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -111,7 +102,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Portugal/PortugueseRepublicDayTest.php b/tests/Portugal/PortugueseRepublicDayTest.php index 1b50cd446..c6270f5ea 100644 --- a/tests/Portugal/PortugueseRepublicDayTest.php +++ b/tests/Portugal/PortugueseRepublicDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,26 +28,22 @@ class PortugueseRepublicDayTest extends PortugalBaseTestCase implements HolidayT public const HOLIDAY = 'portugueseRepublic'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterRestoration(): void { - foreach (function () { - yield $this->generateRandomYear(self::HOLIDAY_YEAR_RESTORED); - yield self::HOLIDAY_YEAR_RESTORED; - } as $year) { + foreach ($this->randomYearsOnAfterRestoration() as $year) { $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-05", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-05", new \DateTimeZone(self::TIMEZONE)) ); } } /** - * @throws ReflectionException + * @throws \Exception */ public function testNotHolidayDuringAbolishment(): void { @@ -63,70 +55,93 @@ public function testNotHolidayDuringAbolishment(): void } /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { - foreach (function () { - yield $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - yield self::ESTABLISHMENT_YEAR; - } as $year) { + foreach ($this->randomYearsOnAfterEstablishment() as $year) { $this->assertHoliday( self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-05", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-05", new \DateTimeZone(self::TIMEZONE)) ); } } - /** - * @throws ReflectionException - */ public function testHolidayBeforeEstablishment(): void { - foreach (function () { - yield $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); - yield self::ESTABLISHMENT_YEAR - 1; - } as $year) { - $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); + try { + foreach ($this->randomYearsBeforeEstablishment() as $year) { + $this->assertNotHoliday(self::REGION, self::HOLIDAY, $year); + } + } catch (\Exception $e) { } } - /** - * @throws ReflectionException - */ public function testTranslation(): void { - foreach ($this->randomEstablishedYear() as $year) { - $this->assertTranslatedHolidayName( - self::REGION, - self::HOLIDAY, - $year, - [self::LOCALE => 'Implantação da República Portuguesa'] - ); + try { + foreach ($this->randomEstablishedYear() as $year) { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $year, + [self::LOCALE => 'Implantação da República Portuguesa'] + ); + } + } catch (\Exception $e) { } } - /** - * @throws ReflectionException - */ public function testHolidayType(): void { - foreach ($this->randomEstablishedYear() as $year) { - $this->assertHolidayType( - self::REGION, - self::HOLIDAY, - $year, - Holiday::TYPE_OFFICIAL - ); + try { + foreach ($this->randomEstablishedYear() as $year) { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $year, + Holiday::TYPE_OFFICIAL + ); + } + } catch (\Exception $e) { } } + /** @return \Generator + * @throws \Exception + */ private function randomEstablishedYear(): \Generator { yield $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::HOLIDAY_YEAR_SUSPENDED - 1); yield $this->generateRandomYear(self::HOLIDAY_YEAR_RESTORED); } + + /** @return \Generator + * @throws \Exception + */ + private function randomYearsBeforeEstablishment(): \Generator + { + yield $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1); + yield self::ESTABLISHMENT_YEAR - 1; + } + + /** @return \Generator + * @throws \Exception + */ + private function randomYearsOnAfterEstablishment(): \Generator + { + yield $this->generateRandomYear(self::ESTABLISHMENT_YEAR); + yield self::ESTABLISHMENT_YEAR; + } + + /** @return \Generator + * @throws \Exception + */ + private function randomYearsOnAfterRestoration(): \Generator + { + yield $this->generateRandomYear(self::HOLIDAY_YEAR_RESTORED); + yield self::HOLIDAY_YEAR_RESTORED; + } } diff --git a/tests/Portugal/RestorationOfIndependenceTest.php b/tests/Portugal/RestorationOfIndependenceTest.php index 87f2b362b..1f6c6bc22 100644 --- a/tests/Portugal/RestorationOfIndependenceTest.php +++ b/tests/Portugal/RestorationOfIndependenceTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Portugal; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,48 +45,43 @@ class RestorationOfIndependenceTest extends PortugalBaseTestCase implements Holi /** * Tests the holiday defined in this test on or after establishment. * - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, self::HOLIDAY_YEAR_ABOLISHED - 1); - $expected = new DateTime("$year-12-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-12-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); $year = self::ESTABLISHMENT_YEAR; - $expected = new DateTime("$year-12-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-12-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Test that the holiday if in effect in 2016 and later dates. * - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException - * @throws Exception + * @throws \Exception + * @throws \Exception */ public function testHolidayOnAfterRestoration(): void { $year = 2016; - $expected = new DateTime("$year-12-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-12-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); $year = $this->generateRandomYear(self::HOLIDAY_YEAR_RESTORED); - $expected = new DateTime("$year-12-01", new DateTimeZone(self::TIMEZONE)); + $expected = new \DateTime("$year-12-01", new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** * Test that the holiday did not happen in 2013-2015. * - * @throws ReflectionException + * @throws \Exception */ public function testNotHolidayDuringAbolishment(): void { @@ -101,7 +92,7 @@ public function testNotHolidayDuringAbolishment(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -115,7 +106,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -139,7 +130,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/ProviderTestCase.php b/tests/ProviderTestCase.php index 34d72d539..3aeda2b87 100644 --- a/tests/ProviderTestCase.php +++ b/tests/ProviderTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Randomizer.php b/tests/Randomizer.php new file mode 100644 index 000000000..dcf0564c7 --- /dev/null +++ b/tests/Randomizer.php @@ -0,0 +1,452 @@ + + */ + +namespace Yasumi\tests; + +/** + * Trait containing useful functions that generate random dates/years. + */ +trait Randomizer +{ + protected static string $defaultTimezone; + + /** + * Returns a list of random test dates used for assertion of holidays. + * + * @param int $month month (number) for which the test date needs to be generated + * @param int $day day (number) for which the test date needs to be generated + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomDates( + int $month, + int $day, + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $data = []; + $range ??= 1000; + for ($y = 1; $y <= ($iterations ?? 10); ++$y) { + $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); + $data[] = [$year, new \DateTime("$year-$month-$day", new \DateTimeZone($timezone ?? 'UTC'))]; + } + + return $data; + } + + /** + * Returns a list of random easter test dates used for assertion of holidays. + * + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random easter test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomEasterDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $data = []; + $range ??= 1000; + + for ($i = 1; $i <= ($iterations ?? 10); ++$i) { + $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); + $date = $this->calculateEaster($year, $timezone ?? 'UTC'); + + $data[] = [$year, $date->format('Y-m-d')]; + } + + return $data; + } + + /** + * Returns a list of random Easter Monday test dates used for assertion of holidays. + * + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random Easter Monday test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomEasterMondayDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $range ??= 1000; + + return $this->generateRandomModifiedEasterDates(static function (\DateTime $date): void { + $date->add(new \DateInterval('P1D')); + }, $timezone ?? 'UTC', $iterations ?? 10, $range); + } + + /** + * Returns a list of random modified Easter day test dates for assertion of holidays. + * + * @param callable $cb callback(DateTime $date) to modify $date by custom rules + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random modified Easter day test dates for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomModifiedEasterDates( + callable $cb, + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $data = []; + $range ??= 1000; + for ($i = 1; $i <= ($iterations ?? 10); ++$i) { + $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); + $date = $this->calculateEaster($year, $timezone ?? 'UTC'); + + $cb($date); + + $data[] = [$year, $date->format('Y-m-d')]; + } + + return $data; + } + + /** + * Returns a list of random Good Friday test dates used for assertion of holidays. + * + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random Good Friday test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomGoodFridayDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $range ??= 1000; + + return $this->generateRandomModifiedEasterDates(static function (\DateTime $date): void { + $date->sub(new \DateInterval('P2D')); + }, $timezone ?? 'UTC', $iterations ?? 10, $range); + } + + /** + * Returns a list of random Pentecost test dates used for assertion of holidays. + * + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random Pentecost test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomPentecostDates( + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + $range ??= 1000; + + return $this->generateRandomModifiedEasterDates(static function (\DateTime $date): void { + $date->add(new \DateInterval('P49D')); + }, $timezone ?? 'UTC', $iterations ?? 10, $range); + } + + /** + * Returns a list of random test dates used for assertion of holidays. If the date falls in a weekend, the random + * holiday day moves to Monday. + * + * @param int $month month (number) for which the test date needs to be generated + * @param int $day day (number) for which the test date needs to be generated + * @param string|null $timezone name of the timezone for which the dates need to be generated + * @param int|null $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int|null $range year range from which dates will be generated (default: 1000) + * + * @return array list of random test dates used for assertion of holidays + * + * @throws \Exception + */ + public function generateRandomDatesWithHolidayMovedToMonday( + int $month, + int $day, + string $timezone = null, + int $iterations = null, + int $range = null + ): array { + return $this->generateRandomDatesWithModifier($month, $day, function ($range, \DateTime $date): void { + if ($this->isWeekend($date)) { + $date->modify('next monday'); + } + }, $iterations ?? 10, $range, $timezone ?? 'UTC'); + } + + /** + * Returns a list of random test dates used for assertion of holidays with an applied callback. + * + * @param int $month month (number) for which the test date needs to be generated + * @param int $day day (number) for which the test date needs to be generated + * @param callable $callback callback(int $year, \DateTime $dateTime) to modify $dateTime by custom rules + * @param int $iterations number of iterations (i.e., samples) that need to be generated (default: 10). + * @param int $range year range from which dates will be generated (default: 1000) + * @param string|null $timezone name of the timezone for which the dates need to be generated + * + * @return array list of random test dates used for assertion of holidays with an applied callback + * + * @throws \Exception + */ + public function generateRandomDatesWithModifier( + int $month, + int $day, + callable $callback, + int $iterations, + int $range, + string $timezone = null + ): array { + $data = []; + + for ($i = 1; $i <= $iterations; ++$i) { + $year = $this->generateRandomYear($range); + $date = new \DateTime("$year-$month-$day", new \DateTimeZone($timezone ?? 'UTC')); + + $callback($year, $date); + + $data[] = [$year, $date->format('Y-m-d')]; + } + + return $data; + } + + /** + * Generates a random year (number). + * + * @param int|null $lowerLimit lower limit for generating a year number (default: 1000) + * @param int|null $upperLimit upper limit for generating a year number (default: 9999) + * + * @return int a year number + * + * @throws \Exception + */ + public function generateRandomYear( + int $lowerLimit = null, + int $upperLimit = null + ): int { + return self::numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); + } + + /** + * Checks if given $dateTime is a weekend. + * + * @param \DateTimeInterface $dateTime date for which weekend will be checked + * @param array $weekendDays weekend days. Saturday and Sunday are used by default. + * + * @return bool true if $dateTime is a weekend, false otherwise + */ + public function isWeekend( + \DateTimeInterface $dateTime, + array $weekendDays = [0, 6] + ): bool { + return \in_array((int) $dateTime->format('w'), $weekendDays, true); + } + + /** + * Returns a random number between $int1 and $int2 (any order). + * + * @throws \Exception + * + * @example 79907610 + */ + public static function numberBetween(int $int1 = 0, int $int2 = 2_147_483_647): int + { + $min = min($int1, $int2); + $max = max($int1, $int2); + + return random_int($min, $max); + } + + /** + * Get a DateTime object based on a random date between two given dates. + * Accepts date strings that can be recognized by `strtotime`. + * + * @param \DateTime|string $startDate Defaults to 30 years ago + * @param \DateTime|string $endDate Defaults to "now" + * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` + * + * @throws \Exception + * + * @see http://php.net/manual/en/timezones.php + * @see http://php.net/manual/en/function.date-default-timezone-get.php + * + * @example DateTime('1999-02-02 11:42:52') + */ + public static function dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null): \DateTimeInterface + { + $startTimestamp = $startDate instanceof \DateTime ? $startDate->getTimestamp() : strtotime($startDate); + + if (!$startTimestamp) { + throw new \RuntimeException('unable to get timestamp for the start date'); + } + + $endTimestamp = static::getMaxTimestamp($endDate); + + if (!$endTimestamp) { + throw new \RuntimeException('unable to get timestamp for the end date'); + } + + if ($startTimestamp > $endTimestamp) { + throw new \InvalidArgumentException('Start date must be anterior to end date.'); + } + + $timestamp = random_int($startTimestamp, $endTimestamp); + + return static::setTimezone( + new \DateTime('@'.$timestamp), + $timezone + ); + } + + public function randomYearFromArray(array $years): int + { + if ([] === $years) { + throw new \InvalidArgumentException(' years array must not be empty'); + } + + return $years[(int) array_rand($years)]; + } + + /** + * Calculates the date for Easter. + * + * Easter is a festival and holiday celebrating the resurrection of Jesus Christ from the dead. Easter is celebrated + * on a date based on a certain number of days after March 21st. + * + * This function uses the standard PHP 'easter_days' function if the calendar extension is enabled. In case the + * calendar function is not enabled, a fallback calculation has been implemented that is based on the same + * 'easter_days' c function. + * + * Note: In calendrical calculations, frequently operations called integer division are used. + * + * @param int $year year for which Easter needs to be calculated + * @param string $timezone timezone in which Easter is celebrated + * + * @return \DateTime date of Easter + * + * @throws \Exception + * + * @see easter_days + * @see https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/ext/calendar/easter.c + * @see http://www.gmarts.org/index.php?go=415#EasterMallen + * @see http://www.tondering.dk/claus/cal/easter.php + */ + protected function calculateEaster(int $year, string $timezone): \DateTimeInterface + { + if (\extension_loaded('calendar')) { + $easter_days = easter_days($year); + } else { + $golden = (($year % 19) + 1); // The Golden Number + + // The Julian calendar applies to the original method from 326AD. The Gregorian calendar was first + // introduced in October 1582 in Italy. Easter algorithms using the Gregorian calendar apply to years + // 1583 AD to 4099 (A day adjustment is required in or shortly after 4100 AD). + // After 1752, most western churches have adopted the current algorithm. + if ($year <= 1752) { + $dom = ($year + (int) ($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday + if ($dom < 0) { + $dom += 7; + } + + $pfm = (3 - (11 * $golden) - 7) % 30; // Uncorrected date of the Paschal full moon + if ($pfm < 0) { + $pfm += 30; + } + } else { + $dom = ($year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400)) % 7; // The 'Dominical number' - finding a Sunday + if ($dom < 0) { + $dom += 7; + } + + $solar = (int) (($year - 1600) / 100) - (int) (($year - 1600) / 400); // The solar correction + $lunar = (int) (((int) (($year - 1400) / 100) * 8) / 25); // The lunar correction + + $pfm = (3 - (11 * $golden) + $solar - $lunar) % 30; // Uncorrected date of the Paschal full moon + if ($pfm < 0) { + $pfm += 30; + } + } + + // Corrected date of the Paschal full moon, - days after 21st March + if ((29 === $pfm) || (28 === $pfm && $golden > 11)) { + --$pfm; + } + + $tmp = (4 - $pfm - $dom) % 7; + if ($tmp < 0) { + $tmp += 7; + } + + $easter_days = ($pfm + $tmp + 1); // Easter as the number of days after 21st March + } + + $easter = new \DateTime("$year-3-21", new \DateTimeZone($timezone)); + $easter->add(new \DateInterval('P'.$easter_days.'D')); + + return $easter; + } + + /** + * @param \DateTime|string|float|int $max + * + * @return int|false + */ + protected static function getMaxTimestamp($max = 'now') + { + if (is_numeric($max)) { + $ts = (int) $max; + } elseif ($max instanceof \DateTime) { + $ts = $max->getTimestamp(); + } else { + $ts = strtotime(empty($max) ? 'now' : $max); + } + + return $ts; + } + + private static function setTimezone(\DateTimeInterface $dt, ?string $timezone): \DateTimeInterface + { + return $dt->setTimezone(new \DateTimeZone(static::resolveTimezone($timezone))); + } + + private static function resolveTimezone(?string $timezone): string + { + return $timezone ?? (static::$defaultTimezone ?? date_default_timezone_get()); + } +} diff --git a/tests/Romania/AssumptionOfMaryTest.php b/tests/Romania/AssumptionOfMaryTest.php index 913f3034c..30b9f4ba0 100644 --- a/tests/Romania/AssumptionOfMaryTest.php +++ b/tests/Romania/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AssumptionOfMaryTest extends RomaniaBaseTestCase implements HolidayTestCas /** * Tests Assumption Of Mary Day on or after 2008. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAssumptionOfMaryDayOnAfter2008(): void { @@ -49,14 +44,14 @@ public function testAssumptionOfMaryDayOnAfter2008(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Assumption of Mary Day before 2008. * - * @throws ReflectionException + * @throws \Exception */ public function testAssumptionOfMaryDayBefore2008(): void { @@ -70,7 +65,7 @@ public function testAssumptionOfMaryDayBefore2008(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/ChildrensDayTest.php b/tests/Romania/ChildrensDayTest.php index eca6ecfb0..5dc0933a0 100644 --- a/tests/Romania/ChildrensDayTest.php +++ b/tests/Romania/ChildrensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ChildrensDayTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests Children's Day on or after 1950. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChildrensDayOnAfter1950(): void { @@ -49,14 +44,14 @@ public function testChildrensDayOnAfter1950(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-01", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Children's Day before 1950. * - * @throws ReflectionException + * @throws \Exception */ public function testChildrensDayBefore1950(): void { @@ -70,7 +65,7 @@ public function testChildrensDayBefore1950(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/ChristmasDayTest.php b/tests/Romania/ChristmasDayTest.php index 12b96ec3b..3ad66fc60 100644 --- a/tests/Romania/ChristmasDayTest.php +++ b/tests/Romania/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends RomaniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/ConstantinBrancusiDayTest.php b/tests/Romania/ConstantinBrancusiDayTest.php index 92fa37f8b..2a0ab5a99 100644 --- a/tests/Romania/ConstantinBrancusiDayTest.php +++ b/tests/Romania/ConstantinBrancusiDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstantinBrancusiDayTest extends RomaniaBaseTestCase implements HolidayTe /** * Tests Constantin Brancusi Day on or after 2016. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testConstantinBrancusiDayOnAfter2016(): void { @@ -49,14 +44,14 @@ public function testConstantinBrancusiDayOnAfter2016(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-02-19", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-02-19", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Constantin Brancusi Day before 2016. * - * @throws ReflectionException + * @throws \Exception */ public function testConstantinBrancusiDayBefore2016(): void { @@ -70,7 +65,7 @@ public function testConstantinBrancusiDayBefore2016(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/DayAfterNewYearsDayTest.php b/tests/Romania/DayAfterNewYearsDayTest.php index 4e0cdc9de..c8f0e784b 100644 --- a/tests/Romania/DayAfterNewYearsDayTest.php +++ b/tests/Romania/DayAfterNewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class DayAfterNewYearsDayTest extends RomaniaBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/EasterMondayTest.php b/tests/Romania/EasterMondayTest.php old mode 100755 new mode 100644 index a890d352f..711d29a2e --- a/tests/Romania/EasterMondayTest.php +++ b/tests/Romania/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/EasterTest.php b/tests/Romania/EasterTest.php old mode 100755 new mode 100644 index e0d369553..39501b34a --- a/tests/Romania/EasterTest.php +++ b/tests/Romania/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-19", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-19", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/InternationalWorkersDayTest.php b/tests/Romania/InternationalWorkersDayTest.php old mode 100755 new mode 100644 index f7e544303..fa90938a8 --- a/tests/Romania/InternationalWorkersDayTest.php +++ b/tests/Romania/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends RomaniaBaseTestCase implements Holiday * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Romania/NationalDayTest.php b/tests/Romania/NationalDayTest.php index b6a4caf8a..e909b96c1 100644 --- a/tests/Romania/NationalDayTest.php +++ b/tests/Romania/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NationalDayTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests National Day on or after 1990. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayOnAfter1990(): void { @@ -49,15 +44,14 @@ public function testNationalDayOnAfter1990(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests National Day between 1948 - 1989. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayBetween19481989(): void { @@ -66,15 +60,14 @@ public function testNationalDayBetween19481989(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-08-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-08-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests National Day between 1866 - 1947. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayBetween18661947(): void { @@ -83,14 +76,14 @@ public function testNationalDayBetween18661947(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-05-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-05-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests National Day before 1865. * - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayBefore1865(): void { @@ -104,7 +97,7 @@ public function testNationalDayBefore1865(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -119,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/NewYearsDayTest.php b/tests/Romania/NewYearsDayTest.php index 19e0ae449..4cf05658e 100644 --- a/tests/Romania/NewYearsDayTest.php +++ b/tests/Romania/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends RomaniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/PentecostMondayTest.php b/tests/Romania/PentecostMondayTest.php index 2d8bfeb49..524c49ee7 100644 --- a/tests/Romania/PentecostMondayTest.php +++ b/tests/Romania/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PentecostMondayTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests the Pentecost Monday Day on and after 2008. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMondayOnAfter2008(): void { @@ -49,14 +44,14 @@ public function testPentecostMondayOnAfter2008(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-08", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-08", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the Pentecost Day before 2008. * - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMondayBefore2008(): void { @@ -70,7 +65,7 @@ public function testPentecostMondayBefore2008(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/PentecostTest.php b/tests/Romania/PentecostTest.php index a913ab387..e50fd1231 100644 --- a/tests/Romania/PentecostTest.php +++ b/tests/Romania/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PentecostTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests the Pentecost Day on and after 2008. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostDayOnAfter2008(): void { @@ -49,14 +44,14 @@ public function testPentecostDayOnAfter2008(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-07", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-07", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the Pentecost Day before 2008. * - * @throws ReflectionException + * @throws \Exception */ public function testPentecostDayBefore2008(): void { @@ -70,7 +65,7 @@ public function testPentecostDayBefore2008(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/RomaniaBaseTestCase.php b/tests/Romania/RomaniaBaseTestCase.php old mode 100755 new mode 100644 index d77f93168..4f83b400e --- a/tests/Romania/RomaniaBaseTestCase.php +++ b/tests/Romania/RomaniaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Romania/RomaniaTest.php b/tests/Romania/RomaniaTest.php old mode 100755 new mode 100644 index da4d4ea9c..d750bbb9f --- a/tests/Romania/RomaniaTest.php +++ b/tests/Romania/RomaniaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Romania; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -31,6 +30,8 @@ class RomaniaTest extends RomaniaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -39,8 +40,6 @@ protected function setUp(): void /** * Tests if all official holidays in Romania are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -69,8 +68,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Romania are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -89,8 +86,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Romania are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -99,8 +94,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Romania are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -109,8 +102,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Romania are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -118,7 +109,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Romania/SecondChristmasDayTest.php b/tests/Romania/SecondChristmasDayTest.php index 5f4d0514b..f7cc7a3b8 100644 --- a/tests/Romania/SecondChristmasDayTest.php +++ b/tests/Romania/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends RomaniaBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/StAndrewsDayTest.php b/tests/Romania/StAndrewsDayTest.php index 744d47c1f..af6100c74 100644 --- a/tests/Romania/StAndrewsDayTest.php +++ b/tests/Romania/StAndrewsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class StAndrewsDayTest extends RomaniaBaseTestCase implements HolidayTestCase /** * Tests Saint Andrew Day on or after 2012. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testStAndrewDayOnAfter2012(): void { @@ -49,14 +44,14 @@ public function testStAndrewDayOnAfter2012(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Saint Andrew before 2012. * - * @throws ReflectionException + * @throws \Exception */ public function testStAndrewDayBefore2012(): void { @@ -70,7 +65,7 @@ public function testStAndrewDayBefore2012(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Romania/UnitedPrincipalitiesDayTest.php b/tests/Romania/UnitedPrincipalitiesDayTest.php index 53e8a5a0d..175bdd873 100644 --- a/tests/Romania/UnitedPrincipalitiesDayTest.php +++ b/tests/Romania/UnitedPrincipalitiesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Romania; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class UnitedPrincipalitiesDayTest extends RomaniaBaseTestCase implements Holiday /** * Tests united Principalities Day on or after 2015. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testUnitedPrincipalitiesDayOnAfter2015(): void { @@ -49,14 +44,14 @@ public function testUnitedPrincipalitiesDayOnAfter2015(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests unitedPrincipalitiesDay before 2015. * - * @throws ReflectionException + * @throws \Exception */ public function testUnitedPrincipalitiesDayBefore2015(): void { @@ -70,7 +65,7 @@ public function testUnitedPrincipalitiesDayBefore2015(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/DefenceOfTheFatherlandDayTest.php b/tests/Russia/DefenceOfTheFatherlandDayTest.php index 88b552b60..b4c86669a 100644 --- a/tests/Russia/DefenceOfTheFatherlandDayTest.php +++ b/tests/Russia/DefenceOfTheFatherlandDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Russia; use Yasumi\tests\HolidayTestCase; @@ -37,7 +33,7 @@ class DefenceOfTheFatherlandDayTest extends RussiaBaseTestCase implements Holida /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -51,8 +47,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -62,14 +57,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-02-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-02-23", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -88,9 +81,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/InternationalWomensDayTest.php b/tests/Russia/InternationalWomensDayTest.php index 6fdfe19a4..ed31c4573 100644 --- a/tests/Russia/InternationalWomensDayTest.php +++ b/tests/Russia/InternationalWomensDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class InternationalWomensDayTest extends RussiaBaseTestCase implements HolidayTe public const HOLIDAY = 'internationalWomensDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay2Test.php b/tests/Russia/NewYearHolidaysDay2Test.php index 612e8b17d..a3a125126 100644 --- a/tests/Russia/NewYearHolidaysDay2Test.php +++ b/tests/Russia/NewYearHolidaysDay2Test.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearHolidaysDay2Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay2'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay3Test.php b/tests/Russia/NewYearHolidaysDay3Test.php index 392383a6a..8e31cf6c4 100644 --- a/tests/Russia/NewYearHolidaysDay3Test.php +++ b/tests/Russia/NewYearHolidaysDay3Test.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearHolidaysDay3Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay3'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay4Test.php b/tests/Russia/NewYearHolidaysDay4Test.php index c51b88289..dd93daa85 100644 --- a/tests/Russia/NewYearHolidaysDay4Test.php +++ b/tests/Russia/NewYearHolidaysDay4Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -33,7 +30,9 @@ class NewYearHolidaysDay4Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay4'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -42,18 +41,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,9 +61,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay5Test.php b/tests/Russia/NewYearHolidaysDay5Test.php index 242bd2f36..4a6256e12 100644 --- a/tests/Russia/NewYearHolidaysDay5Test.php +++ b/tests/Russia/NewYearHolidaysDay5Test.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearHolidaysDay5Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay5'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay6Test.php b/tests/Russia/NewYearHolidaysDay6Test.php index 5f94abc92..0c74336b6 100644 --- a/tests/Russia/NewYearHolidaysDay6Test.php +++ b/tests/Russia/NewYearHolidaysDay6Test.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearHolidaysDay6Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay6'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearHolidaysDay8Test.php b/tests/Russia/NewYearHolidaysDay8Test.php index fdb45bf79..3f13e32cd 100644 --- a/tests/Russia/NewYearHolidaysDay8Test.php +++ b/tests/Russia/NewYearHolidaysDay8Test.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -33,7 +30,9 @@ class NewYearHolidaysDay8Test extends RussiaBaseTestCase implements HolidayTestC public const HOLIDAY = 'newYearHolidaysDay8'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -42,18 +41,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,9 +61,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/NewYearsDayTest.php b/tests/Russia/NewYearsDayTest.php index 94cad9a1b..41e6634b4 100644 --- a/tests/Russia/NewYearsDayTest.php +++ b/tests/Russia/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class NewYearsDayTest extends RussiaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'newYearsDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/OrthodoxChristmasDayTest.php b/tests/Russia/OrthodoxChristmasDayTest.php index 016526628..f25386111 100644 --- a/tests/Russia/OrthodoxChristmasDayTest.php +++ b/tests/Russia/OrthodoxChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class OrthodoxChristmasDayTest extends RussiaBaseTestCase implements HolidayTest public const HOLIDAY = 'orthodoxChristmasDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/RussiaBaseTestCase.php b/tests/Russia/RussiaBaseTestCase.php index 423c79b11..816e813bb 100644 --- a/tests/Russia/RussiaBaseTestCase.php +++ b/tests/Russia/RussiaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Russia/RussiaDayTest.php b/tests/Russia/RussiaDayTest.php index 65b39e495..1081a9b4b 100644 --- a/tests/Russia/RussiaDayTest.php +++ b/tests/Russia/RussiaDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Russia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class RussiaDayTest extends RussiaBaseTestCase implements HolidayTestCase /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -52,8 +48,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -63,14 +58,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-12", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/RussiaTest.php b/tests/Russia/RussiaTest.php index 0bcb60236..2567d0590 100644 --- a/tests/Russia/RussiaTest.php +++ b/tests/Russia/RussiaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Russia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Russia; use Yasumi\tests\ProviderTestCase; @@ -30,7 +29,7 @@ class RussiaTest extends RussiaBaseTestCase implements ProviderTestCase /** * Tests if all official holidays in Russia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOfficialHolidays(): void { @@ -68,7 +67,7 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Russia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testObservedHolidays(): void { @@ -78,7 +77,7 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Russia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testSeasonalHolidays(): void { @@ -88,7 +87,7 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Russia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testBankHolidays(): void { @@ -98,7 +97,7 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Russia are defined by the provider class. * - * @throws ReflectionException + * @throws \Exception */ public function testOtherHolidays(): void { @@ -106,7 +105,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Russia/SpringAndLabourDayTest.php b/tests/Russia/SpringAndLabourDayTest.php index 174b27369..756c322e2 100644 --- a/tests/Russia/SpringAndLabourDayTest.php +++ b/tests/Russia/SpringAndLabourDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class SpringAndLabourDayTest extends RussiaBaseTestCase implements HolidayTestCa public const HOLIDAY = 'springAndLabourDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/UnityDayTest.php b/tests/Russia/UnityDayTest.php index 64287fea7..e6122f546 100644 --- a/tests/Russia/UnityDayTest.php +++ b/tests/Russia/UnityDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Russia; use Yasumi\tests\HolidayTestCase; @@ -38,7 +34,7 @@ class UnityDayTest extends RussiaBaseTestCase implements HolidayTestCase /** * Test if holiday is not defined before. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBefore(): void { @@ -52,8 +48,7 @@ public function testHolidayBefore(): void /** * Test if holiday is defined after. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfter(): void { @@ -63,14 +58,12 @@ public function testHolidayAfter(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-04", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-04", new \DateTimeZone(self::TIMEZONE)) ); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -89,9 +82,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Russia/VictoryDayTest.php b/tests/Russia/VictoryDayTest.php index 98080be53..7268c9369 100644 --- a/tests/Russia/VictoryDayTest.php +++ b/tests/Russia/VictoryDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Russia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,7 +31,9 @@ class VictoryDayTest extends RussiaBaseTestCase implements HolidayTestCase public const HOLIDAY = 'victoryDay'; /** - * @throws Exception + * @return array list of test dates for the holiday defined in this test + * + * @throws \Exception */ public function holidayDataProvider(): array { @@ -43,18 +42,14 @@ public function holidayDataProvider(): array /** * @dataProvider holidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,9 +62,7 @@ public function testTranslation(): void } /** - * {@inheritdoc} - * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/AllSaintsDayTest.php b/tests/Slovakia/AllSaintsDayTest.php index 902ef8b86..56f3d4044 100644 --- a/tests/Slovakia/AllSaintsDayTest.php +++ b/tests/Slovakia/AllSaintsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class AllSaintsDayTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/ChristmasDayTest.php b/tests/Slovakia/ChristmasDayTest.php index 7f9bb4fc5..14223227e 100644 --- a/tests/Slovakia/ChristmasDayTest.php +++ b/tests/Slovakia/ChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class ChristmasDayTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/ChristmasEveTest.php b/tests/Slovakia/ChristmasEveTest.php index 41f718fa5..7a6e0a367 100644 --- a/tests/Slovakia/ChristmasEveTest.php +++ b/tests/Slovakia/ChristmasEveTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class ChristmasEveTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasEve(int $year, DateTime $expected): void + public function testChristmasEve(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testChristmasEve(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Eve. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/EasterMondayTest.php b/tests/Slovakia/EasterMondayTest.php index 84bbcc628..5ef53b2b4 100644 --- a/tests/Slovakia/EasterMondayTest.php +++ b/tests/Slovakia/EasterMondayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +35,10 @@ class EasterMondayTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,30 +46,30 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { $timezone = self::TIMEZONE; return [ - [1788, new DateTime('1788-3-24', new DateTimeZone($timezone))], - [1876, new DateTime('1876-4-17', new DateTimeZone($timezone))], - [2016, new DateTime('2016-3-28', new DateTimeZone($timezone))], - [2017, new DateTime('2017-4-17', new DateTimeZone($timezone))], - [2018, new DateTime('2018-4-2', new DateTimeZone($timezone))], - [2019, new DateTime('2019-4-22', new DateTimeZone($timezone))], - [2020, new DateTime('2020-4-13', new DateTimeZone($timezone))], - [2050, new DateTime('2050-4-11', new DateTimeZone($timezone))], + [1788, new \DateTime('1788-3-24', new \DateTimeZone($timezone))], + [1876, new \DateTime('1876-4-17', new \DateTimeZone($timezone))], + [2016, new \DateTime('2016-3-28', new \DateTimeZone($timezone))], + [2017, new \DateTime('2017-4-17', new \DateTimeZone($timezone))], + [2018, new \DateTime('2018-4-2', new \DateTimeZone($timezone))], + [2019, new \DateTime('2019-4-22', new \DateTimeZone($timezone))], + [2020, new \DateTime('2020-4-13', new \DateTimeZone($timezone))], + [2050, new \DateTime('2050-4-11', new \DateTimeZone($timezone))], ]; } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -90,7 +84,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/EpiphanyTest.php b/tests/Slovakia/EpiphanyTest.php index 07ad9c2b2..296a99f2c 100644 --- a/tests/Slovakia/EpiphanyTest.php +++ b/tests/Slovakia/EpiphanyTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class EpiphanyTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/GoodFridayTest.php b/tests/Slovakia/GoodFridayTest.php index 9ccf63e00..3ac9a4d6c 100644 --- a/tests/Slovakia/GoodFridayTest.php +++ b/tests/Slovakia/GoodFridayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +35,10 @@ class GoodFridayTest extends SlovakiaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,30 +46,30 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { $timezone = self::TIMEZONE; return [ - [1788, new DateTime('1788-3-21', new DateTimeZone($timezone))], - [1876, new DateTime('1876-4-14', new DateTimeZone($timezone))], - [2016, new DateTime('2016-3-25', new DateTimeZone($timezone))], - [2017, new DateTime('2017-4-14', new DateTimeZone($timezone))], - [2018, new DateTime('2018-3-30', new DateTimeZone($timezone))], - [2019, new DateTime('2019-4-19', new DateTimeZone($timezone))], - [2020, new DateTime('2020-4-10', new DateTimeZone($timezone))], - [2050, new DateTime('2050-4-8', new DateTimeZone($timezone))], + [1788, new \DateTime('1788-3-21', new \DateTimeZone($timezone))], + [1876, new \DateTime('1876-4-14', new \DateTimeZone($timezone))], + [2016, new \DateTime('2016-3-25', new \DateTimeZone($timezone))], + [2017, new \DateTime('2017-4-14', new \DateTimeZone($timezone))], + [2018, new \DateTime('2018-3-30', new \DateTimeZone($timezone))], + [2019, new \DateTime('2019-4-19', new \DateTimeZone($timezone))], + [2020, new \DateTime('2020-4-10', new \DateTimeZone($timezone))], + [2050, new \DateTime('2050-4-8', new \DateTimeZone($timezone))], ]; } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -90,7 +84,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/InternationalWorkersDayTest.php b/tests/Slovakia/InternationalWorkersDayTest.php index ec68de79d..a27715b44 100644 --- a/tests/Slovakia/InternationalWorkersDayTest.php +++ b/tests/Slovakia/InternationalWorkersDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class InternationalWorkersDayTest extends SlovakiaBaseTestCase implements Holida * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/OurLadyOfSorrowsDayTest.php b/tests/Slovakia/OurLadyOfSorrowsDayTest.php index 061c25036..52d18ca65 100644 --- a/tests/Slovakia/OurLadyOfSorrowsDayTest.php +++ b/tests/Slovakia/OurLadyOfSorrowsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class OurLadyOfSorrowsDayTest extends SlovakiaBaseTestCase implements HolidayTes * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php b/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php index e519ffbe3..0ce4fab79 100644 --- a/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php +++ b/tests/Slovakia/SaintsCyrilAndMethodiusDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class SaintsCyrilAndMethodiusDayTest extends SlovakiaBaseTestCase implements Hol * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SecondChristmasDayTest.php b/tests/Slovakia/SecondChristmasDayTest.php index d20e4c666..dc5151d8e 100644 --- a/tests/Slovakia/SecondChristmasDayTest.php +++ b/tests/Slovakia/SecondChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class SecondChristmasDayTest extends SlovakiaBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Second Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SlovakConstitutionDayTest.php b/tests/Slovakia/SlovakConstitutionDayTest.php index 004410b8c..370a4aea5 100644 --- a/tests/Slovakia/SlovakConstitutionDayTest.php +++ b/tests/Slovakia/SlovakConstitutionDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class SlovakConstitutionDayTest extends SlovakiaBaseTestCase implements HolidayT * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SlovakIndependeceDayTest.php b/tests/Slovakia/SlovakIndependeceDayTest.php index 07d12c3cb..da99cbc0b 100644 --- a/tests/Slovakia/SlovakIndependeceDayTest.php +++ b/tests/Slovakia/SlovakIndependeceDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,12 +36,10 @@ class SlovakIndependeceDayTest extends SlovakiaBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -52,9 +47,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -64,7 +59,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SlovakNationalUprisingDayTest.php b/tests/Slovakia/SlovakNationalUprisingDayTest.php index 023dc4b38..8ccd99782 100644 --- a/tests/Slovakia/SlovakNationalUprisingDayTest.php +++ b/tests/Slovakia/SlovakNationalUprisingDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class SlovakNationalUprisingDayTest extends SlovakiaBaseTestCase implements Holi * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/SlovakiaBaseTestCase.php b/tests/Slovakia/SlovakiaBaseTestCase.php index 76bd8cca6..447ad2df8 100644 --- a/tests/Slovakia/SlovakiaBaseTestCase.php +++ b/tests/Slovakia/SlovakiaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Slovakia/SlovakiaTest.php b/tests/Slovakia/SlovakiaTest.php index 305821833..c9d76a1e1 100644 --- a/tests/Slovakia/SlovakiaTest.php +++ b/tests/Slovakia/SlovakiaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Slovakia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -33,6 +32,8 @@ class SlovakiaTest extends SlovakiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -42,8 +43,6 @@ protected function setUp(): void /** * Tests if all official holidays in Slovakia are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -58,8 +57,6 @@ public function testOfficialHolidays(): void /** * Tests if all bank holidays in Slovakia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -79,8 +76,6 @@ public function testBankHolidays(): void /** * Tests if all observed holidays in Slovakia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -89,8 +84,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Slovakia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -99,8 +92,6 @@ public function testSeasonalHolidays(): void /** * Tests if all other holidays in Slovakia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -108,7 +99,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php b/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php index 1d142ee7e..70a28cd10 100644 --- a/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php +++ b/tests/Slovakia/StruggleForFreedomAndDemocracyDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StruggleForFreedomAndDemocracyDayTest extends SlovakiaBaseTestCase impleme * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Slovakia/VictoryInEuropeDayTest.php b/tests/Slovakia/VictoryInEuropeDayTest.php index 15c4f8116..307a6694a 100644 --- a/tests/Slovakia/VictoryInEuropeDayTest.php +++ b/tests/Slovakia/VictoryInEuropeDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Slovakia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class VictoryInEuropeDayTest extends SlovakiaBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -63,7 +58,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/ChristmasDayTest.php b/tests/SouthAfrica/ChristmasDayTest.php index 0bb3a7183..9c03210b7 100644 --- a/tests/SouthAfrica/ChristmasDayTest.php +++ b/tests/SouthAfrica/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class ChristmasDayTest extends SouthAfricaBaseTestCase implements HolidayTestCas * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/FamilyDayTest.php b/tests/SouthAfrica/FamilyDayTest.php index ea65d5bf7..69397edd9 100644 --- a/tests/SouthAfrica/FamilyDayTest.php +++ b/tests/SouthAfrica/FamilyDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +44,7 @@ class FamilyDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -58,16 +52,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +70,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -86,7 +80,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -100,7 +94,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -115,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/FreedomDayTest.php b/tests/SouthAfrica/FreedomDayTest.php index 1f0e20ba4..95b8eec2b 100644 --- a/tests/SouthAfrica/FreedomDayTest.php +++ b/tests/SouthAfrica/FreedomDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class FreedomDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-4-27", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-4-27", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/GoodFridayTest.php b/tests/SouthAfrica/GoodFridayTest.php index 199ab3944..28275e194 100644 --- a/tests/SouthAfrica/GoodFridayTest.php +++ b/tests/SouthAfrica/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +44,7 @@ class GoodFridayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -58,16 +52,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -76,7 +70,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->sub(new DateInterval('P2D')); + $date->sub(new \DateInterval('P2D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -86,7 +80,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -100,7 +94,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -115,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/HeritageDayTest.php b/tests/SouthAfrica/HeritageDayTest.php index 809de1d73..e6dc62a97 100644 --- a/tests/SouthAfrica/HeritageDayTest.php +++ b/tests/SouthAfrica/HeritageDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class HeritageDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-9-24", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-9-24", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/HumanRightsDayTest.php b/tests/SouthAfrica/HumanRightsDayTest.php index 2004dcca7..617e51302 100644 --- a/tests/SouthAfrica/HumanRightsDayTest.php +++ b/tests/SouthAfrica/HumanRightsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class HumanRightsDayTest extends SouthAfricaBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/MunicipalElections2016DayTest.php b/tests/SouthAfrica/MunicipalElections2016DayTest.php index 644b7d90c..9e40bffb8 100644 --- a/tests/SouthAfrica/MunicipalElections2016DayTest.php +++ b/tests/SouthAfrica/MunicipalElections2016DayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -43,8 +39,7 @@ class MunicipalElections2016DayTest extends SouthAfricaBaseTestCase implements H /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -52,14 +47,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR, - new DateTime(self::ESTABLISHMENT_YEAR.'-8-3', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::ESTABLISHMENT_YEAR.'-8-3', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -73,7 +68,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the holiday defined in this test after completion. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayDayAfterCompletion(): void { @@ -83,7 +78,7 @@ public function testHolidayDayAfterCompletion(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -98,7 +93,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/NationalWomensDayTest.php b/tests/SouthAfrica/NationalWomensDayTest.php index 42b2cb092..993635f3d 100644 --- a/tests/SouthAfrica/NationalWomensDayTest.php +++ b/tests/SouthAfrica/NationalWomensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class NationalWomensDayTest extends SouthAfricaBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-8-9", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-8-9", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/NewYearsDayTest.php b/tests/SouthAfrica/NewYearsDayTest.php index 712814ff1..3f39dfc13 100644 --- a/tests/SouthAfrica/NewYearsDayTest.php +++ b/tests/SouthAfrica/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class NewYearsDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/ReconciliationDayTest.php b/tests/SouthAfrica/ReconciliationDayTest.php index 962239c52..4348ea2d3 100644 --- a/tests/SouthAfrica/ReconciliationDayTest.php +++ b/tests/SouthAfrica/ReconciliationDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class ReconciliationDayTest extends SouthAfricaBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-12-16", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-16", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/SecondChristmasDayTest.php b/tests/SouthAfrica/SecondChristmasDayTest.php index ff450186c..6036a9cd2 100644 --- a/tests/SouthAfrica/SecondChristmasDayTest.php +++ b/tests/SouthAfrica/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class SecondChristmasDayTest extends SouthAfricaBaseTestCase implements HolidayT * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/SouthAfricaBaseTestCase.php b/tests/SouthAfrica/SouthAfricaBaseTestCase.php index 99734c0bb..5e1662aea 100644 --- a/tests/SouthAfrica/SouthAfricaBaseTestCase.php +++ b/tests/SouthAfrica/SouthAfricaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/SouthAfrica/SouthAfricaTest.php b/tests/SouthAfrica/SouthAfricaTest.php index c3dc937eb..8abe065b1 100644 --- a/tests/SouthAfrica/SouthAfricaTest.php +++ b/tests/SouthAfrica/SouthAfricaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\SouthAfrica; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -29,10 +28,12 @@ class SouthAfricaTest extends SouthAfricaBaseTestCase implements ProviderTestCas /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -41,8 +42,6 @@ protected function setUp(): void /** * Tests if all official holidays in SouthAfrica are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -71,8 +70,6 @@ public function testOfficialHolidays(): void /** * Tests if all bank holidays in South Africa are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -81,8 +78,6 @@ public function testBankHolidays(): void /** * Tests if all observed holidays in South Africa are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -91,8 +86,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in South Africa are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -101,8 +94,6 @@ public function testSeasonalHolidays(): void /** * Tests if all other holidays in South Africa are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php b/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php index 0b660ee1a..f49daa427 100644 --- a/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php +++ b/tests/SouthAfrica/SubstituteDayOfGoodwillTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -43,8 +39,7 @@ class SubstituteDayOfGoodwillTest extends SouthAfricaBaseTestCase implements Hol /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -52,14 +47,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR, - new DateTime(self::ESTABLISHMENT_YEAR.'-12-27', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::ESTABLISHMENT_YEAR.'-12-27', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -73,7 +68,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the holiday defined in this test after completion. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayDayAfterCompletion(): void { @@ -83,7 +78,7 @@ public function testHolidayDayAfterCompletion(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -98,7 +93,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/WorkersDayTest.php b/tests/SouthAfrica/WorkersDayTest.php index 73a1a8f6c..d6fe62e71 100644 --- a/tests/SouthAfrica/WorkersDayTest.php +++ b/tests/SouthAfrica/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class WorkersDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthAfrica/YouthDayTest.php b/tests/SouthAfrica/YouthDayTest.php index b6ec95c01..5b38b9943 100644 --- a/tests/SouthAfrica/YouthDayTest.php +++ b/tests/SouthAfrica/YouthDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\SouthAfrica; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,17 +44,16 @@ class YouthDayTest extends SouthAfricaBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); // Whenever any public holiday falls on a Sunday, the Monday following on it shall be a public holiday. if (0 === (int) $date->format('w')) { - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,9 +61,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -77,7 +71,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-6-16", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-6-16", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -87,7 +81,7 @@ public function HolidayDataProvider(): array /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -101,7 +95,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -116,7 +110,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ArborDayTest.php b/tests/SouthKorea/ArborDayTest.php index 396f8e92a..0de52a57b 100644 --- a/tests/SouthKorea/ArborDayTest.php +++ b/tests/SouthKorea/ArborDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class ArborDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -66,7 +61,7 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-5", new \DateTimeZone(self::TIMEZONE)) ); } } @@ -74,7 +69,7 @@ public function testHoliday(): void /** * Tests the holiday defined in this test after removal. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRemoval(): void { @@ -88,7 +83,7 @@ public function testHolidayAfterRemoval(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -102,7 +97,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -120,7 +115,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ArmedForcesDayTest.php b/tests/SouthKorea/ArmedForcesDayTest.php index 93169afc9..f067ab0bb 100644 --- a/tests/SouthKorea/ArmedForcesDayTest.php +++ b/tests/SouthKorea/ArmedForcesDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -45,8 +41,7 @@ class ArmedForcesDayTest extends SouthKoreaBaseTestCase implements HolidayTestCa /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -55,14 +50,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test after removal. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRemoval(): void { @@ -76,7 +71,7 @@ public function testHolidayAfterRemoval(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -90,7 +85,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +100,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/BuddhasBirthdayTest.php b/tests/SouthKorea/BuddhasBirthdayTest.php index aade35964..87477ec66 100644 --- a/tests/SouthKorea/BuddhasBirthdayTest.php +++ b/tests/SouthKorea/BuddhasBirthdayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\SouthKorea; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class BuddhasBirthdayTest extends SouthKoreaBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -52,7 +47,7 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new DateTimeZone(self::TIMEZONE)) + new \DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new \DateTimeZone(self::TIMEZONE)) ); } } @@ -60,7 +55,7 @@ public function testHoliday(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -74,7 +69,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -92,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ChildrensDayTest.php b/tests/SouthKorea/ChildrensDayTest.php index 5fd2a8b01..696f651a2 100644 --- a/tests/SouthKorea/ChildrensDayTest.php +++ b/tests/SouthKorea/ChildrensDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ChildrensDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,33 +45,32 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the substitute holiday defined in this test (conflict with Buddha's Birthday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHolidayByBuddhasBirthday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); foreach ([2025, 2044] as $year) { $this->assertHoliday( self::REGION, 'buddhasBirthday', $year, - new DateTime("$year-5-5", $tz) + new \DateTime("$year-5-5", $tz) ); $this->assertSubstituteHoliday( self::REGION, 'buddhasBirthday', $year, - new DateTime("$year-5-6", $tz) + new \DateTime("$year-5-6", $tz) ); } } @@ -84,12 +78,11 @@ public function testSubstituteHolidayByBuddhasBirthday(): void /** * Tests the substitute holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2013); @@ -97,7 +90,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2019, - new DateTime('2019-5-6', $tz) + new \DateTime('2019-5-6', $tz) ); // By saturday @@ -105,7 +98,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2029, - new DateTime('2029-5-7', $tz) + new \DateTime('2029-5-7', $tz) ); // By sunday @@ -113,14 +106,14 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2024, - new DateTime('2024-5-6', $tz) + new \DateTime('2024-5-6', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -134,7 +127,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -149,7 +142,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ChristmasDayTest.php b/tests/SouthKorea/ChristmasDayTest.php index 700358ce5..c6f3f815a 100644 --- a/tests/SouthKorea/ChristmasDayTest.php +++ b/tests/SouthKorea/ChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ChristmasDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,14 +45,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -71,7 +66,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ChuseokTest.php b/tests/SouthKorea/ChuseokTest.php index 3061323aa..fbac5fcc5 100644 --- a/tests/SouthKorea/ChuseokTest.php +++ b/tests/SouthKorea/ChuseokTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,11 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\SouthKorea; use Yasumi\tests\HolidayTestCase; @@ -42,14 +37,13 @@ class ChuseokTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 2050); if (isset(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year])) { - $date = new DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new \DateTimeZone(self::TIMEZONE)); // Chuseok $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -60,7 +54,7 @@ public function testHoliday(): void self::REGION, 'dayAfterChuseok', $year, - (clone $date)->add(new DateInterval('P1D')) + (clone $date)->add(new \DateInterval('P1D')) ); } @@ -70,7 +64,7 @@ public function testHoliday(): void self::REGION, 'dayBeforeChuseok', $year, - (clone $date)->sub(new DateInterval('P1D')) + (clone $date)->sub(new \DateInterval('P1D')) ); } } @@ -79,19 +73,18 @@ public function testHoliday(): void /** * Tests the substitute holiday defined in this test (conflict with Gaecheonjeol). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHolidayByGaecheonjeol(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); foreach ([2017, 2028, 2036, 2039] as $year) { $this->assertHoliday( self::REGION, 'nationalFoundationDay', $year, - new DateTime("$year-10-3", $tz) + new \DateTime("$year-10-3", $tz) ); } @@ -99,44 +92,43 @@ public function testSubstituteHolidayByGaecheonjeol(): void self::REGION, 'dayBeforeChuseok', 2017, - new DateTime('2017-10-6', $tz) + new \DateTime('2017-10-6', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'chuseok', 2028, - new DateTime('2028-10-5', $tz) + new \DateTime('2028-10-5', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'dayBeforeChuseok', 2036, - new DateTime('2036-10-6', $tz) + new \DateTime('2036-10-6', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'dayAfterChuseok', 2039, - new DateTime('2039-10-5', $tz) + new \DateTime('2039-10-5', $tz) ); } /** * Tests the substitute holiday defined in this test (conflict with Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertSubstituteHoliday( self::REGION, 'dayBeforeChuseok', 2014, - new DateTime('2014-9-10', $tz) + new \DateTime('2014-9-10', $tz) ); // By sunday @@ -144,26 +136,26 @@ public function testSubstituteHoliday(): void self::REGION, 'dayBeforeChuseok', 2025, - new DateTime('2025-10-8', $tz) + new \DateTime('2025-10-8', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'chuseok', 2032, - new DateTime('2032-9-21', $tz) + new \DateTime('2032-9-21', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'dayAfterChuseok', 2036, - new DateTime('2036-10-7', $tz) + new \DateTime('2036-10-7', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -177,7 +169,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -211,7 +203,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/ConstitutionDayTest.php b/tests/SouthKorea/ConstitutionDayTest.php index 58e5de3ea..7dd3fb568 100644 --- a/tests/SouthKorea/ConstitutionDayTest.php +++ b/tests/SouthKorea/ConstitutionDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -45,8 +41,7 @@ class ConstitutionDayTest extends SouthKoreaBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -55,14 +50,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test after removal. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRemoval(): void { @@ -76,7 +71,7 @@ public function testHolidayAfterRemoval(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -90,7 +85,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +100,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/GaecheonjeolTest.php b/tests/SouthKorea/GaecheonjeolTest.php index 96e1e3f95..5c3e983dc 100644 --- a/tests/SouthKorea/GaecheonjeolTest.php +++ b/tests/SouthKorea/GaecheonjeolTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class GaecheonjeolTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,31 +45,30 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the substitute holiday defined in this test (conflict with Chuseok). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteByChuseok(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); $this->assertHoliday( self::REGION, 'chuseok', 2028, - new DateTime('2028-10-3', $tz) + new \DateTime('2028-10-3', $tz) ); $this->assertHoliday( self::REGION, 'dayBeforeChuseok', 2036, - new DateTime('2036-10-3', $tz) + new \DateTime('2036-10-3', $tz) ); // Chuseok will be substitute instead of Gaecheonjeol. $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2028); @@ -84,12 +78,11 @@ public function testSubstituteByChuseok(): void /** * Tests the substitute holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2015); @@ -98,7 +91,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2021, - new DateTime('2021-10-4', $tz) + new \DateTime('2021-10-4', $tz) ); // By saturday @@ -106,7 +99,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2026, - new DateTime('2026-10-5', $tz) + new \DateTime('2026-10-5', $tz) ); // By sunday @@ -114,14 +107,14 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2032, - new DateTime('2032-10-4', $tz) + new \DateTime('2032-10-4', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -135,7 +128,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -150,7 +143,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/HangulDayTest.php b/tests/SouthKorea/HangulDayTest.php index b1680a802..aaffb1654 100644 --- a/tests/SouthKorea/HangulDayTest.php +++ b/tests/SouthKorea/HangulDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class HangulDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -57,7 +52,7 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-9", new \DateTimeZone(self::TIMEZONE)) ); } } @@ -65,12 +60,11 @@ public function testHoliday(): void /** * Tests the substitute holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2016); @@ -78,7 +72,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2021, - new DateTime('2021-10-11', $tz) + new \DateTime('2021-10-11', $tz) ); // By saturday @@ -86,7 +80,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2027, - new DateTime('2027-10-11', $tz) + new \DateTime('2027-10-11', $tz) ); // By sunday @@ -94,14 +88,14 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2022, - new DateTime('2022-10-10', $tz) + new \DateTime('2022-10-10', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -115,7 +109,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -133,7 +127,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/IndependenceMovementDayTest.php b/tests/SouthKorea/IndependenceMovementDayTest.php index 2985afb3b..0464d767e 100644 --- a/tests/SouthKorea/IndependenceMovementDayTest.php +++ b/tests/SouthKorea/IndependenceMovementDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class IndependenceMovementDayTest extends SouthKoreaBaseTestCase implements Holi /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,19 +45,18 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the substitute holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2020); @@ -72,13 +66,13 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2025, - new DateTime('2025-3-3', $tz) + new \DateTime('2025-3-3', $tz) ); $this->assertSubstituteHoliday( self::REGION, self::HOLIDAY, 2031, - new DateTime('2031-3-3', $tz) + new \DateTime('2031-3-3', $tz) ); // By sunday @@ -86,21 +80,21 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2026, - new DateTime('2026-3-2', $tz) + new \DateTime('2026-3-2', $tz) ); // By sunday $this->assertSubstituteHoliday( self::REGION, self::HOLIDAY, 2037, - new DateTime('2037-3-2', $tz) + new \DateTime('2037-3-2', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -114,7 +108,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -129,7 +123,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/LiberationDayTest.php b/tests/SouthKorea/LiberationDayTest.php index bfb501cde..989db8e95 100644 --- a/tests/SouthKorea/LiberationDayTest.php +++ b/tests/SouthKorea/LiberationDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class LiberationDayTest extends SouthKoreaBaseTestCase implements HolidayTestCas /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,19 +45,18 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-15", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-15", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the substitute holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertNotSubstituteHoliday(self::REGION, self::HOLIDAY, 2020); @@ -72,7 +66,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2021, - new DateTime('2021-8-16', $tz) + new \DateTime('2021-8-16', $tz) ); // By saturday @@ -80,7 +74,7 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2037, - new DateTime('2037-8-17', $tz) + new \DateTime('2037-8-17', $tz) ); // By sunday @@ -88,14 +82,14 @@ public function testSubstituteHoliday(): void self::REGION, self::HOLIDAY, 2027, - new DateTime('2027-8-16', $tz) + new \DateTime('2027-8-16', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -109,7 +103,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -124,7 +118,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/MemorialDayTest.php b/tests/SouthKorea/MemorialDayTest.php index d4e41a8c7..a3e326816 100644 --- a/tests/SouthKorea/MemorialDayTest.php +++ b/tests/SouthKorea/MemorialDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class MemorialDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,14 +45,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -71,7 +66,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/NewYearsDayTest.php b/tests/SouthKorea/NewYearsDayTest.php index a16c08613..5f9a340fa 100644 --- a/tests/SouthKorea/NewYearsDayTest.php +++ b/tests/SouthKorea/NewYearsDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,11 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,13 +36,12 @@ class NewYearsDayTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)); // New Year's Day $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -58,7 +52,7 @@ public function testHoliday(): void self::REGION, 'dayAfterNewYearsDay', $year, - (clone $date)->add(new DateInterval('P1D')) + (clone $date)->add(new \DateInterval('P1D')) ); } @@ -68,7 +62,7 @@ public function testHoliday(): void self::REGION, 'twoDaysLaterNewYearsDay', $year, - (clone $date)->add(new DateInterval('P2D')) + (clone $date)->add(new \DateInterval('P2D')) ); } } @@ -76,7 +70,7 @@ public function testHoliday(): void /** * Tests the holiday defined in this test after removal. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterRemoval(): void { @@ -95,7 +89,7 @@ public function testHolidayAfterRemoval(): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -109,7 +103,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -136,7 +130,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/SeollalTest.php b/tests/SouthKorea/SeollalTest.php index 933366b77..54e9bada6 100644 --- a/tests/SouthKorea/SeollalTest.php +++ b/tests/SouthKorea/SeollalTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,11 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\SouthKorea; use Yasumi\tests\HolidayTestCase; @@ -42,14 +37,13 @@ class SeollalTest extends SouthKoreaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 2050); if (isset(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year])) { - $date = new DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime(SouthKorea::LUNAR_HOLIDAY[self::HOLIDAY][$year], new \DateTimeZone(self::TIMEZONE)); // Seollal $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); @@ -60,7 +54,7 @@ public function testHoliday(): void self::REGION, 'dayBeforeSeollal', $year, - (clone $date)->sub(new DateInterval('P1D')) + (clone $date)->sub(new \DateInterval('P1D')) ); // Day after Seollal @@ -68,7 +62,7 @@ public function testHoliday(): void self::REGION, 'dayAfterSeollal', $year, - (clone $date)->add(new DateInterval('P1D')) + (clone $date)->add(new \DateInterval('P1D')) ); } } @@ -77,19 +71,18 @@ public function testHoliday(): void /** * Tests the substitute holiday defined in this test (conflict with Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testSubstituteHoliday(): void { - $tz = new DateTimeZone(self::TIMEZONE); + $tz = new \DateTimeZone(self::TIMEZONE); // Before 2022 $this->assertSubstituteHoliday( self::REGION, 'dayBeforeSeollal', 2016, - new DateTime('2016-2-10', $tz) + new \DateTime('2016-2-10', $tz) ); $this->assertNotSubstituteHoliday(self::REGION, 'dayAfterSeollal', 2021); @@ -98,26 +91,26 @@ public function testSubstituteHoliday(): void self::REGION, 'dayBeforeSeollal', 2033, - new DateTime('2033-2-2', $tz) + new \DateTime('2033-2-2', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'seollal', 2034, - new DateTime('2034-2-21', $tz) + new \DateTime('2034-2-21', $tz) ); $this->assertSubstituteHoliday( self::REGION, 'dayAfterSeollal', 2024, - new DateTime('2024-2-12', $tz) + new \DateTime('2024-2-12', $tz) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -131,7 +124,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -163,7 +156,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/SouthKorea/SouthKoreaBaseTestCase.php b/tests/SouthKorea/SouthKoreaBaseTestCase.php index 3d4fa96e4..e59b90f92 100644 --- a/tests/SouthKorea/SouthKoreaBaseTestCase.php +++ b/tests/SouthKorea/SouthKoreaBaseTestCase.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/SouthKorea/SouthKoreaTest.php b/tests/SouthKorea/SouthKoreaTest.php index 85acd3b1d..82e17379e 100644 --- a/tests/SouthKorea/SouthKoreaTest.php +++ b/tests/SouthKorea/SouthKoreaTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\SouthKorea; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\SouthKorea; use Yasumi\tests\ProviderTestCase; @@ -28,10 +27,12 @@ class SouthKoreaTest extends SouthKoreaBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -40,8 +41,6 @@ protected function setUp(): void /** * Tests if all official holidays in South Korea are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -103,8 +102,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in South Korea are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -113,8 +110,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in South Korea are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -123,8 +118,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in South Korea are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -133,8 +126,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in South Korea are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -142,7 +133,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/AllSaintsDayTest.php b/tests/Spain/AllSaintsDayTest.php index 3cd01d2e0..e56bf9b9f 100644 --- a/tests/Spain/AllSaintsDayTest.php +++ b/tests/Spain/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Andalusia/AndalusiaBaseTestCase.php b/tests/Spain/Andalusia/AndalusiaBaseTestCase.php index 7a717c403..079ca6600 100644 --- a/tests/Spain/Andalusia/AndalusiaBaseTestCase.php +++ b/tests/Spain/Andalusia/AndalusiaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Andalusia/AndalusiaDayTest.php b/tests/Spain/Andalusia/AndalusiaDayTest.php index 12e17e2fc..bdcc5aca2 100644 --- a/tests/Spain/Andalusia/AndalusiaDayTest.php +++ b/tests/Spain/Andalusia/AndalusiaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Andalusia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AndalusiaDayTest extends AndalusiaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Andalusia/AndalusiaTest.php b/tests/Spain/Andalusia/AndalusiaTest.php index 6a2c8313f..cce8b0a70 100644 --- a/tests/Spain/Andalusia/AndalusiaTest.php +++ b/tests/Spain/Andalusia/AndalusiaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Andalusia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class AndalusiaTest extends AndalusiaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Andalusia (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Andalusia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Andalusia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Andalusia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Andalusia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Aragon/AragonBaseTestCase.php b/tests/Spain/Aragon/AragonBaseTestCase.php index 4f2b70c22..9241599d6 100644 --- a/tests/Spain/Aragon/AragonBaseTestCase.php +++ b/tests/Spain/Aragon/AragonBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Aragon/AragonTest.php b/tests/Spain/Aragon/AragonTest.php index 8948f83fd..25ee7cd2c 100644 --- a/tests/Spain/Aragon/AragonTest.php +++ b/tests/Spain/Aragon/AragonTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Aragon; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class AragonTest extends AragonBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Aragon (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Aragon are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Aragon are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Aragon are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Aragon are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Aragon/StGeorgesDayTest.php b/tests/Spain/Aragon/StGeorgesDayTest.php index 5487aa677..52c58479c 100644 --- a/tests/Spain/Aragon/StGeorgesDayTest.php +++ b/tests/Spain/Aragon/StGeorgesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Aragon; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class StGeorgesDayTest extends AragonBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/AssumptionOfMaryTest.php b/tests/Spain/AssumptionOfMaryTest.php index 4766ddd43..45005397c 100644 --- a/tests/Spain/AssumptionOfMaryTest.php +++ b/tests/Spain/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Asturias/AsturiasBaseTestCase.php b/tests/Spain/Asturias/AsturiasBaseTestCase.php index 0d7da515a..76785e7c0 100644 --- a/tests/Spain/Asturias/AsturiasBaseTestCase.php +++ b/tests/Spain/Asturias/AsturiasBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Asturias/AsturiasDayTest.php b/tests/Spain/Asturias/AsturiasDayTest.php index 60740befd..2884efd7f 100644 --- a/tests/Spain/Asturias/AsturiasDayTest.php +++ b/tests/Spain/Asturias/AsturiasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Asturias; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class AsturiasDayTest extends AsturiasBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Asturias/AsturiasTest.php b/tests/Spain/Asturias/AsturiasTest.php index 4606589e3..a71539212 100644 --- a/tests/Spain/Asturias/AsturiasTest.php +++ b/tests/Spain/Asturias/AsturiasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Asturias; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class AsturiasTest extends AsturiasBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Asturias (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Asturias are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Asturias are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Asturias are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Asturias are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/BalearicIslands/BalearicIslandsBaseTestCase.php b/tests/Spain/BalearicIslands/BalearicIslandsBaseTestCase.php index 18ec00407..ba1ca0cad 100644 --- a/tests/Spain/BalearicIslands/BalearicIslandsBaseTestCase.php +++ b/tests/Spain/BalearicIslands/BalearicIslandsBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php b/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php index 089a8c38c..cdad08b5a 100644 --- a/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php +++ b/tests/Spain/BalearicIslands/BalearicIslandsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\BalearicIslands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class BalearicIslandsDayTest extends BalearicIslandsBaseTestCase implements Holi /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/BalearicIslands/BalearicIslandsTest.php b/tests/Spain/BalearicIslands/BalearicIslandsTest.php index 287740337..a3a7fb9fd 100644 --- a/tests/Spain/BalearicIslands/BalearicIslandsTest.php +++ b/tests/Spain/BalearicIslands/BalearicIslandsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\BalearicIslands; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BalearicIslandsTest extends BalearicIslandsBaseTestCase implements Provide /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the Balearic Islands (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -65,8 +64,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Balearic Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -81,8 +78,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Balearic Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -91,8 +86,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Balearic Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -101,8 +94,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Balearic Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -110,7 +101,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/BasqueCountry/BasqueCountryBaseTestCase.php b/tests/Spain/BasqueCountry/BasqueCountryBaseTestCase.php index 84a079785..69e41d979 100644 --- a/tests/Spain/BasqueCountry/BasqueCountryBaseTestCase.php +++ b/tests/Spain/BasqueCountry/BasqueCountryBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/BasqueCountry/BasqueCountryDayTest.php b/tests/Spain/BasqueCountry/BasqueCountryDayTest.php index d01fac12b..d97c4f539 100644 --- a/tests/Spain/BasqueCountry/BasqueCountryDayTest.php +++ b/tests/Spain/BasqueCountry/BasqueCountryDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\BasqueCountry; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class BasqueCountryDayTest extends BasqueCountryBaseTestCase implements HolidayT /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -54,14 +49,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -75,7 +70,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the holiday defined in this test after abolishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayDayAfterAbolishment(): void { @@ -85,7 +80,7 @@ public function testHolidayDayAfterAbolishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -100,7 +95,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/BasqueCountry/BasqueCountryTest.php b/tests/Spain/BasqueCountry/BasqueCountryTest.php index 190999d8f..d66240c4f 100644 --- a/tests/Spain/BasqueCountry/BasqueCountryTest.php +++ b/tests/Spain/BasqueCountry/BasqueCountryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\BasqueCountry; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class BasqueCountryTest extends BasqueCountryBaseTestCase implements ProviderTes /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Basque Country (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Basque Country are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Basque Country are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Basque Country are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Basque Country are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/CanaryIslands/CanaryIslandsBaseTestCase.php b/tests/Spain/CanaryIslands/CanaryIslandsBaseTestCase.php index 71698ffc1..b52109595 100644 --- a/tests/Spain/CanaryIslands/CanaryIslandsBaseTestCase.php +++ b/tests/Spain/CanaryIslands/CanaryIslandsBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php b/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php index 25b690ed5..a0696f52f 100644 --- a/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php +++ b/tests/Spain/CanaryIslands/CanaryIslandsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\CanaryIslands; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CanaryIslandsDayTest extends CanaryIslandsBaseTestCase implements HolidayT /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/CanaryIslands/CanaryIslandsTest.php b/tests/Spain/CanaryIslands/CanaryIslandsTest.php index 330a2abd9..ff7b3cf59 100644 --- a/tests/Spain/CanaryIslands/CanaryIslandsTest.php +++ b/tests/Spain/CanaryIslands/CanaryIslandsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\CanaryIslands; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CanaryIslandsTest extends CanaryIslandsBaseTestCase implements ProviderTes /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the Canary Islands (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Canary Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Canary Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Canary Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Canary Islands are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Cantabria/CantabriaBaseTestCase.php b/tests/Spain/Cantabria/CantabriaBaseTestCase.php index d20533c21..32fe531df 100644 --- a/tests/Spain/Cantabria/CantabriaBaseTestCase.php +++ b/tests/Spain/Cantabria/CantabriaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Cantabria/CantabriaDayTest.php b/tests/Spain/Cantabria/CantabriaDayTest.php index 7d42068a7..a7309cbff 100644 --- a/tests/Spain/Cantabria/CantabriaDayTest.php +++ b/tests/Spain/Cantabria/CantabriaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Cantabria; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CantabriaDayTest extends CantabriaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("second sunday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("second sunday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Cantabria/CantabriaTest.php b/tests/Spain/Cantabria/CantabriaTest.php index 3a4068286..4df883a54 100644 --- a/tests/Spain/Cantabria/CantabriaTest.php +++ b/tests/Spain/Cantabria/CantabriaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Cantabria; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CantabriaTest extends CantabriaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Cantabria (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Cantabria are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Cantabria are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Cantabria are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Cantabria are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/CastileAndLeon/CastileAndLeonBaseTestCase.php b/tests/Spain/CastileAndLeon/CastileAndLeonBaseTestCase.php index 907409945..9adfd5d63 100644 --- a/tests/Spain/CastileAndLeon/CastileAndLeonBaseTestCase.php +++ b/tests/Spain/CastileAndLeon/CastileAndLeonBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php b/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php index 1896c1fbb..b4e6e22d2 100644 --- a/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php +++ b/tests/Spain/CastileAndLeon/CastileAndLeonDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\CastileAndLeon; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CastileAndLeonDayTest extends CastileAndLeonBaseTestCase implements Holida /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/CastileAndLeon/CastileAndLeonTest.php b/tests/Spain/CastileAndLeon/CastileAndLeonTest.php index 674b1ac96..392ac1371 100644 --- a/tests/Spain/CastileAndLeon/CastileAndLeonTest.php +++ b/tests/Spain/CastileAndLeon/CastileAndLeonTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\CastileAndLeon; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CastileAndLeonTest extends CastileAndLeonBaseTestCase implements ProviderT /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Castile And Leon (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Castile And Leon are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Castile And Leon are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Castile And Leon are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Castile And Leon are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/CastillaLaMancha/CastillaLaManchaBaseTestCase.php b/tests/Spain/CastillaLaMancha/CastillaLaManchaBaseTestCase.php index 9127cc791..88d530436 100644 --- a/tests/Spain/CastillaLaMancha/CastillaLaManchaBaseTestCase.php +++ b/tests/Spain/CastillaLaMancha/CastillaLaManchaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php b/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php index c6a562083..c284097c3 100644 --- a/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php +++ b/tests/Spain/CastillaLaMancha/CastillaLaManchaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\CastillaLaMancha; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class CastillaLaManchaDayTest extends CastillaLaManchaBaseTestCase implements Ho /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-31", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-31", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/CastillaLaMancha/CastillaLaManchaTest.php b/tests/Spain/CastillaLaMancha/CastillaLaManchaTest.php index 252494046..2035edc40 100644 --- a/tests/Spain/CastillaLaMancha/CastillaLaManchaTest.php +++ b/tests/Spain/CastillaLaMancha/CastillaLaManchaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\CastillaLaMancha; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CastillaLaManchaTest extends CastillaLaManchaBaseTestCase implements Provi /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Castilla-La Mancha (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Castilla-La Mancha are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Castilla-La Mancha are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Castilla-La Mancha are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Castilla-La Mancha are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Catalonia/CataloniaBaseTestCase.php b/tests/Spain/Catalonia/CataloniaBaseTestCase.php index 231ea5465..cba4daba4 100644 --- a/tests/Spain/Catalonia/CataloniaBaseTestCase.php +++ b/tests/Spain/Catalonia/CataloniaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Catalonia/CataloniaTest.php b/tests/Spain/Catalonia/CataloniaTest.php index 0f3f0c49f..721133f00 100644 --- a/tests/Spain/Catalonia/CataloniaTest.php +++ b/tests/Spain/Catalonia/CataloniaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Catalonia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CataloniaTest extends CataloniaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Catalonia (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Catalonia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -75,8 +72,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Catalonia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -85,8 +80,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Catalonia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -95,8 +88,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Catalonia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -104,7 +95,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Catalonia/nationalCataloniaDayTest.php b/tests/Spain/Catalonia/nationalCataloniaDayTest.php index 8f11b7807..ed0c996fe 100644 --- a/tests/Spain/Catalonia/nationalCataloniaDayTest.php +++ b/tests/Spain/Catalonia/nationalCataloniaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Catalonia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class nationalCataloniaDayTest extends CataloniaBaseTestCase implements HolidayT /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -88,7 +83,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Catalonia/stJohnsDayTest.php b/tests/Spain/Catalonia/stJohnsDayTest.php index cb5aebbc3..e5ee8b53e 100644 --- a/tests/Spain/Catalonia/stJohnsDayTest.php +++ b/tests/Spain/Catalonia/stJohnsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain\Catalonia; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class stJohnsDayTest extends CataloniaBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Ceuta/CeutaBaseTestCase.php b/tests/Spain/Ceuta/CeutaBaseTestCase.php index 08c76e107..8c5fd82c4 100644 --- a/tests/Spain/Ceuta/CeutaBaseTestCase.php +++ b/tests/Spain/Ceuta/CeutaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Ceuta/CeutaTest.php b/tests/Spain/Ceuta/CeutaTest.php index babeb778b..1d3326025 100644 --- a/tests/Spain/Ceuta/CeutaTest.php +++ b/tests/Spain/Ceuta/CeutaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Ceuta; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CeutaTest extends CeutaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Ceuta (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Ceuta are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Ceuta are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Ceuta are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Ceuta are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Ceuta/ceutaDayTest.php b/tests/Spain/Ceuta/ceutaDayTest.php index aca7596e9..64a32e4d4 100644 --- a/tests/Spain/Ceuta/ceutaDayTest.php +++ b/tests/Spain/Ceuta/ceutaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Ceuta; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ceutaDayTest extends CeutaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/ChristmasTest.php b/tests/Spain/ChristmasTest.php index a9a4fa352..d54714187 100644 --- a/tests/Spain/ChristmasTest.php +++ b/tests/Spain/ChristmasTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/CommunityOfMadrid/CommunityOfMadridBaseTestCase.php b/tests/Spain/CommunityOfMadrid/CommunityOfMadridBaseTestCase.php index 081a4d861..8d6b55559 100644 --- a/tests/Spain/CommunityOfMadrid/CommunityOfMadridBaseTestCase.php +++ b/tests/Spain/CommunityOfMadrid/CommunityOfMadridBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/CommunityOfMadrid/CommunityOfMadridTest.php b/tests/Spain/CommunityOfMadrid/CommunityOfMadridTest.php index 49f5f17f9..caa373640 100644 --- a/tests/Spain/CommunityOfMadrid/CommunityOfMadridTest.php +++ b/tests/Spain/CommunityOfMadrid/CommunityOfMadridTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\CommunityOfMadrid; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class CommunityOfMadridTest extends CommunityOfMadridBaseTestCase implements Pro /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the Community of Madrid (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Community of Madrid are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -75,8 +72,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Community of Madrid are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -85,8 +80,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Community of Madrid are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -95,8 +88,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Community of Madrid are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -104,7 +95,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php b/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php index 278ecea4d..2f482d9ca 100644 --- a/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php +++ b/tests/Spain/CommunityOfMadrid/DosdeMayoUprisingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\CommunityOfMadrid; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class DosdeMayoUprisingDayTest extends CommunityOfMadridBaseTestCase implements /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/ConstitutionDayTest.php b/tests/Spain/ConstitutionDayTest.php index 2ce558f0a..c7d276124 100644 --- a/tests/Spain/ConstitutionDayTest.php +++ b/tests/Spain/ConstitutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ConstitutionDayTest extends SpainBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/EasterMondayTest.php b/tests/Spain/EasterMondayTest.php index 4a7f65bcc..f739fec34 100644 --- a/tests/Spain/EasterMondayTest.php +++ b/tests/Spain/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class EasterMondayTest extends SpainBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,14 +45,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -72,7 +67,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/EpiphanyTest.php b/tests/Spain/EpiphanyTest.php index 6cfa13d7a..b1185649c 100644 --- a/tests/Spain/EpiphanyTest.php +++ b/tests/Spain/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Extremadura/ExtremaduraBaseTestCase.php b/tests/Spain/Extremadura/ExtremaduraBaseTestCase.php index 865a11900..04e485984 100644 --- a/tests/Spain/Extremadura/ExtremaduraBaseTestCase.php +++ b/tests/Spain/Extremadura/ExtremaduraBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Extremadura/ExtremaduraDayTest.php b/tests/Spain/Extremadura/ExtremaduraDayTest.php index 3a44bee42..002d11d69 100644 --- a/tests/Spain/Extremadura/ExtremaduraDayTest.php +++ b/tests/Spain/Extremadura/ExtremaduraDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Extremadura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ExtremaduraDayTest extends ExtremaduraBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-9-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-9-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Extremadura/ExtremaduraTest.php b/tests/Spain/Extremadura/ExtremaduraTest.php index 888b9f27f..e153a1738 100644 --- a/tests/Spain/Extremadura/ExtremaduraTest.php +++ b/tests/Spain/Extremadura/ExtremaduraTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Extremadura; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ExtremaduraTest extends ExtremaduraBaseTestCase implements ProviderTestCas /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Extremadura (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Extremadura are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Extremadura are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Extremadura are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Extremadura are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Galicia/GaliciaBaseTestCase.php b/tests/Spain/Galicia/GaliciaBaseTestCase.php index 7791afa8e..dd2e34988 100644 --- a/tests/Spain/Galicia/GaliciaBaseTestCase.php +++ b/tests/Spain/Galicia/GaliciaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Galicia/GaliciaTest.php b/tests/Spain/Galicia/GaliciaTest.php index 4bdc29dca..148f06130 100644 --- a/tests/Spain/Galicia/GaliciaTest.php +++ b/tests/Spain/Galicia/GaliciaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Galicia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class GaliciaTest extends GaliciaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Galicia (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -61,8 +60,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Galicia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -75,8 +72,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Galicia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -85,8 +80,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Galicia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -95,8 +88,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Galicia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -104,7 +95,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/Galicia/GalicianLiteratureDayTest.php b/tests/Spain/Galicia/GalicianLiteratureDayTest.php index 1ccac9795..c1dd4e6f2 100644 --- a/tests/Spain/Galicia/GalicianLiteratureDayTest.php +++ b/tests/Spain/Galicia/GalicianLiteratureDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Galicia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class GalicianLiteratureDayTest extends GaliciaBaseTestCase implements HolidayTe /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Galicia/stJamesDayTest.php b/tests/Spain/Galicia/stJamesDayTest.php index 548096095..be86c1622 100644 --- a/tests/Spain/Galicia/stJamesDayTest.php +++ b/tests/Spain/Galicia/stJamesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\Galicia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class stJamesDayTest extends GaliciaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/GoodFridayTest.php b/tests/Spain/GoodFridayTest.php index 574af79f2..40b47df5e 100644 --- a/tests/Spain/GoodFridayTest.php +++ b/tests/Spain/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends SpainBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/ImmaculateConceptionTest.php b/tests/Spain/ImmaculateConceptionTest.php index b6b4adba5..732a596a9 100644 --- a/tests/Spain/ImmaculateConceptionTest.php +++ b/tests/Spain/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends SpainBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/InternationalWorkersDayTest.php b/tests/Spain/InternationalWorkersDayTest.php index 55e59c6b3..f0c9f247c 100644 --- a/tests/Spain/InternationalWorkersDayTest.php +++ b/tests/Spain/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends SpainBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/LaRioja/LaRiojaBaseTestCase.php b/tests/Spain/LaRioja/LaRiojaBaseTestCase.php index ecc586f2a..acd40e799 100644 --- a/tests/Spain/LaRioja/LaRiojaBaseTestCase.php +++ b/tests/Spain/LaRioja/LaRiojaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/LaRioja/LaRiojaDayTest.php b/tests/Spain/LaRioja/LaRiojaDayTest.php index 12fb2e81e..d5ef41805 100644 --- a/tests/Spain/LaRioja/LaRiojaDayTest.php +++ b/tests/Spain/LaRioja/LaRiojaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\LaRioja; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LaRiojaDayTest extends LaRiojaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/LaRioja/LaRiojaTest.php b/tests/Spain/LaRioja/LaRiojaTest.php index 34b39bf60..12752d25c 100644 --- a/tests/Spain/LaRioja/LaRiojaTest.php +++ b/tests/Spain/LaRioja/LaRiojaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\LaRioja; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class LaRiojaTest extends LaRiojaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in La Rioja (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in La Rioja are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in La Rioja are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in La Rioja are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in La Rioja are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/MaundyThursdayTest.php b/tests/Spain/MaundyThursdayTest.php index ae1697191..73bc3c4fb 100644 --- a/tests/Spain/MaundyThursdayTest.php +++ b/tests/Spain/MaundyThursdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class MaundyThursdayTest extends SpainBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -50,14 +45,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-7", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-7", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -72,7 +67,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Melilla/MelillaBaseTestCase.php b/tests/Spain/Melilla/MelillaBaseTestCase.php index 94348091c..7d96fe762 100644 --- a/tests/Spain/Melilla/MelillaBaseTestCase.php +++ b/tests/Spain/Melilla/MelillaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Melilla/MelillaTest.php b/tests/Spain/Melilla/MelillaTest.php index 150e3e05c..20667d5c9 100644 --- a/tests/Spain/Melilla/MelillaTest.php +++ b/tests/Spain/Melilla/MelillaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Melilla; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class MelillaTest extends MelillaBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Melilla (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Melilla are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -73,8 +70,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Melilla are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -83,8 +78,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Melilla are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -93,8 +86,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Melilla are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -102,7 +93,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/NationalDayTest.php b/tests/Spain/NationalDayTest.php index 2863ea09f..e2afa10bc 100644 --- a/tests/Spain/NationalDayTest.php +++ b/tests/Spain/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NationalDayTest extends SpainBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/Navarre/NavarreBaseTestCase.php b/tests/Spain/Navarre/NavarreBaseTestCase.php index 078659a1b..3beaa6cb7 100644 --- a/tests/Spain/Navarre/NavarreBaseTestCase.php +++ b/tests/Spain/Navarre/NavarreBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/Navarre/NavarreTest.php b/tests/Spain/Navarre/NavarreTest.php index 81225c9f3..926276937 100644 --- a/tests/Spain/Navarre/NavarreTest.php +++ b/tests/Spain/Navarre/NavarreTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\Navarre; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class NavarreTest extends NavarreBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Navarre (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Navarre are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Navarre are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Navarre are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Navarre are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/NewYearsDayTest.php b/tests/Spain/NewYearsDayTest.php index 8ca78398c..811c09093 100644 --- a/tests/Spain/NewYearsDayTest.php +++ b/tests/Spain/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/RegionOfMurcia/RegionOfMurciaBaseTestCase.php b/tests/Spain/RegionOfMurcia/RegionOfMurciaBaseTestCase.php index 4723766b7..7d1459e89 100644 --- a/tests/Spain/RegionOfMurcia/RegionOfMurciaBaseTestCase.php +++ b/tests/Spain/RegionOfMurcia/RegionOfMurciaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php b/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php index 351626ad7..e58a6f389 100644 --- a/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php +++ b/tests/Spain/RegionOfMurcia/RegionOfMurciaDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\RegionOfMurcia; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class RegionOfMurciaDayTest extends RegionOfMurciaBaseTestCase implements Holida /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/RegionOfMurcia/RegionOfMurciaTest.php b/tests/Spain/RegionOfMurcia/RegionOfMurciaTest.php index a7989d3f3..fad560d3f 100644 --- a/tests/Spain/RegionOfMurcia/RegionOfMurciaTest.php +++ b/tests/Spain/RegionOfMurcia/RegionOfMurciaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\RegionOfMurcia; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class RegionOfMurciaTest extends RegionOfMurciaBaseTestCase implements ProviderT /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the Region of Murcia (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Region of Murcia are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Region of Murcia are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Region of Murcia are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Region of Murcia are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/SpainBaseTestCase.php b/tests/Spain/SpainBaseTestCase.php index 68a6717b9..a97e3aa74 100644 --- a/tests/Spain/SpainBaseTestCase.php +++ b/tests/Spain/SpainBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/SpainTest.php b/tests/Spain/SpainTest.php index 829b84c54..38b19850c 100644 --- a/tests/Spain/SpainTest.php +++ b/tests/Spain/SpainTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SpainTest extends SpainBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Spain are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -59,8 +58,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Spain are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -69,8 +66,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Spain are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -79,8 +74,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Spain are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -89,8 +82,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Spain are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -98,7 +89,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/ValencianCommunity/ValencianCommunityBaseTestCase.php b/tests/Spain/ValencianCommunity/ValencianCommunityBaseTestCase.php index da8823da2..4c619e67a 100644 --- a/tests/Spain/ValencianCommunity/ValencianCommunityBaseTestCase.php +++ b/tests/Spain/ValencianCommunity/ValencianCommunityBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php b/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php index 5f19ccbda..40fa2f267 100644 --- a/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php +++ b/tests/Spain/ValencianCommunity/ValencianCommunityDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Spain\ValencianCommunity; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class ValencianCommunityDayTest extends ValencianCommunityBaseTestCase implement /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-9", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-9", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/ValencianCommunity/ValencianCommunityTest.php b/tests/Spain/ValencianCommunity/ValencianCommunityTest.php index 732deea27..4fcbc864c 100644 --- a/tests/Spain/ValencianCommunity/ValencianCommunityTest.php +++ b/tests/Spain/ValencianCommunity/ValencianCommunityTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Spain\ValencianCommunity; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class ValencianCommunityTest extends ValencianCommunityBaseTestCase implements P /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the Valencian Community (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -60,8 +59,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the Valencian Community are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -74,8 +71,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the Valencian Community are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -84,8 +79,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the Valencian Community are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -94,8 +87,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the Valencian Community are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -103,7 +94,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Spain/ValentinesDayTest.php b/tests/Spain/ValentinesDayTest.php index 0be0aadf7..552d5a139 100644 --- a/tests/Spain/ValentinesDayTest.php +++ b/tests/Spain/ValentinesDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ValentinesDayTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Spain/stJosephsDayTest.php b/tests/Spain/stJosephsDayTest.php index 7163ead9a..285c3d369 100644 --- a/tests/Spain/stJosephsDayTest.php +++ b/tests/Spain/stJosephsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Spain; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,12 +38,10 @@ class stJosephsDayTest extends SpainBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -54,9 +49,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -66,7 +61,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -81,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/AllSaintsDayTest.php b/tests/Sweden/AllSaintsDayTest.php index bd0b51367..353e49133 100644 --- a/tests/Sweden/AllSaintsDayTest.php +++ b/tests/Sweden/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -37,12 +32,10 @@ class AllSaintsDayTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -50,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +53,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-10-31", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-10-31", new \DateTimeZone(self::TIMEZONE)); // Check between 31 October and 6th of November the day that is a Saturday for ($d = 0; $d <= 7; ++$d) { @@ -68,7 +61,7 @@ public function HolidayDataProvider(): array $data[] = [$year, $date]; break; } - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } } @@ -78,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/AllSaintsEveTest.php b/tests/Sweden/AllSaintsEveTest.php index 3d6898487..f5d8e7659 100644 --- a/tests/Sweden/AllSaintsEveTest.php +++ b/tests/Sweden/AllSaintsEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -37,12 +32,10 @@ class AllSaintsEveTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -50,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +53,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-10-30", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-10-30", new \DateTimeZone(self::TIMEZONE)); // Check between 30 October and 5th of November the day that is a Friday for ($d = 0; $d <= 7; ++$d) { @@ -68,7 +61,7 @@ public function HolidayDataProvider(): array $data[] = [$year, $date]; break; } - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); } } @@ -78,7 +71,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +86,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/AscensionDayTest.php b/tests/Sweden/AscensionDayTest.php index 646d56268..faa80f933 100644 --- a/tests/Sweden/AscensionDayTest.php +++ b/tests/Sweden/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/ChristmasDayTest.php b/tests/Sweden/ChristmasDayTest.php index 5e7afd40d..7fd387761 100644 --- a/tests/Sweden/ChristmasDayTest.php +++ b/tests/Sweden/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/ChristmasEveTest.php b/tests/Sweden/ChristmasEveTest.php index 1f7ebadec..50be14c53 100644 --- a/tests/Sweden/ChristmasEveTest.php +++ b/tests/Sweden/ChristmasEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasEveTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/EasterMondayTest.php b/tests/Sweden/EasterMondayTest.php index cd7965f4b..2cf1353ac 100644 --- a/tests/Sweden/EasterMondayTest.php +++ b/tests/Sweden/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-8", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-8", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/EasterTest.php b/tests/Sweden/EasterTest.php index 4da370867..cbdd5ed1c 100644 --- a/tests/Sweden/EasterTest.php +++ b/tests/Sweden/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/EpiphanyEveTest.php b/tests/Sweden/EpiphanyEveTest.php index 9bbd5b621..456000a5a 100644 --- a/tests/Sweden/EpiphanyEveTest.php +++ b/tests/Sweden/EpiphanyEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyEveTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/EpiphanyTest.php b/tests/Sweden/EpiphanyTest.php index e954a5ed4..d40061dd0 100644 --- a/tests/Sweden/EpiphanyTest.php +++ b/tests/Sweden/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/GoodFridayTest.php b/tests/Sweden/GoodFridayTest.php index 3c1fb2e77..81d944796 100644 --- a/tests/Sweden/GoodFridayTest.php +++ b/tests/Sweden/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/InternationalWorkersDayTest.php b/tests/Sweden/InternationalWorkersDayTest.php index 7bc19dbef..1cf9a95a3 100644 --- a/tests/Sweden/InternationalWorkersDayTest.php +++ b/tests/Sweden/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends SwedenBaseTestCase implements HolidayT * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Sweden/NationalDayTest.php b/tests/Sweden/NationalDayTest.php index 80ad69072..49fe60d41 100644 --- a/tests/Sweden/NationalDayTest.php +++ b/tests/Sweden/NationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class NationalDayTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test on or after establishment. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void { @@ -49,14 +44,14 @@ public function testHolidayOnAfterEstablishment(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-6", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-6", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test on or after establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -100,7 +95,7 @@ public function testHolidayType(): void /** * Tests the translated name of the holiday defined in this test on or after establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslationOnAfterNameChange(): void { diff --git a/tests/Sweden/NewYearsDayTest.php b/tests/Sweden/NewYearsDayTest.php index 56543b568..814a73386 100644 --- a/tests/Sweden/NewYearsDayTest.php +++ b/tests/Sweden/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/NewYearsEveTest.php b/tests/Sweden/NewYearsEveTest.php index 694051a31..f985f5466 100644 --- a/tests/Sweden/NewYearsEveTest.php +++ b/tests/Sweden/NewYearsEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsEveTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/PentecostTest.php b/tests/Sweden/PentecostTest.php index 586badd4e..fe45f5a9a 100644 --- a/tests/Sweden/PentecostTest.php +++ b/tests/Sweden/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-05-17", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-05-17", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/SecondChristmasDayTest.php b/tests/Sweden/SecondChristmasDayTest.php index 9ca638d9f..34fdf297a 100644 --- a/tests/Sweden/SecondChristmasDayTest.php +++ b/tests/Sweden/SecondChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class SecondChristmasDayTest extends SwedenBaseTestCase implements HolidayTestCa * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/StJohnsDayTest.php b/tests/Sweden/StJohnsDayTest.php index 4890117ba..b0ad9292b 100644 --- a/tests/Sweden/StJohnsDayTest.php +++ b/tests/Sweden/StJohnsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Sweden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -32,7 +31,7 @@ class StJohnsDayTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -56,7 +55,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -71,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/StJohnsEveTest.php b/tests/Sweden/StJohnsEveTest.php index 05dcac7bf..dd4e3f8bb 100644 --- a/tests/Sweden/StJohnsEveTest.php +++ b/tests/Sweden/StJohnsEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Sweden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -32,7 +31,7 @@ class StJohnsEveTest extends SwedenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -56,7 +55,7 @@ public function testHoliday(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -71,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Sweden/SwedenBaseTestCase.php b/tests/Sweden/SwedenBaseTestCase.php index c5d2adafb..022178ce2 100644 --- a/tests/Sweden/SwedenBaseTestCase.php +++ b/tests/Sweden/SwedenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Sweden/SwedenTest.php b/tests/Sweden/SwedenTest.php index 111cd0755..35fb9659a 100644 --- a/tests/Sweden/SwedenTest.php +++ b/tests/Sweden/SwedenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Sweden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class SwedenTest extends SwedenBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Sweden (Spain) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -62,8 +61,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Sweden are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -79,8 +76,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Sweden are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -89,8 +84,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Sweden are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -99,8 +92,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Sweden are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -108,7 +99,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Sweden/WalpurgisEveTest.php b/tests/Sweden/WalpurgisEveTest.php index 0d933f6a3..6f04a80b4 100644 --- a/tests/Sweden/WalpurgisEveTest.php +++ b/tests/Sweden/WalpurgisEveTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Sweden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class WalpurgisEveTest extends SwedenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Aargau/AargauBaseTestCase.php b/tests/Switzerland/Aargau/AargauBaseTestCase.php index 3edcb3a7b..521505c56 100644 --- a/tests/Switzerland/Aargau/AargauBaseTestCase.php +++ b/tests/Switzerland/Aargau/AargauBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Aargau/AargauTest.php b/tests/Switzerland/Aargau/AargauTest.php index 1897542c2..22215d914 100644 --- a/tests/Switzerland/Aargau/AargauTest.php +++ b/tests/Switzerland/Aargau/AargauTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Aargau; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class AargauTest extends AargauBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all official holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -67,8 +64,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -82,8 +77,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -92,8 +85,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -102,8 +93,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Aargau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -111,7 +100,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Aargau/AscensionDayTest.php b/tests/Switzerland/Aargau/AscensionDayTest.php index 6955ce258..430d322bd 100644 --- a/tests/Switzerland/Aargau/AscensionDayTest.php +++ b/tests/Switzerland/Aargau/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Aargau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends AargauBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Aargau/ChristmasDayTest.php b/tests/Switzerland/Aargau/ChristmasDayTest.php index 9086eb552..ef2118a66 100644 --- a/tests/Switzerland/Aargau/ChristmasDayTest.php +++ b/tests/Switzerland/Aargau/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Aargau; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends AargauBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Aargau/GoodFridayTest.php b/tests/Switzerland/Aargau/GoodFridayTest.php index d5b8881f4..ea560bc28 100644 --- a/tests/Switzerland/Aargau/GoodFridayTest.php +++ b/tests/Switzerland/Aargau/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Aargau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends AargauBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Aargau/NewYearsDayTest.php b/tests/Switzerland/Aargau/NewYearsDayTest.php index 07e665c31..e50150567 100644 --- a/tests/Switzerland/Aargau/NewYearsDayTest.php +++ b/tests/Switzerland/Aargau/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Aargau; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends AargauBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenBaseTestCase.php b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenBaseTestCase.php index 280a5ea75..548417510 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenBaseTestCase.php +++ b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php index aebf1ead1..a1d4d95c3 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/AppenzellAusserrhodenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class AppenzellAusserrhodenTest extends AppenzellAusserrhodenBaseTestCase implem /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -70,8 +67,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -85,8 +80,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -95,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -105,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Appenzell Ausserrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -114,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php index 5e072aa6d..7b81dc602 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends AppenzellAusserrhodenBaseTestCase implements Holi /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php index a80ea3def..19b019b48 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends AppenzellAusserrhodenBaseTestCase implements Holi * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php b/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php index eff613788..855595581 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends AppenzellAusserrhodenBaseTestCase implements Holi /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php b/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php index 1c5d4ba2e..5d006a2c3 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends AppenzellAusserrhodenBaseTestCase implements Holida /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php index f345a9857..4558d88d0 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends AppenzellAusserrhodenBaseTestCase implements Holid * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php b/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php index 46805ccdc..233e8e10d 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends AppenzellAusserrhodenBaseTestCase implements H /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php b/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php index a28a571c2..15cf87781 100644 --- a/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php +++ b/tests/Switzerland/AppenzellAusserrhoden/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellAusserrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends AppenzellAusserrhodenBaseTestCase implements Hol * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php index f1f1ada74..91e95cda7 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends AppenzellInnerrhodenBaseTestCase implements Holid * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenBaseTestCase.php b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenBaseTestCase.php index ec46743fd..a4556e98d 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenBaseTestCase.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php index d45a9379e..a9bbf1680 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AppenzellInnerrhodenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class AppenzellInnerrhodenTest extends AppenzellInnerrhodenBaseTestCase implemen /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -74,8 +71,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -89,8 +84,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -99,8 +92,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -109,8 +100,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Appenzell Innerrhoden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -118,7 +107,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php index 3ea14f4e2..6a01df636 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends AppenzellInnerrhodenBaseTestCase implements Holid /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php b/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php index be67a54a7..6112878a5 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends AppenzellInnerrhodenBaseTestCase implements H * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php index a72fbd8c2..331f4295f 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends AppenzellInnerrhodenBaseTestCase implements Holid * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php b/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php index 3fe9d4a77..958680033 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends AppenzellInnerrhodenBaseTestCase implements Holi /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php b/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php index 6718592f6..708fb6fed 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends AppenzellInnerrhodenBaseTestCase implements Holid /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php b/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php index 387a3f389..0ae0c2f89 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends AppenzellInnerrhodenBaseTestCase implements Holiday /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php b/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php index 798b701b4..53186e9d9 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends AppenzellInnerrhodenBaseTestCase implemen * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php index 53b4ef57d..00d2411aa 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends AppenzellInnerrhodenBaseTestCase implements Holida * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php b/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php index e086d9df4..904d259c5 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends AppenzellInnerrhodenBaseTestCase implements Ho /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php b/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php index 2f146ef9b..900dd24be 100644 --- a/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php +++ b/tests/Switzerland/AppenzellInnerrhoden/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\AppenzellInnerrhoden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends AppenzellInnerrhodenBaseTestCase implements Holi * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/AscensionDayTest.php b/tests/Switzerland/BaselLandschaft/AscensionDayTest.php index 6c663465a..195197384 100644 --- a/tests/Switzerland/BaselLandschaft/AscensionDayTest.php +++ b/tests/Switzerland/BaselLandschaft/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends BaselLandschaftBaseTestCase implements HolidayTes /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/BaselLandschaftBaseTestCase.php b/tests/Switzerland/BaselLandschaft/BaselLandschaftBaseTestCase.php index 221c37a54..9be60d505 100644 --- a/tests/Switzerland/BaselLandschaft/BaselLandschaftBaseTestCase.php +++ b/tests/Switzerland/BaselLandschaft/BaselLandschaftBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php b/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php index ed0c82d01..ac8b436a2 100644 --- a/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php +++ b/tests/Switzerland/BaselLandschaft/BaselLandschaftTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class BaselLandschaftTest extends BaselLandschaftBaseTestCase implements Provide /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in BaselLandschaft (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php b/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php index 1ca1c772c..9ad46a5a2 100644 --- a/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php +++ b/tests/Switzerland/BaselLandschaft/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends BaselLandschaftBaseTestCase implements HolidayTes * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/EasterMondayTest.php b/tests/Switzerland/BaselLandschaft/EasterMondayTest.php index 3e239c195..a7817a39a 100644 --- a/tests/Switzerland/BaselLandschaft/EasterMondayTest.php +++ b/tests/Switzerland/BaselLandschaft/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends BaselLandschaftBaseTestCase implements HolidayTes /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/GoodFridayTest.php b/tests/Switzerland/BaselLandschaft/GoodFridayTest.php index 29c777812..edb61f133 100644 --- a/tests/Switzerland/BaselLandschaft/GoodFridayTest.php +++ b/tests/Switzerland/BaselLandschaft/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends BaselLandschaftBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php b/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php index 0640d6789..18ebb3aff 100644 --- a/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php +++ b/tests/Switzerland/BaselLandschaft/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends BaselLandschaftBaseTestCase implements HolidayTest * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php b/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php index b23b41756..7cd52a63b 100644 --- a/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php +++ b/tests/Switzerland/BaselLandschaft/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends BaselLandschaftBaseTestCase implements Holiday /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/StStephensDayTest.php b/tests/Switzerland/BaselLandschaft/StStephensDayTest.php index c74e6f0b1..0276c23f2 100644 --- a/tests/Switzerland/BaselLandschaft/StStephensDayTest.php +++ b/tests/Switzerland/BaselLandschaft/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends BaselLandschaftBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselLandschaft/WorkersDayTest.php b/tests/Switzerland/BaselLandschaft/WorkersDayTest.php index 4f2d48978..be14b01f1 100644 --- a/tests/Switzerland/BaselLandschaft/WorkersDayTest.php +++ b/tests/Switzerland/BaselLandschaft/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselLandschaft; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends BaselLandschaftBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/AscensionDayTest.php b/tests/Switzerland/BaselStadt/AscensionDayTest.php index 9bb6d03e3..162caf83c 100644 --- a/tests/Switzerland/BaselStadt/AscensionDayTest.php +++ b/tests/Switzerland/BaselStadt/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends BaselStadtBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/BaselStadtBaseTestCase.php b/tests/Switzerland/BaselStadt/BaselStadtBaseTestCase.php index 99fb8e3ee..31fc4ec59 100644 --- a/tests/Switzerland/BaselStadt/BaselStadtBaseTestCase.php +++ b/tests/Switzerland/BaselStadt/BaselStadtBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/BaselStadt/BaselStadtTest.php b/tests/Switzerland/BaselStadt/BaselStadtTest.php index ccaa745e6..48c3866a8 100644 --- a/tests/Switzerland/BaselStadt/BaselStadtTest.php +++ b/tests/Switzerland/BaselStadt/BaselStadtTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class BaselStadtTest extends BaselStadtBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Basel Stadt (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/BaselStadt/ChristmasDayTest.php b/tests/Switzerland/BaselStadt/ChristmasDayTest.php index 9307b4a03..c4fac21ae 100644 --- a/tests/Switzerland/BaselStadt/ChristmasDayTest.php +++ b/tests/Switzerland/BaselStadt/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends BaselStadtBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/EasterMondayTest.php b/tests/Switzerland/BaselStadt/EasterMondayTest.php index 08196decb..f19fe386a 100644 --- a/tests/Switzerland/BaselStadt/EasterMondayTest.php +++ b/tests/Switzerland/BaselStadt/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends BaselStadtBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/GoodFridayTest.php b/tests/Switzerland/BaselStadt/GoodFridayTest.php index effafe53c..8abf3362d 100644 --- a/tests/Switzerland/BaselStadt/GoodFridayTest.php +++ b/tests/Switzerland/BaselStadt/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends BaselStadtBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/NewYearsDayTest.php b/tests/Switzerland/BaselStadt/NewYearsDayTest.php index 936395895..0db010679 100644 --- a/tests/Switzerland/BaselStadt/NewYearsDayTest.php +++ b/tests/Switzerland/BaselStadt/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends BaselStadtBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/BaselStadt/PentecostMondayTest.php b/tests/Switzerland/BaselStadt/PentecostMondayTest.php index b15614b64..0c7c07ac9 100644 --- a/tests/Switzerland/BaselStadt/PentecostMondayTest.php +++ b/tests/Switzerland/BaselStadt/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends BaselStadtBaseTestCase implements HolidayTestC /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/StStephensDayTest.php b/tests/Switzerland/BaselStadt/StStephensDayTest.php index 28d0e94ee..141dbfa6b 100644 --- a/tests/Switzerland/BaselStadt/StStephensDayTest.php +++ b/tests/Switzerland/BaselStadt/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends BaselStadtBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/BaselStadt/WorkersDayTest.php b/tests/Switzerland/BaselStadt/WorkersDayTest.php index 8c784a7e2..e7ee76974 100644 --- a/tests/Switzerland/BaselStadt/WorkersDayTest.php +++ b/tests/Switzerland/BaselStadt/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\BaselStadt; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends BaselStadtBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/AscensionDayTest.php b/tests/Switzerland/Bern/AscensionDayTest.php index a0c120914..5db3dc8ba 100644 --- a/tests/Switzerland/Bern/AscensionDayTest.php +++ b/tests/Switzerland/Bern/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends BernBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/BerchtoldsTagTest.php b/tests/Switzerland/Bern/BerchtoldsTagTest.php index 13663debd..bfc32804a 100644 --- a/tests/Switzerland/Bern/BerchtoldsTagTest.php +++ b/tests/Switzerland/Bern/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends BernBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/BernBaseTestCase.php b/tests/Switzerland/Bern/BernBaseTestCase.php index 4352a8be9..71b7aed8d 100644 --- a/tests/Switzerland/Bern/BernBaseTestCase.php +++ b/tests/Switzerland/Bern/BernBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Bern/BernTest.php b/tests/Switzerland/Bern/BernTest.php index 4ac9b2a0d..afc9085b4 100644 --- a/tests/Switzerland/Bern/BernTest.php +++ b/tests/Switzerland/Bern/BernTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class BernTest extends BernBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Bern (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Bern/ChristmasDayTest.php b/tests/Switzerland/Bern/ChristmasDayTest.php index 70bc40e1b..c3cbbd7ba 100644 --- a/tests/Switzerland/Bern/ChristmasDayTest.php +++ b/tests/Switzerland/Bern/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends BernBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/EasterMondayTest.php b/tests/Switzerland/Bern/EasterMondayTest.php index 191ac1d5f..51021f44a 100644 --- a/tests/Switzerland/Bern/EasterMondayTest.php +++ b/tests/Switzerland/Bern/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends BernBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/GoodFridayTest.php b/tests/Switzerland/Bern/GoodFridayTest.php index 666c512df..f5f9ee4af 100644 --- a/tests/Switzerland/Bern/GoodFridayTest.php +++ b/tests/Switzerland/Bern/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends BernBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/NewYearsDayTest.php b/tests/Switzerland/Bern/NewYearsDayTest.php index 2df10607d..dc4b75010 100644 --- a/tests/Switzerland/Bern/NewYearsDayTest.php +++ b/tests/Switzerland/Bern/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends BernBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Bern/PentecostMondayTest.php b/tests/Switzerland/Bern/PentecostMondayTest.php index 0c537c754..e7c0faf17 100644 --- a/tests/Switzerland/Bern/PentecostMondayTest.php +++ b/tests/Switzerland/Bern/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends BernBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Bern/StStephensDayTest.php b/tests/Switzerland/Bern/StStephensDayTest.php index 3a4b37c53..53170c8fa 100644 --- a/tests/Switzerland/Bern/StStephensDayTest.php +++ b/tests/Switzerland/Bern/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Bern; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends BernBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/AllSaintsDayTest.php b/tests/Switzerland/Fribourg/AllSaintsDayTest.php index 795ab7c05..e5527726b 100644 --- a/tests/Switzerland/Fribourg/AllSaintsDayTest.php +++ b/tests/Switzerland/Fribourg/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends FribourgBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Fribourg/AscensionDayTest.php b/tests/Switzerland/Fribourg/AscensionDayTest.php index 3c409fa35..f11a85d66 100644 --- a/tests/Switzerland/Fribourg/AscensionDayTest.php +++ b/tests/Switzerland/Fribourg/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/AssumptionOfMaryTest.php b/tests/Switzerland/Fribourg/AssumptionOfMaryTest.php index 64e64cc3a..49198ea28 100644 --- a/tests/Switzerland/Fribourg/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Fribourg/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends FribourgBaseTestCase implements HolidayTestCa * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Fribourg/BerchtoldsTagTest.php b/tests/Switzerland/Fribourg/BerchtoldsTagTest.php index 1509d6e66..477bcd460 100644 --- a/tests/Switzerland/Fribourg/BerchtoldsTagTest.php +++ b/tests/Switzerland/Fribourg/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/ChristmasDayTest.php b/tests/Switzerland/Fribourg/ChristmasDayTest.php index 6682a1d04..56b346acb 100644 --- a/tests/Switzerland/Fribourg/ChristmasDayTest.php +++ b/tests/Switzerland/Fribourg/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends FribourgBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/CorpusChristiTest.php b/tests/Switzerland/Fribourg/CorpusChristiTest.php index 0272d7a99..9617299ec 100644 --- a/tests/Switzerland/Fribourg/CorpusChristiTest.php +++ b/tests/Switzerland/Fribourg/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/December26thTest.php b/tests/Switzerland/Fribourg/December26thTest.php index dd923e46a..004ff261b 100644 --- a/tests/Switzerland/Fribourg/December26thTest.php +++ b/tests/Switzerland/Fribourg/December26thTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class December26thTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests December 26th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testDecember26th(): void { @@ -44,14 +39,14 @@ public function testDecember26th(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of December 26th. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/EasterMondayTest.php b/tests/Switzerland/Fribourg/EasterMondayTest.php index 938044500..c57d2acdc 100644 --- a/tests/Switzerland/Fribourg/EasterMondayTest.php +++ b/tests/Switzerland/Fribourg/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/FribourgBaseTestCase.php b/tests/Switzerland/Fribourg/FribourgBaseTestCase.php index 4c0caa7ed..8129e17db 100644 --- a/tests/Switzerland/Fribourg/FribourgBaseTestCase.php +++ b/tests/Switzerland/Fribourg/FribourgBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Fribourg/FribourgTest.php b/tests/Switzerland/Fribourg/FribourgTest.php index f1825b9d6..326247b15 100644 --- a/tests/Switzerland/Fribourg/FribourgTest.php +++ b/tests/Switzerland/Fribourg/FribourgTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class FribourgTest extends FribourgBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -75,8 +72,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -90,8 +85,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -100,8 +93,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -110,8 +101,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Fribourg (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -119,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Fribourg/GoodFridayTest.php b/tests/Switzerland/Fribourg/GoodFridayTest.php index bd68f874b..6d251846b 100644 --- a/tests/Switzerland/Fribourg/GoodFridayTest.php +++ b/tests/Switzerland/Fribourg/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends FribourgBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/ImmaculateConceptionTest.php b/tests/Switzerland/Fribourg/ImmaculateConceptionTest.php index 26f465dc3..94c30cd13 100644 --- a/tests/Switzerland/Fribourg/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Fribourg/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends FribourgBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Fribourg/NewYearsDayTest.php b/tests/Switzerland/Fribourg/NewYearsDayTest.php index 086c31b9f..1a1a309dc 100644 --- a/tests/Switzerland/Fribourg/NewYearsDayTest.php +++ b/tests/Switzerland/Fribourg/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends FribourgBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Fribourg/PentecostMondayTest.php b/tests/Switzerland/Fribourg/PentecostMondayTest.php index ab5abf75e..6ccb25d22 100644 --- a/tests/Switzerland/Fribourg/PentecostMondayTest.php +++ b/tests/Switzerland/Fribourg/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Fribourg; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends FribourgBaseTestCase implements HolidayTestCas /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/AscensionDayTest.php b/tests/Switzerland/Geneva/AscensionDayTest.php index 172b4178e..8210bb5fe 100644 --- a/tests/Switzerland/Geneva/AscensionDayTest.php +++ b/tests/Switzerland/Geneva/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends GenevaBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/ChristmasDayTest.php b/tests/Switzerland/Geneva/ChristmasDayTest.php index 3f30a19d0..85d91d45a 100644 --- a/tests/Switzerland/Geneva/ChristmasDayTest.php +++ b/tests/Switzerland/Geneva/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends GenevaBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/EasterMondayTest.php b/tests/Switzerland/Geneva/EasterMondayTest.php index f4f24f69e..b7f70a36b 100644 --- a/tests/Switzerland/Geneva/EasterMondayTest.php +++ b/tests/Switzerland/Geneva/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends GenevaBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/GenevaBaseTestCase.php b/tests/Switzerland/Geneva/GenevaBaseTestCase.php index c6743b54f..f37ac2da6 100644 --- a/tests/Switzerland/Geneva/GenevaBaseTestCase.php +++ b/tests/Switzerland/Geneva/GenevaBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Geneva/GenevaTest.php b/tests/Switzerland/Geneva/GenevaTest.php index dc5e60b39..e33f03649 100644 --- a/tests/Switzerland/Geneva/GenevaTest.php +++ b/tests/Switzerland/Geneva/GenevaTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class GenevaTest extends GenevaBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -75,8 +72,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -94,8 +89,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -104,8 +97,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -114,8 +105,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Geneva (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -128,7 +117,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Geneva/GoodFridayTest.php b/tests/Switzerland/Geneva/GoodFridayTest.php index ee1a30a91..7b72739ed 100644 --- a/tests/Switzerland/Geneva/GoodFridayTest.php +++ b/tests/Switzerland/Geneva/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends GenevaBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/JeuneGenevoisTest.php b/tests/Switzerland/Geneva/JeuneGenevoisTest.php index 235db191d..bf3777978 100644 --- a/tests/Switzerland/Geneva/JeuneGenevoisTest.php +++ b/tests/Switzerland/Geneva/JeuneGenevoisTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\Switzerland\Geneva; use Yasumi\tests\HolidayTestCase; @@ -36,16 +31,15 @@ class JeuneGenevoisTest extends GenevaBaseTestCase implements HolidayTestCase /** * Tests Jeune Genevois between 1870 and 1965. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testJeuneGenevoisBetween1870And1965(): void { $year = $this->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')); + $date->add(new \DateInterval('P4D')); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OBSERVANCE); @@ -54,16 +48,15 @@ public function testJeuneGenevoisBetween1870And1965(): void /** * Tests Jeune Genevois between 1840 and 1869. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ 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')); + $date->add(new \DateInterval('P4D')); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OTHER); @@ -72,7 +65,7 @@ public function testJeuneGenevoisBetween1840And1869(): void /** * Tests Jeune Genevois before 1840. * - * @throws ReflectionException + * @throws \Exception */ public function testJeuneGenevoisBefore1840(): void { @@ -83,7 +76,7 @@ public function testJeuneGenevoisBefore1840(): void /** * Tests translated name of Jeune Genevois. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -98,7 +91,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/NewYearsDayTest.php b/tests/Switzerland/Geneva/NewYearsDayTest.php index 3447184d3..0ecc47fd8 100644 --- a/tests/Switzerland/Geneva/NewYearsDayTest.php +++ b/tests/Switzerland/Geneva/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends GenevaBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Geneva/PentecostMondayTest.php b/tests/Switzerland/Geneva/PentecostMondayTest.php index 30220280b..b929c811f 100644 --- a/tests/Switzerland/Geneva/PentecostMondayTest.php +++ b/tests/Switzerland/Geneva/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends GenevaBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php b/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php index 8a8dd64d5..eaf6b62df 100644 --- a/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php +++ b/tests/Switzerland/Geneva/RestaurationGenevoiseTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Geneva; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class RestaurationGenevoiseTest extends GenevaBaseTestCase implements HolidayTes /** * Tests Restauration Genevoise. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testRestaurationGenevoiseAfter1813(): void { @@ -45,14 +40,14 @@ public function testRestaurationGenevoiseAfter1813(): void self::REGION, self::HOLIDAY, $year, - new DateTime($year.'-12-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime($year.'-12-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Restauration Genevoise. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -67,7 +62,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/AllSaintsDayTest.php b/tests/Switzerland/Glarus/AllSaintsDayTest.php index 9309a1de9..85239149d 100644 --- a/tests/Switzerland/Glarus/AllSaintsDayTest.php +++ b/tests/Switzerland/Glarus/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends GlarusBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Glarus/AscensionDayTest.php b/tests/Switzerland/Glarus/AscensionDayTest.php index e9de23fd1..be607c928 100644 --- a/tests/Switzerland/Glarus/AscensionDayTest.php +++ b/tests/Switzerland/Glarus/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/BerchtoldsTagTest.php b/tests/Switzerland/Glarus/BerchtoldsTagTest.php index a744f5e9b..b3a716f5a 100644 --- a/tests/Switzerland/Glarus/BerchtoldsTagTest.php +++ b/tests/Switzerland/Glarus/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/ChristmasDayTest.php b/tests/Switzerland/Glarus/ChristmasDayTest.php index 11a65655e..7d55a7c95 100644 --- a/tests/Switzerland/Glarus/ChristmasDayTest.php +++ b/tests/Switzerland/Glarus/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends GlarusBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/EasterMondayTest.php b/tests/Switzerland/Glarus/EasterMondayTest.php index fbf2d73aa..c81212031 100644 --- a/tests/Switzerland/Glarus/EasterMondayTest.php +++ b/tests/Switzerland/Glarus/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/GlarusBaseTestCase.php b/tests/Switzerland/Glarus/GlarusBaseTestCase.php index 087377137..f4ebf1865 100644 --- a/tests/Switzerland/Glarus/GlarusBaseTestCase.php +++ b/tests/Switzerland/Glarus/GlarusBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Glarus/GlarusTest.php b/tests/Switzerland/Glarus/GlarusTest.php index 39fa4994a..ccd25e170 100644 --- a/tests/Switzerland/Glarus/GlarusTest.php +++ b/tests/Switzerland/Glarus/GlarusTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class GlarusTest extends GlarusBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -73,8 +70,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -88,8 +83,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -98,8 +91,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -108,8 +99,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Glarus (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -117,7 +106,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Glarus/GoodFridayTest.php b/tests/Switzerland/Glarus/GoodFridayTest.php index ce0b420cf..74fccec71 100644 --- a/tests/Switzerland/Glarus/GoodFridayTest.php +++ b/tests/Switzerland/Glarus/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/NafelserFahrtTest.php b/tests/Switzerland/Glarus/NafelserFahrtTest.php index 26aa978a2..785f79c79 100644 --- a/tests/Switzerland/Glarus/NafelserFahrtTest.php +++ b/tests/Switzerland/Glarus/NafelserFahrtTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,13 +35,12 @@ class NafelserFahrtTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests Näfelser Fahrt on or after 1389. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testNafelserFahrtOnAfter1389(): void { $year = $this->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); } @@ -53,7 +48,7 @@ public function testNafelserFahrtOnAfter1389(): void /** * Tests Näfelser Fahrt before 1389. * - * @throws ReflectionException + * @throws \Exception */ public function testNafelserFahrtBefore1389(): void { @@ -64,7 +59,7 @@ public function testNafelserFahrtBefore1389(): void /** * Tests translated name of Näfelser Fahrt. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +74,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/NewYearsDayTest.php b/tests/Switzerland/Glarus/NewYearsDayTest.php index dfd6b5c61..c163affd5 100644 --- a/tests/Switzerland/Glarus/NewYearsDayTest.php +++ b/tests/Switzerland/Glarus/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends GlarusBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Glarus/PentecostMondayTest.php b/tests/Switzerland/Glarus/PentecostMondayTest.php index 35f54fcd1..703dffaa1 100644 --- a/tests/Switzerland/Glarus/PentecostMondayTest.php +++ b/tests/Switzerland/Glarus/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends GlarusBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Glarus/StStephensDayTest.php b/tests/Switzerland/Glarus/StStephensDayTest.php index 378351f34..052fb0a51 100644 --- a/tests/Switzerland/Glarus/StStephensDayTest.php +++ b/tests/Switzerland/Glarus/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Glarus; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends GlarusBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/AscensionDayTest.php b/tests/Switzerland/Grisons/AscensionDayTest.php index 54ef008f1..f09cea9a5 100644 --- a/tests/Switzerland/Grisons/AscensionDayTest.php +++ b/tests/Switzerland/Grisons/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends GrisonsBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/ChristmasDayTest.php b/tests/Switzerland/Grisons/ChristmasDayTest.php index 6a04a9c60..78a6677b1 100644 --- a/tests/Switzerland/Grisons/ChristmasDayTest.php +++ b/tests/Switzerland/Grisons/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends GrisonsBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/EasterMondayTest.php b/tests/Switzerland/Grisons/EasterMondayTest.php index 2e4d2eb96..70792e148 100644 --- a/tests/Switzerland/Grisons/EasterMondayTest.php +++ b/tests/Switzerland/Grisons/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends GrisonsBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/GoodFridayTest.php b/tests/Switzerland/Grisons/GoodFridayTest.php index eaebbf307..2574797a4 100644 --- a/tests/Switzerland/Grisons/GoodFridayTest.php +++ b/tests/Switzerland/Grisons/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends GrisonsBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/GrisonsBaseTestCase.php b/tests/Switzerland/Grisons/GrisonsBaseTestCase.php index 81d97dfb2..7a9b76466 100644 --- a/tests/Switzerland/Grisons/GrisonsBaseTestCase.php +++ b/tests/Switzerland/Grisons/GrisonsBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Grisons/GrisonsTest.php b/tests/Switzerland/Grisons/GrisonsTest.php index 1cdbe9360..dcfbb3c83 100644 --- a/tests/Switzerland/Grisons/GrisonsTest.php +++ b/tests/Switzerland/Grisons/GrisonsTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class GrisonsTest extends GrisonsBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -70,8 +67,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -85,8 +80,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -95,8 +88,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -105,8 +96,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Grisons (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -114,7 +103,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Grisons/NewYearsDayTest.php b/tests/Switzerland/Grisons/NewYearsDayTest.php index 75ef609fc..b5ae86213 100644 --- a/tests/Switzerland/Grisons/NewYearsDayTest.php +++ b/tests/Switzerland/Grisons/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends GrisonsBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Grisons/PentecostMondayTest.php b/tests/Switzerland/Grisons/PentecostMondayTest.php index 9f3b97518..3c36343a6 100644 --- a/tests/Switzerland/Grisons/PentecostMondayTest.php +++ b/tests/Switzerland/Grisons/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends GrisonsBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Grisons/StStephensDayTest.php b/tests/Switzerland/Grisons/StStephensDayTest.php index 2431f25fb..b8b7caf6b 100644 --- a/tests/Switzerland/Grisons/StStephensDayTest.php +++ b/tests/Switzerland/Grisons/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Grisons; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends GrisonsBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/AllSaintsDayTest.php b/tests/Switzerland/Jura/AllSaintsDayTest.php index f0f1693d9..8b7c79186 100644 --- a/tests/Switzerland/Jura/AllSaintsDayTest.php +++ b/tests/Switzerland/Jura/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends JuraBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Jura/AscensionDayTest.php b/tests/Switzerland/Jura/AscensionDayTest.php index 498acc1d6..0a356edc0 100644 --- a/tests/Switzerland/Jura/AscensionDayTest.php +++ b/tests/Switzerland/Jura/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/AssumptionOfMaryTest.php b/tests/Switzerland/Jura/AssumptionOfMaryTest.php index 99d0baf07..2d37bf258 100644 --- a/tests/Switzerland/Jura/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Jura/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends JuraBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Jura/BerchtoldsTagTest.php b/tests/Switzerland/Jura/BerchtoldsTagTest.php index 82e8d1d2d..8b8f36c3e 100644 --- a/tests/Switzerland/Jura/BerchtoldsTagTest.php +++ b/tests/Switzerland/Jura/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/BettagsMontagTest.php b/tests/Switzerland/Jura/BettagsMontagTest.php index 65422e706..8bb81ad0d 100644 --- a/tests/Switzerland/Jura/BettagsMontagTest.php +++ b/tests/Switzerland/Jura/BettagsMontagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,17 +30,16 @@ class BettagsMontagTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests Bettags Montag on or after 1832. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBettagsMontagOnAfter1832(): void { $year = $this->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')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } @@ -53,7 +47,7 @@ public function testBettagsMontagOnAfter1832(): void /** * Tests Bettags Montag before 1832. * - * @throws ReflectionException + * @throws \Exception */ public function testBettagsMontagBefore1832(): void { @@ -64,7 +58,7 @@ public function testBettagsMontagBefore1832(): void /** * Tests translated name of Bettags Montag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/ChristmasDayTest.php b/tests/Switzerland/Jura/ChristmasDayTest.php index 6a1f07d9a..a147a6f9a 100644 --- a/tests/Switzerland/Jura/ChristmasDayTest.php +++ b/tests/Switzerland/Jura/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends JuraBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/CorpusChristiTest.php b/tests/Switzerland/Jura/CorpusChristiTest.php index c873bd806..18f548629 100644 --- a/tests/Switzerland/Jura/CorpusChristiTest.php +++ b/tests/Switzerland/Jura/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/EasterMondayTest.php b/tests/Switzerland/Jura/EasterMondayTest.php index 5337477e2..0329d0cfa 100644 --- a/tests/Switzerland/Jura/EasterMondayTest.php +++ b/tests/Switzerland/Jura/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/EasterTest.php b/tests/Switzerland/Jura/EasterTest.php index d0461b975..7ca24c5ff 100644 --- a/tests/Switzerland/Jura/EasterTest.php +++ b/tests/Switzerland/Jura/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-4-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-4-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/GoodFridayTest.php b/tests/Switzerland/Jura/GoodFridayTest.php index cc18f8703..3b402daa5 100644 --- a/tests/Switzerland/Jura/GoodFridayTest.php +++ b/tests/Switzerland/Jura/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/JuraBaseTestCase.php b/tests/Switzerland/Jura/JuraBaseTestCase.php index d0136447c..e3d0afe8a 100644 --- a/tests/Switzerland/Jura/JuraBaseTestCase.php +++ b/tests/Switzerland/Jura/JuraBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Jura/JuraTest.php b/tests/Switzerland/Jura/JuraTest.php index 4ef2af3c2..3069916fa 100644 --- a/tests/Switzerland/Jura/JuraTest.php +++ b/tests/Switzerland/Jura/JuraTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class JuraTest extends JuraBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -78,8 +75,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -93,8 +88,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -103,8 +96,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -113,8 +104,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Jura (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -122,7 +111,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Jura/NewYearsDayTest.php b/tests/Switzerland/Jura/NewYearsDayTest.php index a961530ac..0dcb57fc1 100644 --- a/tests/Switzerland/Jura/NewYearsDayTest.php +++ b/tests/Switzerland/Jura/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends JuraBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Jura/PentecostMondayTest.php b/tests/Switzerland/Jura/PentecostMondayTest.php index 34ec5edea..2e8b6626f 100644 --- a/tests/Switzerland/Jura/PentecostMondayTest.php +++ b/tests/Switzerland/Jura/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/PentecostTest.php b/tests/Switzerland/Jura/PentecostTest.php index d15f3364e..70604ce3a 100644 --- a/tests/Switzerland/Jura/PentecostTest.php +++ b/tests/Switzerland/Jura/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends JuraBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/PlebisciteJurassienTest.php b/tests/Switzerland/Jura/PlebisciteJurassienTest.php index 3a2855690..9a064b237 100644 --- a/tests/Switzerland/Jura/PlebisciteJurassienTest.php +++ b/tests/Switzerland/Jura/PlebisciteJurassienTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class PlebisciteJurassienTest extends JuraBaseTestCase implements HolidayTestCas /** * Tests Plébiscite jurassien on or after 1975. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testInstaurationRepubliqueOnAfter1975(): void { @@ -49,14 +44,14 @@ public function testInstaurationRepubliqueOnAfter1975(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-23", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-23", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Plébiscite jurassien before 1975. * - * @throws ReflectionException + * @throws \Exception */ public function testInstaurationRepubliqueBefore1975(): void { @@ -70,7 +65,7 @@ public function testInstaurationRepubliqueBefore1975(): void /** * Tests translated name of Plébiscite jurassien. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Jura/WorkersDayTest.php b/tests/Switzerland/Jura/WorkersDayTest.php index 5e95d525a..5cd1a42f5 100644 --- a/tests/Switzerland/Jura/WorkersDayTest.php +++ b/tests/Switzerland/Jura/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Jura; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends JuraBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/AllSaintsDayTest.php b/tests/Switzerland/Lucerne/AllSaintsDayTest.php index f7ee3e4c6..12b265a4c 100644 --- a/tests/Switzerland/Lucerne/AllSaintsDayTest.php +++ b/tests/Switzerland/Lucerne/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends LucerneBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Lucerne/AscensionDayTest.php b/tests/Switzerland/Lucerne/AscensionDayTest.php index eb69158bc..c2be29587 100644 --- a/tests/Switzerland/Lucerne/AscensionDayTest.php +++ b/tests/Switzerland/Lucerne/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php b/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php index 9a6cf4694..31573919a 100644 --- a/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Lucerne/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends LucerneBaseTestCase implements HolidayTestCas * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Lucerne/BerchtoldsTagTest.php b/tests/Switzerland/Lucerne/BerchtoldsTagTest.php index b68e0168e..aed20e261 100644 --- a/tests/Switzerland/Lucerne/BerchtoldsTagTest.php +++ b/tests/Switzerland/Lucerne/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/ChristmasDayTest.php b/tests/Switzerland/Lucerne/ChristmasDayTest.php index 460ab8c84..9155d4332 100644 --- a/tests/Switzerland/Lucerne/ChristmasDayTest.php +++ b/tests/Switzerland/Lucerne/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends LucerneBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/CorpusChristiTest.php b/tests/Switzerland/Lucerne/CorpusChristiTest.php index ee68d13d6..510df73e7 100644 --- a/tests/Switzerland/Lucerne/CorpusChristiTest.php +++ b/tests/Switzerland/Lucerne/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/EasterMondayTest.php b/tests/Switzerland/Lucerne/EasterMondayTest.php index 6c0db1b8f..bed6542d4 100644 --- a/tests/Switzerland/Lucerne/EasterMondayTest.php +++ b/tests/Switzerland/Lucerne/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/GoodFridayTest.php b/tests/Switzerland/Lucerne/GoodFridayTest.php index 66dd75231..1ee642152 100644 --- a/tests/Switzerland/Lucerne/GoodFridayTest.php +++ b/tests/Switzerland/Lucerne/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php b/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php index 152da33cb..1c67e3bb1 100644 --- a/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Lucerne/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends LucerneBaseTestCase implements HolidayTes * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/LucerneBaseTestCase.php b/tests/Switzerland/Lucerne/LucerneBaseTestCase.php index 617bb7a9f..13fe3048b 100644 --- a/tests/Switzerland/Lucerne/LucerneBaseTestCase.php +++ b/tests/Switzerland/Lucerne/LucerneBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Lucerne/LucerneTest.php b/tests/Switzerland/Lucerne/LucerneTest.php index c75ea0e5d..2bbed38c4 100644 --- a/tests/Switzerland/Lucerne/LucerneTest.php +++ b/tests/Switzerland/Lucerne/LucerneTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class LucerneTest extends LucerneBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -75,8 +72,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -90,8 +85,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -100,8 +93,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -110,8 +101,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Lucerne (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -119,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Lucerne/NewYearsDayTest.php b/tests/Switzerland/Lucerne/NewYearsDayTest.php index beb0f60d9..d74916498 100644 --- a/tests/Switzerland/Lucerne/NewYearsDayTest.php +++ b/tests/Switzerland/Lucerne/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends LucerneBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Lucerne/PentecostMondayTest.php b/tests/Switzerland/Lucerne/PentecostMondayTest.php index 73aa38138..3fc425b92 100644 --- a/tests/Switzerland/Lucerne/PentecostMondayTest.php +++ b/tests/Switzerland/Lucerne/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends LucerneBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Lucerne/StStephensDayTest.php b/tests/Switzerland/Lucerne/StStephensDayTest.php index e87f3c51e..a4f9305cf 100644 --- a/tests/Switzerland/Lucerne/StStephensDayTest.php +++ b/tests/Switzerland/Lucerne/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Lucerne; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends LucerneBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/AscensionDayTest.php b/tests/Switzerland/Neuchatel/AscensionDayTest.php index 3c7a98a0f..230e66ae2 100644 --- a/tests/Switzerland/Neuchatel/AscensionDayTest.php +++ b/tests/Switzerland/Neuchatel/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/BettagsMontagTest.php b/tests/Switzerland/Neuchatel/BettagsMontagTest.php index ee5e504af..1f5c4e447 100644 --- a/tests/Switzerland/Neuchatel/BettagsMontagTest.php +++ b/tests/Switzerland/Neuchatel/BettagsMontagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,17 +30,16 @@ class BettagsMontagTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests Bettags Montag on or after 1832. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBettagsMontagOnAfter1832(): void { $year = $this->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')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } @@ -53,7 +47,7 @@ public function testBettagsMontagOnAfter1832(): void /** * Tests Bettags Montag before 1832. * - * @throws ReflectionException + * @throws \Exception */ public function testBettagsMontagBefore1832(): void { @@ -64,7 +58,7 @@ public function testBettagsMontagBefore1832(): void /** * Tests translated name of Bettags Montag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/ChristmasDayTest.php b/tests/Switzerland/Neuchatel/ChristmasDayTest.php index 5ac9e6384..2c66e0485 100644 --- a/tests/Switzerland/Neuchatel/ChristmasDayTest.php +++ b/tests/Switzerland/Neuchatel/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends NeuchatelBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/December26thTest.php b/tests/Switzerland/Neuchatel/December26thTest.php index a05031dc0..e526eef67 100644 --- a/tests/Switzerland/Neuchatel/December26thTest.php +++ b/tests/Switzerland/Neuchatel/December26thTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class December26thTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests December 26th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testDecember26th(): void { @@ -48,7 +43,7 @@ public function testDecember26th(): void self::REGION, self::HOLIDAY, self::OBSERVANCE_YEAR, - new DateTime(self::OBSERVANCE_YEAR.'-12-26', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::OBSERVANCE_YEAR.'-12-26', new \DateTimeZone(self::TIMEZONE)) ); $this->assertNotHoliday( self::REGION, @@ -74,8 +69,6 @@ public function testDecember26th(): void /** * Tests translated name of December 26th. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -89,8 +82,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/EasterMondayTest.php b/tests/Switzerland/Neuchatel/EasterMondayTest.php index 35325a2c9..99b3da40f 100644 --- a/tests/Switzerland/Neuchatel/EasterMondayTest.php +++ b/tests/Switzerland/Neuchatel/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/GoodFridayTest.php b/tests/Switzerland/Neuchatel/GoodFridayTest.php index 39c5c56d9..8f434e25e 100644 --- a/tests/Switzerland/Neuchatel/GoodFridayTest.php +++ b/tests/Switzerland/Neuchatel/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php b/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php index 5f21ede43..c0b5a89e8 100644 --- a/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php +++ b/tests/Switzerland/Neuchatel/InstaurationRepubliqueTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class InstaurationRepubliqueTest extends NeuchatelBaseTestCase implements Holida /** * Tests Instauration de la République on or after 1849. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testInstaurationRepubliqueOnAfter1849(): void { @@ -49,14 +44,14 @@ public function testInstaurationRepubliqueOnAfter1849(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-03-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-03-01", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Instauration de la République before 1849. * - * @throws ReflectionException + * @throws \Exception */ public function testInstaurationRepubliqueBefore1849(): void { @@ -70,7 +65,7 @@ public function testInstaurationRepubliqueBefore1849(): void /** * Tests translated name of Instauration de la République. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/January2ndTest.php b/tests/Switzerland/Neuchatel/January2ndTest.php index 34ebbc503..4eaac7205 100644 --- a/tests/Switzerland/Neuchatel/January2ndTest.php +++ b/tests/Switzerland/Neuchatel/January2ndTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class January2ndTest extends NeuchatelBaseTestCase implements HolidayTestCase /** * Tests January 2nd. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testJanuary2nd(): void { @@ -48,7 +43,7 @@ public function testJanuary2nd(): void self::REGION, self::HOLIDAY, self::OBSERVANCE_YEAR, - new DateTime(self::OBSERVANCE_YEAR.'-1-02', new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::OBSERVANCE_YEAR.'-1-02', new \DateTimeZone(self::TIMEZONE)) ); $this->assertNotHoliday( self::REGION, @@ -74,8 +69,6 @@ public function testJanuary2nd(): void /** * Tests translated name of January 2nd. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -89,8 +82,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php b/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php index b3ddf83f1..22055ca9d 100644 --- a/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php +++ b/tests/Switzerland/Neuchatel/NeuchatelBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Neuchatel/NeuchatelTest.php b/tests/Switzerland/Neuchatel/NeuchatelTest.php index 23ec6e30a..9b8f6d080 100644 --- a/tests/Switzerland/Neuchatel/NeuchatelTest.php +++ b/tests/Switzerland/Neuchatel/NeuchatelTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NeuchatelTest extends NeuchatelBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -72,8 +69,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -87,8 +82,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -97,8 +90,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -107,8 +98,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Neuchatel (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -116,7 +105,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Neuchatel/NewYearsDayTest.php b/tests/Switzerland/Neuchatel/NewYearsDayTest.php index 78fccac81..589f393d6 100644 --- a/tests/Switzerland/Neuchatel/NewYearsDayTest.php +++ b/tests/Switzerland/Neuchatel/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends NeuchatelBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Neuchatel/PentecostMondayTest.php b/tests/Switzerland/Neuchatel/PentecostMondayTest.php index 97204f46a..24d1bbc80 100644 --- a/tests/Switzerland/Neuchatel/PentecostMondayTest.php +++ b/tests/Switzerland/Neuchatel/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends NeuchatelBaseTestCase implements HolidayTestCa /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Neuchatel/WorkersDayTest.php b/tests/Switzerland/Neuchatel/WorkersDayTest.php index a9b319e03..0edc522dd 100644 --- a/tests/Switzerland/Neuchatel/WorkersDayTest.php +++ b/tests/Switzerland/Neuchatel/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Neuchatel; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends NeuchatelBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/AllSaintsDayTest.php b/tests/Switzerland/Nidwalden/AllSaintsDayTest.php index 618265c0b..9d72cf426 100644 --- a/tests/Switzerland/Nidwalden/AllSaintsDayTest.php +++ b/tests/Switzerland/Nidwalden/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends NidwaldenBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Nidwalden/AscensionDayTest.php b/tests/Switzerland/Nidwalden/AscensionDayTest.php index a1572c6b1..f3c92b148 100644 --- a/tests/Switzerland/Nidwalden/AscensionDayTest.php +++ b/tests/Switzerland/Nidwalden/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends NidwaldenBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php b/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php index 84da7fb8c..4b70f33e7 100644 --- a/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Nidwalden/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends NidwaldenBaseTestCase implements HolidayTestC * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Nidwalden/ChristmasDayTest.php b/tests/Switzerland/Nidwalden/ChristmasDayTest.php index 781b969b7..236126f8e 100644 --- a/tests/Switzerland/Nidwalden/ChristmasDayTest.php +++ b/tests/Switzerland/Nidwalden/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends NidwaldenBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/CorpusChristiTest.php b/tests/Switzerland/Nidwalden/CorpusChristiTest.php index d50c8b9a0..ce90b75e4 100644 --- a/tests/Switzerland/Nidwalden/CorpusChristiTest.php +++ b/tests/Switzerland/Nidwalden/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends NidwaldenBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/EasterMondayTest.php b/tests/Switzerland/Nidwalden/EasterMondayTest.php index 3480461f8..2970905a1 100644 --- a/tests/Switzerland/Nidwalden/EasterMondayTest.php +++ b/tests/Switzerland/Nidwalden/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends NidwaldenBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/GoodFridayTest.php b/tests/Switzerland/Nidwalden/GoodFridayTest.php index ae61d1cc7..c13e55ca9 100644 --- a/tests/Switzerland/Nidwalden/GoodFridayTest.php +++ b/tests/Switzerland/Nidwalden/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends NidwaldenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php b/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php index ebcba00b5..5b38ea3af 100644 --- a/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Nidwalden/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends NidwaldenBaseTestCase implements HolidayT * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/NewYearsDayTest.php b/tests/Switzerland/Nidwalden/NewYearsDayTest.php index a5f6fa17e..e5d184113 100644 --- a/tests/Switzerland/Nidwalden/NewYearsDayTest.php +++ b/tests/Switzerland/Nidwalden/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends NidwaldenBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Nidwalden/NidwaldenBaseTestCase.php b/tests/Switzerland/Nidwalden/NidwaldenBaseTestCase.php index def946544..c0d2cfae7 100644 --- a/tests/Switzerland/Nidwalden/NidwaldenBaseTestCase.php +++ b/tests/Switzerland/Nidwalden/NidwaldenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Nidwalden/NidwaldenTest.php b/tests/Switzerland/Nidwalden/NidwaldenTest.php index e98427d7e..75efa231c 100644 --- a/tests/Switzerland/Nidwalden/NidwaldenTest.php +++ b/tests/Switzerland/Nidwalden/NidwaldenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NidwaldenTest extends NidwaldenBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -75,8 +72,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -90,8 +85,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -100,8 +93,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -110,8 +101,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Nidwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -119,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Nidwalden/PentecostMondayTest.php b/tests/Switzerland/Nidwalden/PentecostMondayTest.php index 4f321e905..bc3341ed0 100644 --- a/tests/Switzerland/Nidwalden/PentecostMondayTest.php +++ b/tests/Switzerland/Nidwalden/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends NidwaldenBaseTestCase implements HolidayTestCa /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/StJosephDayTest.php b/tests/Switzerland/Nidwalden/StJosephDayTest.php index 67f09bc3d..dfe1d7510 100644 --- a/tests/Switzerland/Nidwalden/StJosephDayTest.php +++ b/tests/Switzerland/Nidwalden/StJosephDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StJosephDayTest extends NidwaldenBaseTestCase implements HolidayTestCase * * @dataProvider StJosephDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStJosephDay(int $year, DateTime $expected): void + public function testStJosephDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testStJosephDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day + * @return array list of test dates for St. Joseph's Day * - * @throws Exception + * @throws \Exception */ public function StJosephDayDataProvider(): array { @@ -63,7 +58,7 @@ public function StJosephDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Nidwalden/StStephensDayTest.php b/tests/Switzerland/Nidwalden/StStephensDayTest.php index fca401103..ef44d38a4 100644 --- a/tests/Switzerland/Nidwalden/StStephensDayTest.php +++ b/tests/Switzerland/Nidwalden/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Nidwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends NidwaldenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/AllSaintsDayTest.php b/tests/Switzerland/Obwalden/AllSaintsDayTest.php index 7ff738679..7941bcfa4 100644 --- a/tests/Switzerland/Obwalden/AllSaintsDayTest.php +++ b/tests/Switzerland/Obwalden/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends ObwaldenBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Obwalden/AscensionDayTest.php b/tests/Switzerland/Obwalden/AscensionDayTest.php index e093ad669..83eeb1b61 100644 --- a/tests/Switzerland/Obwalden/AscensionDayTest.php +++ b/tests/Switzerland/Obwalden/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends ObwaldenBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php b/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php index 83d9f7e55..94b557ab9 100644 --- a/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Obwalden/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends ObwaldenBaseTestCase implements HolidayTestCa * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Obwalden/BerchtoldsTagTest.php b/tests/Switzerland/Obwalden/BerchtoldsTagTest.php index 94ef8c76b..1881e91eb 100644 --- a/tests/Switzerland/Obwalden/BerchtoldsTagTest.php +++ b/tests/Switzerland/Obwalden/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends ObwaldenBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php index 7f3cee3df..e9c57fb5c 100644 --- a/tests/Switzerland/Obwalden/BruderKlausenFestTest.php +++ b/tests/Switzerland/Obwalden/BruderKlausenFestTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BruderKlausenFestTest extends ObwaldenBaseTestCase implements HolidayTestC /** * Tests Bruder-Klausen-Fest on or after 1947. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBruderKlausenFestOnAfter1947(): void { $year = $this->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,13 +44,12 @@ public function testBruderKlausenFestOnAfter1947(): void /** * Tests Bruder-Klausen-Fest between 1649 and 1946. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ 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); @@ -64,7 +58,7 @@ public function testBruderKlausenFestBetween1649And1946(): void /** * Tests Bruder-Klausen-Fest before 1648. * - * @throws ReflectionException + * @throws \Exception */ public function testBruderKlausenFestBefore1648(): void { @@ -75,7 +69,7 @@ public function testBruderKlausenFestBefore1648(): void /** * Tests translated name of Bruder-Klausen-Fest. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -90,7 +84,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/ChristmasDayTest.php b/tests/Switzerland/Obwalden/ChristmasDayTest.php index cbfdf7dfc..bf1e4fa40 100644 --- a/tests/Switzerland/Obwalden/ChristmasDayTest.php +++ b/tests/Switzerland/Obwalden/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends ObwaldenBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/CorpusChristiTest.php b/tests/Switzerland/Obwalden/CorpusChristiTest.php index 990cca57a..b266249df 100644 --- a/tests/Switzerland/Obwalden/CorpusChristiTest.php +++ b/tests/Switzerland/Obwalden/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends ObwaldenBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/EasterMondayTest.php b/tests/Switzerland/Obwalden/EasterMondayTest.php index 2885fd534..ef0842a5f 100644 --- a/tests/Switzerland/Obwalden/EasterMondayTest.php +++ b/tests/Switzerland/Obwalden/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends ObwaldenBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/GoodFridayTest.php b/tests/Switzerland/Obwalden/GoodFridayTest.php index 822ab27aa..0860ffaa5 100644 --- a/tests/Switzerland/Obwalden/GoodFridayTest.php +++ b/tests/Switzerland/Obwalden/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends ObwaldenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php b/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php index 0632cb40d..50648353c 100644 --- a/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Obwalden/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends ObwaldenBaseTestCase implements HolidayTe * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/NewYearsDayTest.php b/tests/Switzerland/Obwalden/NewYearsDayTest.php index dbfd43780..639031f67 100644 --- a/tests/Switzerland/Obwalden/NewYearsDayTest.php +++ b/tests/Switzerland/Obwalden/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ObwaldenBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Obwalden/ObwaldenBaseTestCase.php b/tests/Switzerland/Obwalden/ObwaldenBaseTestCase.php index fe09d2f07..e0a2dac5f 100644 --- a/tests/Switzerland/Obwalden/ObwaldenBaseTestCase.php +++ b/tests/Switzerland/Obwalden/ObwaldenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Obwalden/ObwaldenTest.php b/tests/Switzerland/Obwalden/ObwaldenTest.php index 956a5cee5..b471e2d04 100644 --- a/tests/Switzerland/Obwalden/ObwaldenTest.php +++ b/tests/Switzerland/Obwalden/ObwaldenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ObwaldenTest extends ObwaldenBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -76,8 +73,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -91,8 +86,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -101,8 +94,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -111,8 +102,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Obwalden (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -120,7 +109,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Obwalden/PentecostMondayTest.php b/tests/Switzerland/Obwalden/PentecostMondayTest.php index 94e1882b9..875409621 100644 --- a/tests/Switzerland/Obwalden/PentecostMondayTest.php +++ b/tests/Switzerland/Obwalden/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends ObwaldenBaseTestCase implements HolidayTestCas /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Obwalden/StStephensDayTest.php b/tests/Switzerland/Obwalden/StStephensDayTest.php index bd5f21cc5..33c5abd44 100644 --- a/tests/Switzerland/Obwalden/StStephensDayTest.php +++ b/tests/Switzerland/Obwalden/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Obwalden; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends ObwaldenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/AscensionDayTest.php b/tests/Switzerland/Schaffhausen/AscensionDayTest.php index 164171d2b..c64277307 100644 --- a/tests/Switzerland/Schaffhausen/AscensionDayTest.php +++ b/tests/Switzerland/Schaffhausen/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends SchaffhausenBaseTestCase implements HolidayTestCa /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php b/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php index 2f0915943..d334459c0 100644 --- a/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php +++ b/tests/Switzerland/Schaffhausen/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends SchaffhausenBaseTestCase implements HolidayTestC /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php index 863c12c8e..e20dcfa80 100644 --- a/tests/Switzerland/Schaffhausen/ChristmasDayTest.php +++ b/tests/Switzerland/Schaffhausen/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends SchaffhausenBaseTestCase implements HolidayTestCa * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/EasterMondayTest.php b/tests/Switzerland/Schaffhausen/EasterMondayTest.php index 45cd9f651..56dbea3e6 100644 --- a/tests/Switzerland/Schaffhausen/EasterMondayTest.php +++ b/tests/Switzerland/Schaffhausen/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends SchaffhausenBaseTestCase implements HolidayTestCa /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/GoodFridayTest.php b/tests/Switzerland/Schaffhausen/GoodFridayTest.php index 3f674c86e..bbf1d5025 100644 --- a/tests/Switzerland/Schaffhausen/GoodFridayTest.php +++ b/tests/Switzerland/Schaffhausen/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends SchaffhausenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/NewYearsDayTest.php b/tests/Switzerland/Schaffhausen/NewYearsDayTest.php index 44963f866..f3f4b3b94 100644 --- a/tests/Switzerland/Schaffhausen/NewYearsDayTest.php +++ b/tests/Switzerland/Schaffhausen/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends SchaffhausenBaseTestCase implements HolidayTestCas * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Schaffhausen/PentecostMondayTest.php b/tests/Switzerland/Schaffhausen/PentecostMondayTest.php index ae7436e1b..225e0586d 100644 --- a/tests/Switzerland/Schaffhausen/PentecostMondayTest.php +++ b/tests/Switzerland/Schaffhausen/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends SchaffhausenBaseTestCase implements HolidayTes /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/SchaffhausenBaseTestCase.php b/tests/Switzerland/Schaffhausen/SchaffhausenBaseTestCase.php index fb4222392..720157e1f 100644 --- a/tests/Switzerland/Schaffhausen/SchaffhausenBaseTestCase.php +++ b/tests/Switzerland/Schaffhausen/SchaffhausenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Schaffhausen/SchaffhausenTest.php b/tests/Switzerland/Schaffhausen/SchaffhausenTest.php index da7885121..53978a4a9 100644 --- a/tests/Switzerland/Schaffhausen/SchaffhausenTest.php +++ b/tests/Switzerland/Schaffhausen/SchaffhausenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class SchaffhausenTest extends SchaffhausenBaseTestCase implements ProviderTestC /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -72,8 +69,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -87,8 +82,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -97,8 +90,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -107,8 +98,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Schaffhausen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -116,7 +105,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Schaffhausen/StStephensDayTest.php b/tests/Switzerland/Schaffhausen/StStephensDayTest.php index 8264f20a1..dce4de568 100644 --- a/tests/Switzerland/Schaffhausen/StStephensDayTest.php +++ b/tests/Switzerland/Schaffhausen/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends SchaffhausenBaseTestCase implements HolidayTestC * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schaffhausen/WorkersDayTest.php b/tests/Switzerland/Schaffhausen/WorkersDayTest.php index 7bafe1742..ac3679e6b 100644 --- a/tests/Switzerland/Schaffhausen/WorkersDayTest.php +++ b/tests/Switzerland/Schaffhausen/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schaffhausen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends SchaffhausenBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/AllSaintsDayTest.php b/tests/Switzerland/Schwyz/AllSaintsDayTest.php index a326cfc26..790512f4d 100644 --- a/tests/Switzerland/Schwyz/AllSaintsDayTest.php +++ b/tests/Switzerland/Schwyz/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Schwyz/AscensionDayTest.php b/tests/Switzerland/Schwyz/AscensionDayTest.php index f6122f01b..8aee887bb 100644 --- a/tests/Switzerland/Schwyz/AscensionDayTest.php +++ b/tests/Switzerland/Schwyz/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends SchwyzBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php b/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php index b23410274..c31b8500e 100644 --- a/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Schwyz/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Schwyz/ChristmasDayTest.php b/tests/Switzerland/Schwyz/ChristmasDayTest.php index 741cd464f..ae965ea88 100644 --- a/tests/Switzerland/Schwyz/ChristmasDayTest.php +++ b/tests/Switzerland/Schwyz/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/CorpusChristiTest.php b/tests/Switzerland/Schwyz/CorpusChristiTest.php index 5b20cbc4e..a44cfe296 100644 --- a/tests/Switzerland/Schwyz/CorpusChristiTest.php +++ b/tests/Switzerland/Schwyz/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends SchwyzBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/EasterMondayTest.php b/tests/Switzerland/Schwyz/EasterMondayTest.php index 0c3119ff8..91b9278f1 100644 --- a/tests/Switzerland/Schwyz/EasterMondayTest.php +++ b/tests/Switzerland/Schwyz/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends SchwyzBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/EpiphanyTest.php b/tests/Switzerland/Schwyz/EpiphanyTest.php index 2d4f998d2..88154280a 100644 --- a/tests/Switzerland/Schwyz/EpiphanyTest.php +++ b/tests/Switzerland/Schwyz/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/GoodFridayTest.php b/tests/Switzerland/Schwyz/GoodFridayTest.php index 5e61365ae..63b45f830 100644 --- a/tests/Switzerland/Schwyz/GoodFridayTest.php +++ b/tests/Switzerland/Schwyz/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends SchwyzBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php b/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php index 3f26bf35c..a7e7f8e23 100644 --- a/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Schwyz/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends SchwyzBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/NewYearsDayTest.php b/tests/Switzerland/Schwyz/NewYearsDayTest.php index deefbaeca..22ab6c255 100644 --- a/tests/Switzerland/Schwyz/NewYearsDayTest.php +++ b/tests/Switzerland/Schwyz/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Schwyz/PentecostMondayTest.php b/tests/Switzerland/Schwyz/PentecostMondayTest.php index dcf085522..6e89b8888 100644 --- a/tests/Switzerland/Schwyz/PentecostMondayTest.php +++ b/tests/Switzerland/Schwyz/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends SchwyzBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/SchwyzBaseTestCase.php b/tests/Switzerland/Schwyz/SchwyzBaseTestCase.php index add82560e..0f4d69ac4 100644 --- a/tests/Switzerland/Schwyz/SchwyzBaseTestCase.php +++ b/tests/Switzerland/Schwyz/SchwyzBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Schwyz/SchwyzTest.php b/tests/Switzerland/Schwyz/SchwyzTest.php index fc23c1365..ce99c6f21 100644 --- a/tests/Switzerland/Schwyz/SchwyzTest.php +++ b/tests/Switzerland/Schwyz/SchwyzTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class SchwyzTest extends SchwyzBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -76,8 +73,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -91,8 +86,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -101,8 +94,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -111,8 +102,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Schwyz (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -120,7 +109,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Schwyz/StJosephDayTest.php b/tests/Switzerland/Schwyz/StJosephDayTest.php index a68c33a96..ea615f7cc 100644 --- a/tests/Switzerland/Schwyz/StJosephDayTest.php +++ b/tests/Switzerland/Schwyz/StJosephDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StJosephDayTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider StJosephDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStJosephDay(int $year, DateTime $expected): void + public function testStJosephDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testStJosephDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day + * @return array list of test dates for St. Joseph's Day * - * @throws Exception + * @throws \Exception */ public function StJosephDayDataProvider(): array { @@ -63,7 +58,7 @@ public function StJosephDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Schwyz/StStephensDayTest.php b/tests/Switzerland/Schwyz/StStephensDayTest.php index 456e62bb6..eab1fdf88 100644 --- a/tests/Switzerland/Schwyz/StStephensDayTest.php +++ b/tests/Switzerland/Schwyz/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Schwyz; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends SchwyzBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Solothurn/AscensionDayTest.php b/tests/Switzerland/Solothurn/AscensionDayTest.php index e59d39c75..6639175ea 100644 --- a/tests/Switzerland/Solothurn/AscensionDayTest.php +++ b/tests/Switzerland/Solothurn/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends SolothurnBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Solothurn/BerchtoldsTagTest.php b/tests/Switzerland/Solothurn/BerchtoldsTagTest.php index 124cd8071..5cb4d443a 100644 --- a/tests/Switzerland/Solothurn/BerchtoldsTagTest.php +++ b/tests/Switzerland/Solothurn/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends SolothurnBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Solothurn/ChristmasDayTest.php b/tests/Switzerland/Solothurn/ChristmasDayTest.php index d5bbc5883..1a0b0820a 100644 --- a/tests/Switzerland/Solothurn/ChristmasDayTest.php +++ b/tests/Switzerland/Solothurn/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends SolothurnBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Solothurn/GoodFridayTest.php b/tests/Switzerland/Solothurn/GoodFridayTest.php index 96e48ecad..a1374c32a 100644 --- a/tests/Switzerland/Solothurn/GoodFridayTest.php +++ b/tests/Switzerland/Solothurn/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends SolothurnBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Solothurn/NewYearsDayTest.php b/tests/Switzerland/Solothurn/NewYearsDayTest.php index 1209a3f1b..7db19e89b 100644 --- a/tests/Switzerland/Solothurn/NewYearsDayTest.php +++ b/tests/Switzerland/Solothurn/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends SolothurnBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Solothurn/SolothurnBaseTestCase.php b/tests/Switzerland/Solothurn/SolothurnBaseTestCase.php index c9508efd4..f87b2d5e5 100644 --- a/tests/Switzerland/Solothurn/SolothurnBaseTestCase.php +++ b/tests/Switzerland/Solothurn/SolothurnBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Solothurn/SolothurnTest.php b/tests/Switzerland/Solothurn/SolothurnTest.php index aa5f93eb2..4c3cd4b08 100644 --- a/tests/Switzerland/Solothurn/SolothurnTest.php +++ b/tests/Switzerland/Solothurn/SolothurnTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Solothurn; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class SolothurnTest extends SolothurnBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -53,8 +52,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -69,8 +66,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -84,8 +79,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -94,8 +87,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -104,8 +95,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Solothurn (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -113,7 +102,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/StGallen/AllSaintsDayTest.php b/tests/Switzerland/StGallen/AllSaintsDayTest.php index 38315b04a..2ab0b4523 100644 --- a/tests/Switzerland/StGallen/AllSaintsDayTest.php +++ b/tests/Switzerland/StGallen/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends StGallenBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/StGallen/AscensionDayTest.php b/tests/Switzerland/StGallen/AscensionDayTest.php index 9606ed4bd..6f828ddd8 100644 --- a/tests/Switzerland/StGallen/AscensionDayTest.php +++ b/tests/Switzerland/StGallen/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends StGallenBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/StGallen/ChristmasDayTest.php b/tests/Switzerland/StGallen/ChristmasDayTest.php index 5b033a8a0..e1c3387ef 100644 --- a/tests/Switzerland/StGallen/ChristmasDayTest.php +++ b/tests/Switzerland/StGallen/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends StGallenBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/StGallen/EasterMondayTest.php b/tests/Switzerland/StGallen/EasterMondayTest.php index a44b54e15..b7cf54c97 100644 --- a/tests/Switzerland/StGallen/EasterMondayTest.php +++ b/tests/Switzerland/StGallen/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends StGallenBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/StGallen/GoodFridayTest.php b/tests/Switzerland/StGallen/GoodFridayTest.php index ac917bb4e..9c4c0054f 100644 --- a/tests/Switzerland/StGallen/GoodFridayTest.php +++ b/tests/Switzerland/StGallen/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends StGallenBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/StGallen/NewYearsDayTest.php b/tests/Switzerland/StGallen/NewYearsDayTest.php index 268fba7e3..f7353749f 100644 --- a/tests/Switzerland/StGallen/NewYearsDayTest.php +++ b/tests/Switzerland/StGallen/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends StGallenBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/StGallen/PentecostMondayTest.php b/tests/Switzerland/StGallen/PentecostMondayTest.php index 9ae921586..06970f834 100644 --- a/tests/Switzerland/StGallen/PentecostMondayTest.php +++ b/tests/Switzerland/StGallen/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends StGallenBaseTestCase implements HolidayTestCas /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/StGallen/StGallenBaseTestCase.php b/tests/Switzerland/StGallen/StGallenBaseTestCase.php index c2d2655fa..98f0e810a 100644 --- a/tests/Switzerland/StGallen/StGallenBaseTestCase.php +++ b/tests/Switzerland/StGallen/StGallenBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/StGallen/StGallenTest.php b/tests/Switzerland/StGallen/StGallenTest.php index d87f698c4..08aeb4a36 100644 --- a/tests/Switzerland/StGallen/StGallenTest.php +++ b/tests/Switzerland/StGallen/StGallenTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class StGallenTest extends StGallenBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in St. Gallen (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/StGallen/StStephensDayTest.php b/tests/Switzerland/StGallen/StStephensDayTest.php index 0abcae41a..808eb74f7 100644 --- a/tests/Switzerland/StGallen/StStephensDayTest.php +++ b/tests/Switzerland/StGallen/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\StGallen; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends StGallenBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/SwissNationalDayTest.php b/tests/Switzerland/SwissNationalDayTest.php index a0fa465b1..2c53e9d49 100644 --- a/tests/Switzerland/SwissNationalDayTest.php +++ b/tests/Switzerland/SwissNationalDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class SwissNationalDayTest extends SwitzerlandBaseTestCase implements HolidayTes /** * Tests National Day on or after 1994. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayOnAfter1994(): void { @@ -59,16 +54,14 @@ public function testNationalDayOnAfter1994(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-01", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests National Day on or after 1899 and before 1994. * - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayOnAfter1899(): void { @@ -77,7 +70,7 @@ public function testNationalDayOnAfter1899(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-01", new \DateTimeZone(self::TIMEZONE)) ); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OBSERVANCE); } @@ -85,9 +78,7 @@ public function testNationalDayOnAfter1899(): void /** * Tests National Day on 1891. * - * @throws ReflectionException - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayOn1891(): void { @@ -96,7 +87,7 @@ public function testNationalDayOn1891(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-8-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-8-01", new \DateTimeZone(self::TIMEZONE)) ); $this->assertHolidayType(self::REGION, self::HOLIDAY, $year, Holiday::TYPE_OBSERVANCE); } @@ -104,7 +95,7 @@ public function testNationalDayOn1891(): void /** * Tests National Day before 1891. * - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayBefore1891(): void { @@ -118,7 +109,7 @@ public function testNationalDayBefore1891(): void /** * Tests National Day between 1891 and 1899. * - * @throws ReflectionException + * @throws \Exception */ public function testNationalDayBetween1891And1899(): void { @@ -129,7 +120,7 @@ public function testNationalDayBetween1891And1899(): void /** * Tests translated name of National Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -144,7 +135,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/SwitzerlandBaseTestCase.php b/tests/Switzerland/SwitzerlandBaseTestCase.php index 129770f0b..94f05a17b 100644 --- a/tests/Switzerland/SwitzerlandBaseTestCase.php +++ b/tests/Switzerland/SwitzerlandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/SwitzerlandTest.php b/tests/Switzerland/SwitzerlandTest.php index 1aab01217..96273d766 100644 --- a/tests/Switzerland/SwitzerlandTest.php +++ b/tests/Switzerland/SwitzerlandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class SwitzerlandTest extends SwitzerlandBaseTestCase implements ProviderTestCas /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Switzerland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Switzerland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -67,8 +64,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Switzerland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -77,8 +72,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Switzerland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -87,8 +80,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Switzerland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -96,7 +87,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Thurgau/AscensionDayTest.php b/tests/Switzerland/Thurgau/AscensionDayTest.php index 808c6c865..ba2f52f0d 100644 --- a/tests/Switzerland/Thurgau/AscensionDayTest.php +++ b/tests/Switzerland/Thurgau/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends ThurgauBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/BerchtoldsTagTest.php b/tests/Switzerland/Thurgau/BerchtoldsTagTest.php index f8a25f391..df254545b 100644 --- a/tests/Switzerland/Thurgau/BerchtoldsTagTest.php +++ b/tests/Switzerland/Thurgau/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends ThurgauBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/ChristmasDayTest.php b/tests/Switzerland/Thurgau/ChristmasDayTest.php index 1827fd155..8f7bfadab 100644 --- a/tests/Switzerland/Thurgau/ChristmasDayTest.php +++ b/tests/Switzerland/Thurgau/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends ThurgauBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/EasterMondayTest.php b/tests/Switzerland/Thurgau/EasterMondayTest.php index 1ae22747f..e55282c65 100644 --- a/tests/Switzerland/Thurgau/EasterMondayTest.php +++ b/tests/Switzerland/Thurgau/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends ThurgauBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/GoodFridayTest.php b/tests/Switzerland/Thurgau/GoodFridayTest.php index ff1f43abe..dad619805 100644 --- a/tests/Switzerland/Thurgau/GoodFridayTest.php +++ b/tests/Switzerland/Thurgau/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends ThurgauBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/NewYearsDayTest.php b/tests/Switzerland/Thurgau/NewYearsDayTest.php index 613306be1..574140ffc 100644 --- a/tests/Switzerland/Thurgau/NewYearsDayTest.php +++ b/tests/Switzerland/Thurgau/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ThurgauBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Thurgau/PentecostMondayTest.php b/tests/Switzerland/Thurgau/PentecostMondayTest.php index e7ba6ac25..e407336e5 100644 --- a/tests/Switzerland/Thurgau/PentecostMondayTest.php +++ b/tests/Switzerland/Thurgau/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends ThurgauBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/StStephensDayTest.php b/tests/Switzerland/Thurgau/StStephensDayTest.php index a22751424..d8f0490b5 100644 --- a/tests/Switzerland/Thurgau/StStephensDayTest.php +++ b/tests/Switzerland/Thurgau/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends ThurgauBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Thurgau/ThurgauBaseTestCase.php b/tests/Switzerland/Thurgau/ThurgauBaseTestCase.php index e4c5ce931..24d167269 100644 --- a/tests/Switzerland/Thurgau/ThurgauBaseTestCase.php +++ b/tests/Switzerland/Thurgau/ThurgauBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Thurgau/ThurgauTest.php b/tests/Switzerland/Thurgau/ThurgauTest.php index 30f1f6704..827d0b5ce 100644 --- a/tests/Switzerland/Thurgau/ThurgauTest.php +++ b/tests/Switzerland/Thurgau/ThurgauTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ThurgauTest extends ThurgauBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -72,8 +69,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -87,8 +82,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -97,8 +90,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -107,8 +98,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Thurgau (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -116,7 +105,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Thurgau/WorkersDayTest.php b/tests/Switzerland/Thurgau/WorkersDayTest.php index f802ff2f4..d6902258b 100644 --- a/tests/Switzerland/Thurgau/WorkersDayTest.php +++ b/tests/Switzerland/Thurgau/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Thurgau; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends ThurgauBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/AllSaintsDayTest.php b/tests/Switzerland/Ticino/AllSaintsDayTest.php index ba67385a9..56c67daa9 100644 --- a/tests/Switzerland/Ticino/AllSaintsDayTest.php +++ b/tests/Switzerland/Ticino/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Ticino/AscensionDayTest.php b/tests/Switzerland/Ticino/AscensionDayTest.php index e4e23dd8d..95b790a96 100644 --- a/tests/Switzerland/Ticino/AscensionDayTest.php +++ b/tests/Switzerland/Ticino/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends TicinoBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/AssumptionOfMaryTest.php b/tests/Switzerland/Ticino/AssumptionOfMaryTest.php index 8fea858c8..06f36b51a 100644 --- a/tests/Switzerland/Ticino/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Ticino/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Ticino/ChristmasDayTest.php b/tests/Switzerland/Ticino/ChristmasDayTest.php index 51fbd26a3..0d3ea014b 100644 --- a/tests/Switzerland/Ticino/ChristmasDayTest.php +++ b/tests/Switzerland/Ticino/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/CorpusChristiTest.php b/tests/Switzerland/Ticino/CorpusChristiTest.php index 458d8ffdb..57aa18fc7 100644 --- a/tests/Switzerland/Ticino/CorpusChristiTest.php +++ b/tests/Switzerland/Ticino/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends TicinoBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/EasterMondayTest.php b/tests/Switzerland/Ticino/EasterMondayTest.php index dbd42a209..429d04b76 100644 --- a/tests/Switzerland/Ticino/EasterMondayTest.php +++ b/tests/Switzerland/Ticino/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends TicinoBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/EpiphanyTest.php b/tests/Switzerland/Ticino/EpiphanyTest.php index 348b6e544..9c6e3880a 100644 --- a/tests/Switzerland/Ticino/EpiphanyTest.php +++ b/tests/Switzerland/Ticino/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/ImmaculateConceptionTest.php b/tests/Switzerland/Ticino/ImmaculateConceptionTest.php index 95214fae2..5de28c5eb 100644 --- a/tests/Switzerland/Ticino/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Ticino/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends TicinoBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/NewYearsDayTest.php b/tests/Switzerland/Ticino/NewYearsDayTest.php index 1dabc57c7..49fe001b5 100644 --- a/tests/Switzerland/Ticino/NewYearsDayTest.php +++ b/tests/Switzerland/Ticino/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Ticino/PentecostMondayTest.php b/tests/Switzerland/Ticino/PentecostMondayTest.php index 0b9d28174..5d221c4a3 100644 --- a/tests/Switzerland/Ticino/PentecostMondayTest.php +++ b/tests/Switzerland/Ticino/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends TicinoBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/StJosephDayTest.php b/tests/Switzerland/Ticino/StJosephDayTest.php index 8b3e0e13d..f587bca7a 100644 --- a/tests/Switzerland/Ticino/StJosephDayTest.php +++ b/tests/Switzerland/Ticino/StJosephDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StJosephDayTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider StJosephDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStJosephDay(int $year, DateTime $expected): void + public function testStJosephDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testStJosephDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day + * @return array list of test dates for St. Joseph's Day * - * @throws Exception + * @throws \Exception */ public function StJosephDayDataProvider(): array { @@ -63,7 +58,7 @@ public function StJosephDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/StPeterPaulTest.php b/tests/Switzerland/Ticino/StPeterPaulTest.php index e1e7667a9..bb0b900db 100644 --- a/tests/Switzerland/Ticino/StPeterPaulTest.php +++ b/tests/Switzerland/Ticino/StPeterPaulTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StPeterPaulTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider StPeterPaulDataProvider * - * @param int $year the year for which Feast of Saints Peter and Paul needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Feast of Saints Peter and Paul needs to be tested + * @param \DateTime $expected the expected date */ - public function testStPeterPaul(int $year, DateTime $expected): void + public function testStPeterPaul(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testStPeterPaul(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Feast of Saints Peter and Paul. * - * @return array list of test dates for Feast of Saints Peter and Paul + * @return array list of test dates for Feast of Saints Peter and Paul * - * @throws Exception + * @throws \Exception */ public function StPeterPaulDataProvider(): array { @@ -60,7 +55,7 @@ public function StPeterPaulDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/StStephensDayTest.php b/tests/Switzerland/Ticino/StStephensDayTest.php index 71b9f62c4..1431db9f8 100644 --- a/tests/Switzerland/Ticino/StStephensDayTest.php +++ b/tests/Switzerland/Ticino/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends TicinoBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Ticino/TicinoBaseTestCase.php b/tests/Switzerland/Ticino/TicinoBaseTestCase.php index 3baab4d36..72ef0818d 100644 --- a/tests/Switzerland/Ticino/TicinoBaseTestCase.php +++ b/tests/Switzerland/Ticino/TicinoBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Ticino/TicinoTest.php b/tests/Switzerland/Ticino/TicinoTest.php index 549853f56..bbdae1503 100644 --- a/tests/Switzerland/Ticino/TicinoTest.php +++ b/tests/Switzerland/Ticino/TicinoTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class TicinoTest extends TicinoBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -77,8 +74,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -92,8 +87,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -102,8 +95,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -112,8 +103,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Ticino (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -121,7 +110,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Ticino/WorkersDayTest.php b/tests/Switzerland/Ticino/WorkersDayTest.php index 77ee0c689..27cecf5b1 100644 --- a/tests/Switzerland/Ticino/WorkersDayTest.php +++ b/tests/Switzerland/Ticino/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Ticino; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends TicinoBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/AllSaintsDayTest.php b/tests/Switzerland/Uri/AllSaintsDayTest.php index 30b09f5fc..6e5152349 100644 --- a/tests/Switzerland/Uri/AllSaintsDayTest.php +++ b/tests/Switzerland/Uri/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Uri/AscensionDayTest.php b/tests/Switzerland/Uri/AscensionDayTest.php index 2b6a2adc2..18df46b07 100644 --- a/tests/Switzerland/Uri/AscensionDayTest.php +++ b/tests/Switzerland/Uri/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends UriBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/AssumptionOfMaryTest.php b/tests/Switzerland/Uri/AssumptionOfMaryTest.php index d4e5a8c04..23b4067d9 100644 --- a/tests/Switzerland/Uri/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Uri/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Uri/ChristmasDayTest.php b/tests/Switzerland/Uri/ChristmasDayTest.php index 794ef9de5..6aab787a2 100644 --- a/tests/Switzerland/Uri/ChristmasDayTest.php +++ b/tests/Switzerland/Uri/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/CorpusChristiTest.php b/tests/Switzerland/Uri/CorpusChristiTest.php index 0293d9e1e..edf0746a1 100644 --- a/tests/Switzerland/Uri/CorpusChristiTest.php +++ b/tests/Switzerland/Uri/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends UriBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/EasterMondayTest.php b/tests/Switzerland/Uri/EasterMondayTest.php index c2da0431a..fa7422c58 100644 --- a/tests/Switzerland/Uri/EasterMondayTest.php +++ b/tests/Switzerland/Uri/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends UriBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/EpiphanyTest.php b/tests/Switzerland/Uri/EpiphanyTest.php index 78bedef36..3ce4fe3a2 100644 --- a/tests/Switzerland/Uri/EpiphanyTest.php +++ b/tests/Switzerland/Uri/EpiphanyTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class EpiphanyTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/GoodFridayTest.php b/tests/Switzerland/Uri/GoodFridayTest.php index 66dbdf721..22775b9c0 100644 --- a/tests/Switzerland/Uri/GoodFridayTest.php +++ b/tests/Switzerland/Uri/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends UriBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/ImmaculateConceptionTest.php b/tests/Switzerland/Uri/ImmaculateConceptionTest.php index 1398afc53..901ffa5a6 100644 --- a/tests/Switzerland/Uri/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Uri/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends UriBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/NewYearsDayTest.php b/tests/Switzerland/Uri/NewYearsDayTest.php index d293e754c..29a00bc71 100644 --- a/tests/Switzerland/Uri/NewYearsDayTest.php +++ b/tests/Switzerland/Uri/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Uri/PentecostMondayTest.php b/tests/Switzerland/Uri/PentecostMondayTest.php index 56dc947a3..c6616e770 100644 --- a/tests/Switzerland/Uri/PentecostMondayTest.php +++ b/tests/Switzerland/Uri/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends UriBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/StJosephDayTest.php b/tests/Switzerland/Uri/StJosephDayTest.php index 5ee262165..fb037b49f 100644 --- a/tests/Switzerland/Uri/StJosephDayTest.php +++ b/tests/Switzerland/Uri/StJosephDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StJosephDayTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider StJosephDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStJosephDay(int $year, DateTime $expected): void + public function testStJosephDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testStJosephDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day + * @return array list of test dates for St. Joseph's Day * - * @throws Exception + * @throws \Exception */ public function StJosephDayDataProvider(): array { @@ -63,7 +58,7 @@ public function StJosephDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/StStephensDayTest.php b/tests/Switzerland/Uri/StStephensDayTest.php index 44d4b1d81..3902969fb 100644 --- a/tests/Switzerland/Uri/StStephensDayTest.php +++ b/tests/Switzerland/Uri/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends UriBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Uri/UriBaseTestCase.php b/tests/Switzerland/Uri/UriBaseTestCase.php index 7d01f0c43..a1e6d2666 100644 --- a/tests/Switzerland/Uri/UriBaseTestCase.php +++ b/tests/Switzerland/Uri/UriBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Uri/UriTest.php b/tests/Switzerland/Uri/UriTest.php index 491aebf1c..9de235604 100644 --- a/tests/Switzerland/Uri/UriTest.php +++ b/tests/Switzerland/Uri/UriTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Uri; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class UriTest extends UriBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -76,8 +73,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -91,8 +86,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -101,8 +94,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -111,8 +102,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Uri (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -120,7 +109,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Valais/AllSaintsDayTest.php b/tests/Switzerland/Valais/AllSaintsDayTest.php index 0e65de541..87afc67d5 100644 --- a/tests/Switzerland/Valais/AllSaintsDayTest.php +++ b/tests/Switzerland/Valais/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends ValaisBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Valais/AscensionDayTest.php b/tests/Switzerland/Valais/AscensionDayTest.php index c9c0accd0..009f28d93 100644 --- a/tests/Switzerland/Valais/AscensionDayTest.php +++ b/tests/Switzerland/Valais/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends ValaisBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Valais/AssumptionOfMaryTest.php b/tests/Switzerland/Valais/AssumptionOfMaryTest.php index 15e6a4ccf..73622174b 100644 --- a/tests/Switzerland/Valais/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Valais/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends ValaisBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Valais/ChristmasDayTest.php b/tests/Switzerland/Valais/ChristmasDayTest.php index d21a97b4c..9c3a827b8 100644 --- a/tests/Switzerland/Valais/ChristmasDayTest.php +++ b/tests/Switzerland/Valais/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends ValaisBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Valais/CorpusChristiTest.php b/tests/Switzerland/Valais/CorpusChristiTest.php index 3d73b2672..f3183d82d 100644 --- a/tests/Switzerland/Valais/CorpusChristiTest.php +++ b/tests/Switzerland/Valais/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends ValaisBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Valais/ImmaculateConceptionTest.php b/tests/Switzerland/Valais/ImmaculateConceptionTest.php index cbee831b4..dce166407 100644 --- a/tests/Switzerland/Valais/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Valais/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends ValaisBaseTestCase implements HolidayTest * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Valais/NewYearsDayTest.php b/tests/Switzerland/Valais/NewYearsDayTest.php index 6e198deb5..e0d44efc5 100644 --- a/tests/Switzerland/Valais/NewYearsDayTest.php +++ b/tests/Switzerland/Valais/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ValaisBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Valais/StJosephDayTest.php b/tests/Switzerland/Valais/StJosephDayTest.php index 6d2d589d0..43e3941a5 100644 --- a/tests/Switzerland/Valais/StJosephDayTest.php +++ b/tests/Switzerland/Valais/StJosephDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -38,12 +35,10 @@ class StJosephDayTest extends ValaisBaseTestCase implements HolidayTestCase * * @dataProvider StJosephDayDataProvider * - * @param int $year the year for which St. Joseph's Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which St. Joseph's Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testStJosephDay(int $year, DateTime $expected): void + public function testStJosephDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -51,9 +46,9 @@ public function testStJosephDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of St. Joseph's Day. * - * @return array list of test dates for St. Joseph's Day + * @return array list of test dates for St. Joseph's Day * - * @throws Exception + * @throws \Exception */ public function StJosephDayDataProvider(): array { @@ -63,7 +58,7 @@ public function StJosephDayDataProvider(): array /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -78,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Valais/ValaisBaseTestCase.php b/tests/Switzerland/Valais/ValaisBaseTestCase.php index fff31da8d..845e8dd91 100644 --- a/tests/Switzerland/Valais/ValaisBaseTestCase.php +++ b/tests/Switzerland/Valais/ValaisBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Valais/ValaisTest.php b/tests/Switzerland/Valais/ValaisTest.php index 3d7199e3e..958d52f77 100644 --- a/tests/Switzerland/Valais/ValaisTest.php +++ b/tests/Switzerland/Valais/ValaisTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Valais; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ValaisTest extends ValaisBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Valais (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Vaud/AscensionDayTest.php b/tests/Switzerland/Vaud/AscensionDayTest.php index 6a033fcfb..49b704f84 100644 --- a/tests/Switzerland/Vaud/AscensionDayTest.php +++ b/tests/Switzerland/Vaud/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/BerchtoldsTagTest.php b/tests/Switzerland/Vaud/BerchtoldsTagTest.php index 3b2b066df..0bd7d4339 100644 --- a/tests/Switzerland/Vaud/BerchtoldsTagTest.php +++ b/tests/Switzerland/Vaud/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/BettagsMontagTest.php b/tests/Switzerland/Vaud/BettagsMontagTest.php index 91683f0f6..64c694f75 100644 --- a/tests/Switzerland/Vaud/BettagsMontagTest.php +++ b/tests/Switzerland/Vaud/BettagsMontagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,17 +30,16 @@ class BettagsMontagTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests Bettags Montag on or after 1832. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBettagsMontagOnAfter1832(): void { $year = $this->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')); + $date->add(new \DateInterval('P1D')); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } @@ -53,7 +47,7 @@ public function testBettagsMontagOnAfter1832(): void /** * Tests Bettags Montag before 1832. * - * @throws ReflectionException + * @throws \Exception */ public function testBettagsMontagBefore1832(): void { @@ -64,7 +58,7 @@ public function testBettagsMontagBefore1832(): void /** * Tests translated name of Bettags Montag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -79,7 +73,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/ChristmasDayTest.php b/tests/Switzerland/Vaud/ChristmasDayTest.php index aa41921fa..ccd47c82d 100644 --- a/tests/Switzerland/Vaud/ChristmasDayTest.php +++ b/tests/Switzerland/Vaud/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends VaudBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/EasterMondayTest.php b/tests/Switzerland/Vaud/EasterMondayTest.php index 482b041c2..d36d6b408 100644 --- a/tests/Switzerland/Vaud/EasterMondayTest.php +++ b/tests/Switzerland/Vaud/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/GoodFridayTest.php b/tests/Switzerland/Vaud/GoodFridayTest.php index 16ea9b198..2f9ad595b 100644 --- a/tests/Switzerland/Vaud/GoodFridayTest.php +++ b/tests/Switzerland/Vaud/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/NewYearsDayTest.php b/tests/Switzerland/Vaud/NewYearsDayTest.php index d46863bd3..a9faea455 100644 --- a/tests/Switzerland/Vaud/NewYearsDayTest.php +++ b/tests/Switzerland/Vaud/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends VaudBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Vaud/PentecostMondayTest.php b/tests/Switzerland/Vaud/PentecostMondayTest.php index b114c71fa..305e16027 100644 --- a/tests/Switzerland/Vaud/PentecostMondayTest.php +++ b/tests/Switzerland/Vaud/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends VaudBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Vaud/VaudBaseTestCase.php b/tests/Switzerland/Vaud/VaudBaseTestCase.php index 2fdacb092..c45d2592d 100644 --- a/tests/Switzerland/Vaud/VaudBaseTestCase.php +++ b/tests/Switzerland/Vaud/VaudBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Vaud/VaudTest.php b/tests/Switzerland/Vaud/VaudTest.php index 76cbe97bd..617ac7be4 100644 --- a/tests/Switzerland/Vaud/VaudTest.php +++ b/tests/Switzerland/Vaud/VaudTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Vaud; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class VaudTest extends VaudBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Vaud (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Zug/AllSaintsDayTest.php b/tests/Switzerland/Zug/AllSaintsDayTest.php index 9af38a68d..2a1cf4d07 100644 --- a/tests/Switzerland/Zug/AllSaintsDayTest.php +++ b/tests/Switzerland/Zug/AllSaintsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AllSaintsDayTest extends ZugBaseTestCase implements HolidayTestCase * * @dataProvider AllSaintsDayDataProvider * - * @param int $year the year for which All Saints' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which All Saints' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testAllSaintsDay(int $year, DateTime $expected): void + public function testAllSaintsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAllSaintsDay(int $year, DateTime $expected): void /** * Tests translated name of All Saints' Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of All Saints' Day. * - * @return array list of test dates for All Saints' Day + * @return array list of test dates for All Saints' Day * - * @throws Exception + * @throws \Exception */ public function AllSaintsDayDataProvider(): array { diff --git a/tests/Switzerland/Zug/AscensionDayTest.php b/tests/Switzerland/Zug/AscensionDayTest.php index 01a2e35a7..d3e3edb5b 100644 --- a/tests/Switzerland/Zug/AscensionDayTest.php +++ b/tests/Switzerland/Zug/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/AssumptionOfMaryTest.php b/tests/Switzerland/Zug/AssumptionOfMaryTest.php index e16cfbb07..18bacb8b3 100644 --- a/tests/Switzerland/Zug/AssumptionOfMaryTest.php +++ b/tests/Switzerland/Zug/AssumptionOfMaryTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class AssumptionOfMaryTest extends ZugBaseTestCase implements HolidayTestCase * * @dataProvider AssumptionOfMaryDataProvider * - * @param int $year the year for which the day of the Assumption of Mary needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the day of the Assumption of Mary needs to be tested + * @param \DateTime $expected the expected date */ - public function testAssumptionOfMary(int $year, DateTime $expected): void + public function testAssumptionOfMary(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testAssumptionOfMary(int $year, DateTime $expected): void /** * Tests translated name of the day of the Assumption of Mary. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of the day of the Assumption of Mary. * - * @return array list of test dates for the day of the Assumption of Mary + * @return array list of test dates for the day of the Assumption of Mary * - * @throws Exception + * @throws \Exception */ public function AssumptionOfMaryDataProvider(): array { diff --git a/tests/Switzerland/Zug/BerchtoldsTagTest.php b/tests/Switzerland/Zug/BerchtoldsTagTest.php index 0e21d1409..6c8f45291 100644 --- a/tests/Switzerland/Zug/BerchtoldsTagTest.php +++ b/tests/Switzerland/Zug/BerchtoldsTagTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,13 +30,12 @@ class BerchtoldsTagTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests BerchtoldsTag. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testBerchtoldsTag(): void { $year = $this->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); @@ -49,7 +44,7 @@ public function testBerchtoldsTag(): void /** * Tests translated name of BerchtoldsTag. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -64,7 +59,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/ChristmasDayTest.php b/tests/Switzerland/Zug/ChristmasDayTest.php index ea82e7b80..c797fab4e 100644 --- a/tests/Switzerland/Zug/ChristmasDayTest.php +++ b/tests/Switzerland/Zug/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends ZugBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/CorpusChristiTest.php b/tests/Switzerland/Zug/CorpusChristiTest.php index 07687af9e..69b22334f 100644 --- a/tests/Switzerland/Zug/CorpusChristiTest.php +++ b/tests/Switzerland/Zug/CorpusChristiTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateInterval; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\Provider\ChristianHolidays; use Yasumi\tests\HolidayTestCase; @@ -36,8 +33,7 @@ class CorpusChristiTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests Corpus Christi. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testCorpusChristi(): void { @@ -46,14 +42,14 @@ public function testCorpusChristi(): void self::REGION, self::HOLIDAY, $year, - $this->calculateEaster($year, self::TIMEZONE)->add(new DateInterval('P60D')) + $this->calculateEaster($year, self::TIMEZONE)->add(new \DateInterval('P60D')) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +64,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/EasterMondayTest.php b/tests/Switzerland/Zug/EasterMondayTest.php index 155dcac3b..3f7f6b358 100644 --- a/tests/Switzerland/Zug/EasterMondayTest.php +++ b/tests/Switzerland/Zug/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/GoodFridayTest.php b/tests/Switzerland/Zug/GoodFridayTest.php index 285cb82a8..272c62140 100644 --- a/tests/Switzerland/Zug/GoodFridayTest.php +++ b/tests/Switzerland/Zug/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/ImmaculateConceptionTest.php b/tests/Switzerland/Zug/ImmaculateConceptionTest.php index 33e671c0b..f149046a3 100644 --- a/tests/Switzerland/Zug/ImmaculateConceptionTest.php +++ b/tests/Switzerland/Zug/ImmaculateConceptionTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ImmaculateConceptionTest extends ZugBaseTestCase implements HolidayTestCas * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the day of the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/NewYearsDayTest.php b/tests/Switzerland/Zug/NewYearsDayTest.php index 5d0083bdc..ba63a61b1 100644 --- a/tests/Switzerland/Zug/NewYearsDayTest.php +++ b/tests/Switzerland/Zug/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ZugBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Zug/PentecostMondayTest.php b/tests/Switzerland/Zug/PentecostMondayTest.php index 51b48e677..f0c13bf25 100644 --- a/tests/Switzerland/Zug/PentecostMondayTest.php +++ b/tests/Switzerland/Zug/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends ZugBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/StStephensDayTest.php b/tests/Switzerland/Zug/StStephensDayTest.php index 425036125..37b66f0aa 100644 --- a/tests/Switzerland/Zug/StStephensDayTest.php +++ b/tests/Switzerland/Zug/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends ZugBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zug/ZugBaseTestCase.php b/tests/Switzerland/Zug/ZugBaseTestCase.php index be4a12150..f9ea8c267 100644 --- a/tests/Switzerland/Zug/ZugBaseTestCase.php +++ b/tests/Switzerland/Zug/ZugBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Zug/ZugTest.php b/tests/Switzerland/Zug/ZugTest.php index 007de3982..2ba36d39b 100644 --- a/tests/Switzerland/Zug/ZugTest.php +++ b/tests/Switzerland/Zug/ZugTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Zug; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ZugTest extends ZugBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -75,8 +72,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -90,8 +85,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -100,8 +93,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -110,8 +101,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Zug (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -119,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Switzerland/Zurich/AscensionDayTest.php b/tests/Switzerland/Zurich/AscensionDayTest.php index d4eb92dae..288aebce8 100644 --- a/tests/Switzerland/Zurich/AscensionDayTest.php +++ b/tests/Switzerland/Zurich/AscensionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class AscensionDayTest extends ZurichBaseTestCase implements HolidayTestCase /** * Tests Ascension Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testAscensionDay(): void { @@ -44,14 +39,14 @@ public function testAscensionDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-16", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-16", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Ascension Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/ChristmasDayTest.php b/tests/Switzerland/Zurich/ChristmasDayTest.php index 33081c3c6..e3daeafbe 100644 --- a/tests/Switzerland/Zurich/ChristmasDayTest.php +++ b/tests/Switzerland/Zurich/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends ZurichBaseTestCase implements HolidayTestCase * * @dataProvider ChristmasDayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of Christmas Day. * - * @return array list of test dates for Christmas Day + * @return array list of test dates for Christmas Day * - * @throws Exception + * @throws \Exception */ public function ChristmasDayDataProvider(): array { @@ -60,7 +55,7 @@ public function ChristmasDayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/EasterMondayTest.php b/tests/Switzerland/Zurich/EasterMondayTest.php index 56d99ee15..526543b0f 100644 --- a/tests/Switzerland/Zurich/EasterMondayTest.php +++ b/tests/Switzerland/Zurich/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterMondayTest extends ZurichBaseTestCase implements HolidayTestCase /** * Tests Easter Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testEasterMonday(): void { @@ -44,14 +39,14 @@ public function testEasterMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Easter Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/GoodFridayTest.php b/tests/Switzerland/Zurich/GoodFridayTest.php index 6fd945738..9a3a61310 100644 --- a/tests/Switzerland/Zurich/GoodFridayTest.php +++ b/tests/Switzerland/Zurich/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends ZurichBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-21", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-21", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/NewYearsDayTest.php b/tests/Switzerland/Zurich/NewYearsDayTest.php index 9378e4840..30c626306 100644 --- a/tests/Switzerland/Zurich/NewYearsDayTest.php +++ b/tests/Switzerland/Zurich/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends ZurichBaseTestCase implements HolidayTestCase * * @dataProvider NewYearsDayDataProvider * - * @param int $year the year for which New Years Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which New Years Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testNewYearsDay(int $year, DateTime $expected): void + public function testNewYearsDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testNewYearsDay(int $year, DateTime $expected): void /** * Tests translated name of New Years Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of New Years Day. * - * @return array list of test dates for New Years Day + * @return array list of test dates for New Years Day * - * @throws Exception + * @throws \Exception */ public function NewYearsDayDataProvider(): array { diff --git a/tests/Switzerland/Zurich/PentecostMondayTest.php b/tests/Switzerland/Zurich/PentecostMondayTest.php index 4b43eb833..31a61d98e 100644 --- a/tests/Switzerland/Zurich/PentecostMondayTest.php +++ b/tests/Switzerland/Zurich/PentecostMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostMondayTest extends ZurichBaseTestCase implements HolidayTestCase /** * Tests Pentecost Monday. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testPentecostMonday(): void { @@ -44,14 +39,14 @@ public function testPentecostMonday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of Pentecost Monday. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/StStephensDayTest.php b/tests/Switzerland/Zurich/StStephensDayTest.php index cd8da2b5e..94f679654 100644 --- a/tests/Switzerland/Zurich/StStephensDayTest.php +++ b/tests/Switzerland/Zurich/StStephensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class StStephensDayTest extends ZurichBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/WorkersDayTest.php b/tests/Switzerland/Zurich/WorkersDayTest.php index a3ff927f2..9ae3c7ccc 100644 --- a/tests/Switzerland/Zurich/WorkersDayTest.php +++ b/tests/Switzerland/Zurich/WorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,21 +35,20 @@ class WorkersDayTest extends ZurichBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); } /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -61,7 +56,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-5-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-5-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -86,7 +81,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Switzerland/Zurich/ZurichBaseTestCase.php b/tests/Switzerland/Zurich/ZurichBaseTestCase.php index 240fd2404..62e611d40 100644 --- a/tests/Switzerland/Zurich/ZurichBaseTestCase.php +++ b/tests/Switzerland/Zurich/ZurichBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Switzerland/Zurich/ZurichTest.php b/tests/Switzerland/Zurich/ZurichTest.php index 69aa7d830..429c61774 100644 --- a/tests/Switzerland/Zurich/ZurichTest.php +++ b/tests/Switzerland/Zurich/ZurichTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Switzerland\Zurich; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ZurichTest extends ZurichBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -52,8 +51,6 @@ public function testOfficialHolidays(): void /** * Tests if all regional holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testRegionalHolidays(): void { @@ -71,8 +68,6 @@ public function testRegionalHolidays(): void /** * Tests if all observed holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -86,8 +81,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -96,8 +89,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -106,8 +97,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Zurich (Switzerland) are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -115,7 +104,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Turkey/CommemorationOfAtaturkTest.php b/tests/Turkey/CommemorationOfAtaturkTest.php index 0867b75e9..c3e9c8f0c 100644 --- a/tests/Turkey/CommemorationOfAtaturkTest.php +++ b/tests/Turkey/CommemorationOfAtaturkTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -26,7 +25,7 @@ class CommemorationOfAtaturkTest extends TurkeyBaseTestCase implements HolidayTe public const ESTABLISHMENT_YEAR = 1920; /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -38,7 +37,6 @@ public function testHolidayBeforeEstablishment(): void } /** - * @throws ReflectionException * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void @@ -53,7 +51,7 @@ public function testHolidayOnAfterEstablishment(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +64,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Turkey/DemocracyDayTest.php b/tests/Turkey/DemocracyDayTest.php index c1417c808..678863e9e 100644 --- a/tests/Turkey/DemocracyDayTest.php +++ b/tests/Turkey/DemocracyDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -26,7 +25,7 @@ class DemocracyDayTest extends TurkeyBaseTestCase implements HolidayTestCase public const ESTABLISHMENT_YEAR = 2017; /** - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -41,7 +40,7 @@ public function testHoliday(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -53,7 +52,7 @@ public function testHolidayBeforeEstablishment(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +65,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Turkey/LabourDayTest.php b/tests/Turkey/LabourDayTest.php index 3657db65f..d0da8e5c0 100644 --- a/tests/Turkey/LabourDayTest.php +++ b/tests/Turkey/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Turkey; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -27,18 +24,16 @@ class LabourDayTest extends TurkeyBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -51,7 +46,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -64,9 +59,9 @@ public function testHolidayType(): void } /** - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { diff --git a/tests/Turkey/NationalSovereigntyDayTest.php b/tests/Turkey/NationalSovereigntyDayTest.php index b8d7352bb..10eb1c457 100644 --- a/tests/Turkey/NationalSovereigntyDayTest.php +++ b/tests/Turkey/NationalSovereigntyDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -30,7 +29,7 @@ class NationalSovereigntyDayTest extends TurkeyBaseTestCase implements HolidayTe public const NAME_CHANGED_YEAR = 1981; /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -42,7 +41,6 @@ public function testHolidayBeforeEstablishment(): void } /** - * @throws ReflectionException * @throws \Exception */ public function testHolidayOnAfterEstablishment(): void @@ -57,7 +55,7 @@ public function testHolidayOnAfterEstablishment(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -70,7 +68,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslationOnAfterNameChange(): void { @@ -83,7 +81,7 @@ public function testTranslationOnAfterNameChange(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Turkey/NewYearsDayTest.php b/tests/Turkey/NewYearsDayTest.php index 3558ffbc7..7c72180b2 100644 --- a/tests/Turkey/NewYearsDayTest.php +++ b/tests/Turkey/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Turkey; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -27,20 +24,18 @@ class NewYearsDayTest extends TurkeyBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } /** - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -48,7 +43,7 @@ public function HolidayDataProvider(): array } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -61,7 +56,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Turkey/RepublicDayTest.php b/tests/Turkey/RepublicDayTest.php index 770a788f3..820d41a86 100644 --- a/tests/Turkey/RepublicDayTest.php +++ b/tests/Turkey/RepublicDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -26,7 +25,7 @@ class RepublicDayTest extends TurkeyBaseTestCase implements HolidayTestCase public const ESTABLISHMENT_YEAR = 1924; /** - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -41,7 +40,7 @@ public function testHoliday(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -53,7 +52,7 @@ public function testHolidayBeforeEstablishment(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +65,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Turkey/TurkeyBaseTestCase.php b/tests/Turkey/TurkeyBaseTestCase.php old mode 100755 new mode 100644 index 20c8b26ef..c6d3dcee7 --- a/tests/Turkey/TurkeyBaseTestCase.php +++ b/tests/Turkey/TurkeyBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Turkey/TurkeyTest.php b/tests/Turkey/TurkeyTest.php old mode 100755 new mode 100644 index 1edffc74c..096392362 --- a/tests/Turkey/TurkeyTest.php +++ b/tests/Turkey/TurkeyTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,14 +25,14 @@ class TurkeyTest extends TurkeyBaseTestCase implements ProviderTestCase */ protected int $year; + /** + * @throws \Exception + */ protected function setUp(): void { $this->year = $this->generateRandomYear(); } - /** - * @throws ReflectionException - */ public function testOfficialHolidays(): void { $holidays = [ @@ -69,9 +68,6 @@ public function testOfficialHolidays(): void $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL); } - /** - * @throws ReflectionException - */ public function testObservedHolidays(): void { $holidays = []; @@ -83,32 +79,24 @@ public function testObservedHolidays(): void $this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OBSERVANCE); } - /** - * @throws ReflectionException - */ public function testSeasonalHolidays(): void { $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_SEASON); } - /** - * @throws ReflectionException - */ public function testBankHolidays(): void { $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_BANK); } - /** - * @throws ReflectionException - */ public function testOtherHolidays(): void { $this->assertDefinedHolidays([], self::REGION, $this->year, Holiday::TYPE_OTHER); } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Turkey/VictoryDayTest.php b/tests/Turkey/VictoryDayTest.php index 9d796b035..de13145f7 100644 --- a/tests/Turkey/VictoryDayTest.php +++ b/tests/Turkey/VictoryDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\Turkey; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -28,7 +27,7 @@ class VictoryDayTest extends TurkeyBaseTestCase implements HolidayTestCase public const CELEBRATION_YEAR = 1923; /** - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -43,7 +42,7 @@ public function testHoliday(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeCelebration(): void { @@ -55,7 +54,7 @@ public function testHolidayBeforeCelebration(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -68,7 +67,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -81,7 +80,7 @@ public function testHolidayType(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayTypeBeforeEstablishment(): void { diff --git a/tests/USA/ChristmasDayTest.php b/tests/USA/ChristmasDayTest.php index 41405bed3..7ce9ee59d 100644 --- a/tests/USA/ChristmasDayTest.php +++ b/tests/USA/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class ChristmasDayTest extends USABaseTestCase implements HolidayTestCase /** * Tests Christmas Day. Christmas Day is celebrated on December 25th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDay(): void { @@ -44,15 +39,14 @@ public function testChristmasDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Christmas Day substituted on Monday (when Christmas Day falls on Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDaySubstitutedMonday(): void { @@ -62,15 +56,14 @@ public function testChristmasDaySubstitutedMonday(): void self::REGION, 'substituteHoliday:christmasDay', $year, - new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Christmas Day substituted on Monday (when Christmas Day falls on Saturday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testChristmasDaySubstitutedFriday(): void { @@ -80,14 +73,14 @@ public function testChristmasDaySubstitutedFriday(): void self::REGION, 'substituteHoliday:christmasDay', $year, - new DateTime("$year-12-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -102,7 +95,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/ColumbusDayTest.php b/tests/USA/ColumbusDayTest.php index 100cf175f..e883ee4fe 100644 --- a/tests/USA/ColumbusDayTest.php +++ b/tests/USA/ColumbusDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ColumbusDayTest extends USABaseTestCase implements HolidayTestCase * Tests Columbus Day on or after 1970. Columbus Day was established in 1937 on October 12th, but has been fixed to * the second Monday in October since 1970. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testColumbusDayOnAfter1970(): void { @@ -50,7 +45,7 @@ public function testColumbusDayOnAfter1970(): void self::REGION, self::HOLIDAY, $year, - new DateTime("second monday of october $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("second monday of october $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testColumbusDayOnAfter1970(): void * Tests Columbus Day between 1937 and 1969. Columbus Day was established in 1937 on October 12th, but has been * fixed to the second Monday in October since 1970. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testColumbusBetween1937And1969(): void { @@ -68,7 +62,7 @@ public function testColumbusBetween1937And1969(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-12", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,7 +70,7 @@ public function testColumbusBetween1937And1969(): void * Tests Columbus Day before 1937. Columbus Day was established in 1937 on October 12th, but has been fixed to * the second Monday in October since 1970. * - * @throws ReflectionException + * @throws \Exception */ public function testColumbusDayBefore1937(): void { @@ -90,7 +84,7 @@ public function testColumbusDayBefore1937(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/IndependenceDayTest.php b/tests/USA/IndependenceDayTest.php index da1e3dac2..6daa8d790 100644 --- a/tests/USA/IndependenceDayTest.php +++ b/tests/USA/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class IndependenceDayTest extends USABaseTestCase implements HolidayTestCase /** * Tests Independence Day on or after 1776. Independence Day is celebrated since 1776 on July 4th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayOnAfter1776(): void { @@ -49,15 +44,14 @@ public function testIndependenceDayOnAfter1776(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-7-4", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-4", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Independence Day on or after 1776 when substituted on Monday (when Independence Day falls on Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayOnAfter1776SubstitutedMonday(): void { @@ -66,15 +60,14 @@ public function testIndependenceDayOnAfter1776SubstitutedMonday(): void self::REGION, 'substituteHoliday:independenceDay', $year, - new DateTime("$year-7-5", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-5", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Independence Day on or after 1776 when substituted on Friday (when Independence Day falls on Saturday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayOnAfter1776SubstitutedFriday(): void { @@ -83,14 +76,14 @@ public function testIndependenceDayOnAfter1776SubstitutedFriday(): void self::REGION, 'substituteHoliday:independenceDay', $year, - new DateTime("$year-7-3", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-7-3", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Independence Day before 1776. Independence Day is celebrated since 1776 on July 4th. * - * @throws ReflectionException + * @throws \Exception */ public function testIndependenceDayBefore1776(): void { @@ -104,7 +97,7 @@ public function testIndependenceDayBefore1776(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -119,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/JuneteenthTest.php b/tests/USA/JuneteenthTest.php index 56427c7f6..c012f0cf7 100644 --- a/tests/USA/JuneteenthTest.php +++ b/tests/USA/JuneteenthTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class JuneteenthTest extends USABaseTestCase implements HolidayTestCase /** * Tests Juneteenth on or after 2021. Juneteenth is celebrated since 2021 on June 19th. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testJuneteenthOnAfter2021(): void { @@ -49,48 +44,46 @@ public function testJuneteenthOnAfter2021(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-6-19", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-19", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Juneteenth on or after 2021 when substituted on Monday (when Juneteenth falls on Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testJuneteenthOnAfter2021SubstitutedMonday(): void { $year = 2022; - $this->assertHoliday( + $this->assertSubstituteHoliday( self::REGION, - 'substituteHoliday:juneteenth', + self::HOLIDAY, $year, - new DateTime("$year-6-20", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-20", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Juneteenth on or after 2021 when substituted on Friday (when Juneteenth falls on Saturday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testJuneteenthOnAfter2021SubstitutedFriday(): void { $year = 2021; - $this->assertHoliday( + $this->assertSubstituteHoliday( self::REGION, - 'substituteHoliday:juneteenth', + self::HOLIDAY, $year, - new DateTime("$year-6-18", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-6-18", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Juneteenth before 2021. Juneteenth is celebrated since 2021 on June 19th. * - * @throws ReflectionException + * @throws \Exception */ public function testJuneteenthBefore2021(): void { @@ -104,7 +97,7 @@ public function testJuneteenthBefore2021(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -119,7 +112,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/LabourDayTest.php b/tests/USA/LabourDayTest.php index 00f46ee78..6bd1129cd 100644 --- a/tests/USA/LabourDayTest.php +++ b/tests/USA/LabourDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class LabourDayTest extends USABaseTestCase implements HolidayTestCase /** * Tests Labour Day on or after 1887. Labour Day was established since 1887 on the first Monday of September. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testLabourDayOnAfter1887(): void { @@ -49,14 +44,14 @@ public function testLabourDayOnAfter1887(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of september $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of september $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Labour Day before 1887. Labour Day was established since 1887 on the first Monday of September. * - * @throws ReflectionException + * @throws \Exception */ public function testLabourDayBefore1887(): void { @@ -70,7 +65,7 @@ public function testLabourDayBefore1887(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/MartinLutherKingDayTest.php b/tests/USA/MartinLutherKingDayTest.php index 6151b1f97..c94ae1a05 100644 --- a/tests/USA/MartinLutherKingDayTest.php +++ b/tests/USA/MartinLutherKingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class MartinLutherKingDayTest extends USABaseTestCase implements HolidayTestCase * Tests Dr. Martin Luther King Day on or after 1986. Dr. Martin Luther King Day was established since 1986 on the * third Monday of January. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMartinLutherKingDayOnAfter1986(): void { @@ -50,7 +45,7 @@ public function testMartinLutherKingDayOnAfter1986(): void self::REGION, self::HOLIDAY, $year, - new DateTime("third monday of january $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third monday of january $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,7 +53,7 @@ public function testMartinLutherKingDayOnAfter1986(): void * Tests Dr. Martin Luther King Day before 1986. Dr. Martin Luther King Day was established since 1996 on the third * Monday of January. * - * @throws ReflectionException + * @throws \Exception */ public function testMartinLutherKingDayBefore1986(): void { @@ -72,7 +67,7 @@ public function testMartinLutherKingDayBefore1986(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -87,7 +82,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/MemorialDayTest.php b/tests/USA/MemorialDayTest.php index 880174a2c..8d84fd987 100644 --- a/tests/USA/MemorialDayTest.php +++ b/tests/USA/MemorialDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class MemorialDayTest extends USABaseTestCase implements HolidayTestCase * Tests Memorial Day on or after 1968. Memorial Day was established since 1865 on May 30 and was changed in 1968 * to the last Monday in May. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMemorialDayOnAfter1968(): void { @@ -50,7 +45,7 @@ public function testMemorialDayOnAfter1968(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last monday of may $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last monday of may $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testMemorialDayOnAfter1968(): void * Tests Memorial Day between 1865 and 1967. Memorial Day was established since 1865 on May 30 and was changed in * 1968 to the last Monday in May. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testMemorialDayBetween1865And1967(): void { @@ -68,7 +62,7 @@ public function testMemorialDayBetween1865And1967(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,7 +70,7 @@ public function testMemorialDayBetween1865And1967(): void * Tests Memorial Day before 1865. Memorial Day was established since 1865 on May 30 and was changed in 1968 to the * last Monday in May. * - * @throws ReflectionException + * @throws \Exception */ public function testMemorialDayBefore1865(): void { @@ -90,7 +84,7 @@ public function testMemorialDayBefore1865(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/NewYearsDayTest.php b/tests/USA/NewYearsDayTest.php index 24496b593..390705ea7 100644 --- a/tests/USA/NewYearsDayTest.php +++ b/tests/USA/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class NewYearsDayTest extends USABaseTestCase implements HolidayTestCase /** * Tests New Years Day. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDay(): void { @@ -44,15 +39,14 @@ public function testNewYearsDay(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests New Years Day when substituted on Monday (when New Years Day falls on Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDaySubstitutedMonday(): void { @@ -61,15 +55,14 @@ public function testNewYearsDaySubstitutedMonday(): void self::REGION, 'substituteHoliday:newYearsDay', $year, - new DateTime("$year-1-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-1-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests New Years Day when substituted on Friday (when New Years Day falls on Saturday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testNewYearsDaySubstitutedFriday(): void { @@ -79,14 +72,14 @@ public function testNewYearsDaySubstitutedFriday(): void self::REGION, 'substituteHoliday:newYearsDay', $year, - new DateTime("$subYear-12-31", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$subYear-12-31", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -101,7 +94,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/ThanksgivingDayTest.php b/tests/USA/ThanksgivingDayTest.php index bd581c37a..afd5645fb 100644 --- a/tests/USA/ThanksgivingDayTest.php +++ b/tests/USA/ThanksgivingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class ThanksgivingDayTest extends USABaseTestCase implements HolidayTestCase * Tests Thanksgiving Day on or after 1863. Thanksgiving Day is celebrated since 1863 on the fourth Thursday * of November. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testThanksgivingDayOnAfter1863(): void { @@ -50,7 +45,7 @@ public function testThanksgivingDayOnAfter1863(): void self::REGION, self::HOLIDAY, $year, - new DateTime("fourth thursday of november $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("fourth thursday of november $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,7 +53,7 @@ public function testThanksgivingDayOnAfter1863(): void * Tests Thanksgiving Day before 1863. ThanksgivingDay Day is celebrated since 1863 on the fourth Thursday * of November. * - * @throws ReflectionException + * @throws \Exception */ public function testThanksgivingDayBefore1863(): void { @@ -72,7 +67,7 @@ public function testThanksgivingDayBefore1863(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -87,7 +82,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/USABaseTestCase.php b/tests/USA/USABaseTestCase.php index 830b09968..2e28e9f42 100644 --- a/tests/USA/USABaseTestCase.php +++ b/tests/USA/USABaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/USA/USATest.php b/tests/USA/USATest.php index 235f702af..a28dc8d71 100644 --- a/tests/USA/USATest.php +++ b/tests/USA/USATest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\USA; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -30,6 +29,8 @@ class USATest extends USABaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -65,8 +64,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -75,8 +72,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -85,8 +80,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -95,8 +88,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in the USA are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -104,7 +95,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/USA/VeteransDayTest.php b/tests/USA/VeteransDayTest.php index 7c976db51..c23499e31 100644 --- a/tests/USA/VeteransDayTest.php +++ b/tests/USA/VeteransDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Exception\MissingTranslationException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -41,8 +37,7 @@ class VeteransDayTest extends USABaseTestCase implements HolidayTestCase /** * Tests Veterans Day on or after 1919. Veterans Day was established in 1919 on November 11. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testVeteransDayOnAfter1919(): void { @@ -51,15 +46,14 @@ public function testVeteransDayOnAfter1919(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-11-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-11", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Veterans Day on or after 1919 when substituted on Monday (when Veterans Day falls on Sunday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testVeteransDayOnAfter1919SubstitutedMonday(): void { @@ -68,15 +62,14 @@ public function testVeteransDayOnAfter1919SubstitutedMonday(): void self::REGION, 'substituteHoliday:veteransDay', $year, - new DateTime("$year-11-12", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-12", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Veterans Day on or after 1919 when substituted on Friday (when Veterans Day falls on Saturday). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testVeteransDayOnAfter1919SubstitutedFriday(): void { @@ -85,14 +78,14 @@ public function testVeteransDayOnAfter1919SubstitutedFriday(): void self::REGION, 'substituteHoliday:veteransDay', $year, - new DateTime("$year-11-10", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-11-10", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests Veterans Day before 1919. Veterans Day was established in 1919 on November 11. * - * @throws ReflectionException + * @throws \Exception */ public function testVeteransDayBefore1919(): void { @@ -106,12 +99,14 @@ public function testVeteransDayBefore1919(): void /** * Tests name of Veterans Day before 1954. Veterans Day was named 'Armistice Day' before 1954. * - * @throws ReflectionException * @throws MissingTranslationException */ public function testVeteransDayNameBefore1954(): void { - $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1953); + try { + $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR, 1953); + } catch (\Exception $e) { + } $holidays = Yasumi::create(self::REGION, $year); $holiday = $holidays->getHoliday(self::HOLIDAY); @@ -121,12 +116,14 @@ public function testVeteransDayNameBefore1954(): void /** * Tests name of Veterans Day after 1954. Veterans Day was named 'Armistice Day' before 1954. * - * @throws ReflectionException * @throws MissingTranslationException */ public function testVeteransDayNameAfter1954(): void { - $year = $this->generateRandomYear(1954); + try { + $year = $this->generateRandomYear(1954); + } catch (\Exception $e) { + } $holidays = Yasumi::create(self::REGION, $year); $holiday = $holidays->getHoliday(self::HOLIDAY); @@ -136,7 +133,7 @@ public function testVeteransDayNameAfter1954(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -151,7 +148,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/USA/WashingtonsBirthdayTest.php b/tests/USA/WashingtonsBirthdayTest.php index e6aa98c93..798bb7549 100644 --- a/tests/USA/WashingtonsBirthdayTest.php +++ b/tests/USA/WashingtonsBirthdayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\USA; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +36,7 @@ class WashingtonsBirthdayTest extends USABaseTestCase implements HolidayTestCase * Tests Washington's Birthday on or after 1968. Washington's Birthday was established since 1879 on February 22 * and was changed in 1968 to the third Monday in February. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testWashingtonsBirthdayOnAfter1968(): void { @@ -50,7 +45,7 @@ public function testWashingtonsBirthdayOnAfter1968(): void self::REGION, self::HOLIDAY, $year, - new DateTime("third monday of february $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("third monday of february $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -58,8 +53,7 @@ public function testWashingtonsBirthdayOnAfter1968(): void * Tests Washington's Birthday between 1879 and 1967. Washington's Birthday was established since 1879 on February * 22 and was changed in 1968 to the third Monday in February. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testWashingtonsBirthdayBetween1879And1967(): void { @@ -68,7 +62,7 @@ public function testWashingtonsBirthdayBetween1879And1967(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-2-22", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-2-22", new \DateTimeZone(self::TIMEZONE)) ); } @@ -76,7 +70,7 @@ public function testWashingtonsBirthdayBetween1879And1967(): void * Tests Washington's Birthday before 1879. Washington's Birthday was established since 1879 on February 22 and was * changed in 1968 to the third Monday in February. * - * @throws ReflectionException + * @throws \Exception */ public function testWashingtonsBirthdayBefore1879(): void { @@ -90,7 +84,7 @@ public function testWashingtonsBirthdayBefore1879(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -105,7 +99,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/CatholicChristmasDayTest.php b/tests/Ukraine/CatholicChristmasDayTest.php index c6bf670e5..913da4bf5 100644 --- a/tests/Ukraine/CatholicChristmasDayTest.php +++ b/tests/Ukraine/CatholicChristmasDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,9 +15,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -37,12 +34,10 @@ class CatholicChristmasDayTest extends UkraineBaseTestCase implements HolidayTes * * @dataProvider CatholicChristmasDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testCatholicChristmasDay(int $year, DateTime $expected): void + public function testCatholicChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -50,7 +45,7 @@ public function testCatholicChristmasDay(int $year, DateTime $expected): void /** * Tests Catholic Christmas Day before 2017. * - * @throws ReflectionException + * @throws \Exception */ public function testNoCatholicChristmasDayBefore2017(): void { @@ -66,7 +61,7 @@ public function testNoCatholicChristmasDayBefore2017(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -81,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -91,9 +86,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of Catholic Christmas Day. * - * @return array list of test dates for Catholic Christmas Day + * @return array list of test dates for Catholic Christmas Day * - * @throws Exception + * @throws \Exception */ public function CatholicChristmasDayDataProvider(): array { diff --git a/tests/Ukraine/ChristmasDayTest.php b/tests/Ukraine/ChristmasDayTest.php index 205134053..811f5e994 100644 --- a/tests/Ukraine/ChristmasDayTest.php +++ b/tests/Ukraine/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class ChristmasDayTest extends UkraineBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which Christmas Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which Christmas Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testChristmasDay(int $year, DateTime $expected): void + public function testChristmasDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testChristmasDay(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests translated name of Christmas Day. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/ConstitutionDayTest.php b/tests/Ukraine/ConstitutionDayTest.php index 3daedd9a6..9a81d91ff 100644 --- a/tests/Ukraine/ConstitutionDayTest.php +++ b/tests/Ukraine/ConstitutionDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +28,7 @@ class ConstitutionDayTest extends UkraineBaseTestCase implements HolidayTestCase public const HOLIDAY = 'constitutionDay'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { @@ -42,14 +37,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-28", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-28", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -58,8 +51,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Ukraine/DefenderOfUkraineDayTest.php b/tests/Ukraine/DefenderOfUkraineDayTest.php index 7615d2963..4939a051a 100644 --- a/tests/Ukraine/DefenderOfUkraineDayTest.php +++ b/tests/Ukraine/DefenderOfUkraineDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +28,7 @@ class DefenderOfUkraineDayTest extends UkraineBaseTestCase implements HolidayTes public const HOLIDAY = 'defenderOfUkraineDay'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { @@ -42,14 +37,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-10-14", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-10-14", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -63,8 +56,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Ukraine/EasterTest.php b/tests/Ukraine/EasterTest.php index ca153ea56..e8ef5130d 100644 --- a/tests/Ukraine/EasterTest.php +++ b/tests/Ukraine/EasterTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class EasterTest extends UkraineBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-04-19", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-04-19", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/IndependenceDayTest.php b/tests/Ukraine/IndependenceDayTest.php index 3b1933b18..ecb3b4c04 100644 --- a/tests/Ukraine/IndependenceDayTest.php +++ b/tests/Ukraine/IndependenceDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +28,7 @@ class IndependenceDayTest extends UkraineBaseTestCase implements HolidayTestCase public const HOLIDAY = 'independenceDay'; /** - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(): void { @@ -42,14 +37,12 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-08-24", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-08-24", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -58,8 +51,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/Ukraine/InternationalWomensDayTest.php b/tests/Ukraine/InternationalWomensDayTest.php index b13ff28e5..c544f2f60 100644 --- a/tests/Ukraine/InternationalWomensDayTest.php +++ b/tests/Ukraine/InternationalWomensDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,10 +29,8 @@ class InternationalWomensDayTest extends UkraineBaseTestCase implements HolidayT /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -43,9 +38,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -55,7 +50,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -70,7 +65,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/InternationalWorkersDayTest.php b/tests/Ukraine/InternationalWorkersDayTest.php index 0c4b3df98..87cc40d93 100644 --- a/tests/Ukraine/InternationalWorkersDayTest.php +++ b/tests/Ukraine/InternationalWorkersDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class InternationalWorkersDayTest extends UkraineBaseTestCase implements Holiday * * @dataProvider InternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testInternationalWorkersDay(int $year, DateTime $expected): void + public function testInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,7 +43,7 @@ public function testInternationalWorkersDay(int $year, DateTime $expected): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -63,7 +58,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -73,9 +68,9 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * - * @throws Exception + * @throws \Exception */ public function InternationalWorkersDayDataProvider(): array { diff --git a/tests/Ukraine/NewYearsDayTest.php b/tests/Ukraine/NewYearsDayTest.php index 007c5c859..d03cfb16b 100644 --- a/tests/Ukraine/NewYearsDayTest.php +++ b/tests/Ukraine/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -35,12 +32,10 @@ class NewYearsDayTest extends UkraineBaseTestCase implements HolidayTestCase * * @dataProvider HolidayDataProvider * - * @param int $year the year for which the holiday defined in this test needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which the holiday defined in this test needs to be tested + * @param \DateTime $expected the expected date */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -48,9 +43,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -60,7 +55,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -75,7 +70,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/PentecostTest.php b/tests/Ukraine/PentecostTest.php index 95efecd72..651dde381 100644 --- a/tests/Ukraine/PentecostTest.php +++ b/tests/Ukraine/PentecostTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class PentecostTest extends UkraineBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-06-07", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-07", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/Ukraine/SecondInternationalWorkersDayTest.php b/tests/Ukraine/SecondInternationalWorkersDayTest.php index 9b4c4242a..80a0db02b 100644 --- a/tests/Ukraine/SecondInternationalWorkersDayTest.php +++ b/tests/Ukraine/SecondInternationalWorkersDayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,8 +15,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\Yasumi; @@ -36,12 +34,10 @@ class SecondInternationalWorkersDayTest extends UkraineBaseTestCase implements H * * @dataProvider SecondInternationalWorkersDayDataProvider * - * @param int $year the year for which International Workers' Day needs to be tested - * @param DateTime $expected the expected date - * - * @throws ReflectionException + * @param int $year the year for which International Workers' Day needs to be tested + * @param \DateTime $expected the expected date */ - public function testSecondInternationalWorkersDay(int $year, DateTime $expected): void + public function testSecondInternationalWorkersDay(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -49,7 +45,7 @@ public function testSecondInternationalWorkersDay(int $year, DateTime $expected) /** * Tests International Workers' Day since 2018. * - * @throws ReflectionException + * @throws \Exception */ public function testNoSecondInternationalWorkersDaySince2018(): void { @@ -65,7 +61,7 @@ public function testNoSecondInternationalWorkersDaySince2018(): void /** * Tests translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -80,7 +76,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { @@ -95,7 +91,7 @@ public function testHolidayType(): void /** * Returns a list of random test dates used for assertion of International Workers' Day. * - * @return array list of test dates for International Workers' Day + * @return array list of test dates for International Workers' Day * * @throws \Exception */ diff --git a/tests/Ukraine/SubstitutedHolidayTest.php b/tests/Ukraine/SubstitutedHolidayTest.php index 000fef5bf..de7bce948 100644 --- a/tests/Ukraine/SubstitutedHolidayTest.php +++ b/tests/Ukraine/SubstitutedHolidayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,10 +15,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\SubstituteHoliday; use Yasumi\tests\HolidayTestCase; @@ -32,8 +28,8 @@ class SubstitutedHolidayTest extends UkraineBaseTestCase implements HolidayTestC /** * Tests the substitution of holidays on saturday (weekend). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception + * @throws \ReflectionException */ public function testSaturdaySubstitution(): void { @@ -45,8 +41,8 @@ public function testSaturdaySubstitution(): void self::REGION, $holiday, $year, - new DateTime("$year-05-09", new DateTimeZone(self::TIMEZONE)), - new DateTime("$year-05-11", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-05-09", new \DateTimeZone(self::TIMEZONE)), + new \DateTime("$year-05-11", new \DateTimeZone(self::TIMEZONE)) ); unset($year, $holiday); @@ -55,20 +51,18 @@ public function testSaturdaySubstitution(): void /** * Asserts that the expected date is indeed a holiday for that given year and name. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key string the key of the holiday to be checked against - * @param int $year holiday calendar year - * @param DateTime $expectedOfficial the official date to be checked against - * @param DateTime|null $expectedSubstitution the substituted date to be checked against - * - * @throws ReflectionException + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested + * @param string $key string the key of the holiday to be checked against + * @param int $year holiday calendar year + * @param \DateTimeInterface $expectedOfficial the official date to be checked against + * @param \DateTimeImmutable|null $expectedSubstitution the substituted date to be checked against */ public function assertHolidayWithSubstitution( string $provider, string $key, int $year, - DateTime $expectedOfficial, - DateTime $expectedSubstitution = null + \DateTimeInterface $expectedOfficial, + \DateTimeInterface $expectedSubstitution = null ): void { $holidays = Yasumi::create($provider, $year); @@ -98,8 +92,8 @@ public function assertHolidayWithSubstitution( /** * Tests the substitution of holidays on sunday (weekend). * - * @throws Exception - * @throws ReflectionException + * @throws \Exception + * @throws \ReflectionException */ public function testSundaySubstitution(): void { @@ -111,8 +105,8 @@ public function testSundaySubstitution(): void self::REGION, $holiday, $year, - new DateTime("$year-06-28", new DateTimeZone(self::TIMEZONE)), - new DateTime("$year-06-29", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-06-28", new \DateTimeZone(self::TIMEZONE)), + new \DateTime("$year-06-29", new \DateTimeZone(self::TIMEZONE)) ); unset($year, $holiday); @@ -122,8 +116,8 @@ public function testSundaySubstitution(): void * Tests the substitution of new year (1. January) on a weekend. * Special: no substitution at new year (1. January) on a weekend. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception + * @throws \ReflectionException */ public function testNewYearNoSubstitution(): void { @@ -135,7 +129,7 @@ public function testNewYearNoSubstitution(): void self::REGION, $holiday, $year, - new DateTime("$year-01-01", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-01-01", new \DateTimeZone(self::TIMEZONE)) ); unset($year, $holiday); @@ -145,8 +139,8 @@ public function testNewYearNoSubstitution(): void * Tests the substitution of Catholic Christmas Day (25. December) on a weekend. * Special: no substitution at Catholic Christmas Day (25. December) on a weekend. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception + * @throws \ReflectionException */ public function testCatholicChristmasDayNoSubstitution(): void { @@ -158,7 +152,7 @@ public function testCatholicChristmasDayNoSubstitution(): void self::REGION, $holiday, $year, - new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)) ); unset($year, $holiday); diff --git a/tests/Ukraine/UkraineBaseTestCase.php b/tests/Ukraine/UkraineBaseTestCase.php index 5779033e4..0acc03b5d 100644 --- a/tests/Ukraine/UkraineBaseTestCase.php +++ b/tests/Ukraine/UkraineBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Ukraine/UkraineTest.php b/tests/Ukraine/UkraineTest.php index f142186a5..b231f88d0 100644 --- a/tests/Ukraine/UkraineTest.php +++ b/tests/Ukraine/UkraineTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,7 +15,6 @@ namespace Yasumi\tests\Ukraine; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -31,6 +30,8 @@ class UkraineTest extends UkraineBaseTestCase implements ProviderTestCase /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -39,8 +40,6 @@ protected function setUp(): void /** * Tests if all official holidays in Ukraine are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -84,8 +83,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Ukraine are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -94,8 +91,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Ukraine are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -104,8 +99,6 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Ukraine are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { @@ -114,8 +107,6 @@ public function testBankHolidays(): void /** * Tests if all other holidays in Ukraine are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -123,7 +114,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/Ukraine/VictoryDayTest.php b/tests/Ukraine/VictoryDayTest.php index 39f599e3b..b504d954c 100644 --- a/tests/Ukraine/VictoryDayTest.php +++ b/tests/Ukraine/VictoryDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,9 +14,6 @@ namespace Yasumi\tests\Ukraine; -use DateTime; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -32,10 +29,8 @@ class VictoryDayTest extends UkraineBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider - * - * @throws ReflectionException */ - public function testHoliday(int $year, DateTime $expected): void + public function testHoliday(int $year, \DateTimeInterface $expected): void { $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); } @@ -43,9 +38,9 @@ public function testHoliday(int $year, DateTime $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -55,7 +50,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -70,7 +65,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/BoxingDayTest.php b/tests/UnitedKingdom/BoxingDayTest.php index 5b72563fe..96f1b676a 100644 --- a/tests/UnitedKingdom/BoxingDayTest.php +++ b/tests/UnitedKingdom/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class BoxingDayTest extends UnitedKingdomBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/ChristmasDayTest.php b/tests/UnitedKingdom/ChristmasDayTest.php index c952e1bfa..d3c653252 100644 --- a/tests/UnitedKingdom/ChristmasDayTest.php +++ b/tests/UnitedKingdom/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class ChristmasDayTest extends UnitedKingdomBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/EasterMondayTest.php b/tests/UnitedKingdom/EasterMondayTest.php index 55ea738db..0f7c13c9c 100644 --- a/tests/UnitedKingdom/EasterMondayTest.php +++ b/tests/UnitedKingdom/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends UnitedKingdomBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/BoxingDayTest.php b/tests/UnitedKingdom/England/BoxingDayTest.php index 8b072c9f2..424cd8bf4 100644 --- a/tests/UnitedKingdom/England/BoxingDayTest.php +++ b/tests/UnitedKingdom/England/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class BoxingDayTest extends EnglandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/ChristmasDayTest.php b/tests/UnitedKingdom/England/ChristmasDayTest.php index 44db5a5d8..c4bca56d6 100644 --- a/tests/UnitedKingdom/England/ChristmasDayTest.php +++ b/tests/UnitedKingdom/England/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class ChristmasDayTest extends EnglandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/EasterMondayTest.php b/tests/UnitedKingdom/England/EasterMondayTest.php index d19452a3a..5a46fb89e 100644 --- a/tests/UnitedKingdom/England/EasterMondayTest.php +++ b/tests/UnitedKingdom/England/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends EnglandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/EnglandBaseTestCase.php b/tests/UnitedKingdom/England/EnglandBaseTestCase.php index f41d89d24..f3859f218 100644 --- a/tests/UnitedKingdom/England/EnglandBaseTestCase.php +++ b/tests/UnitedKingdom/England/EnglandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/UnitedKingdom/England/EnglandTest.php b/tests/UnitedKingdom/England/EnglandTest.php index a03903792..9a79af01c 100644 --- a/tests/UnitedKingdom/England/EnglandTest.php +++ b/tests/UnitedKingdom/England/EnglandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class EnglandTest extends EnglandBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in England are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -51,8 +50,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in England are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -61,8 +58,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in England are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -71,24 +66,41 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in England are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', + $holidays = [ 'easterMonday', - 'mayDayBankHoliday', - 'springBankHoliday', 'secondChristmasDay', - ], self::REGION, $this->year, Holiday::TYPE_BANK); + ]; + + $year = $this->generateRandomYear(); + + if (1965 >= $this->year) { + $holidays[] = 'springBankHoliday'; + } + + if (1974 > $this->year) { + $holidays[] = 'newYearsDay'; + } + + if (1978 >= $this->year) { + $holidays[] = 'mayDayBankHoliday'; + } + + if (2022 === $year) { + $holidays[] = 'queenElizabethFuneralBankHoliday'; + } + + if (2023 === $year) { + $holidays[] = 'kingCharlesCoronationBankHoliday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_BANK); } /** * Tests if all other holidays in England are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -96,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/UnitedKingdom/England/GoodFridayTest.php b/tests/UnitedKingdom/England/GoodFridayTest.php index 601b64b55..2ecd780c8 100644 --- a/tests/UnitedKingdom/England/GoodFridayTest.php +++ b/tests/UnitedKingdom/England/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends EnglandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/MayDayBankHolidayTest.php b/tests/UnitedKingdom/England/MayDayBankHolidayTest.php index 8c4dc869e..bdd2e4d5f 100644 --- a/tests/UnitedKingdom/England/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/England/MayDayBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayBankHolidayTest extends EnglandBaseTestCase implements HolidayTestCa /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 1995 and 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayExceptions(): void { @@ -65,21 +59,21 @@ public function testHolidayExceptions(): void self::REGION, self::HOLIDAY, 1995, - new DateTime('1995-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1995-5-8', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2020, - new DateTime('2020-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2020-5-8', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/NewYearsDayTest.php b/tests/UnitedKingdom/England/NewYearsDayTest.php index 2cdba56d8..85d2dc073 100644 --- a/tests/UnitedKingdom/England/NewYearsDayTest.php +++ b/tests/UnitedKingdom/England/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class NewYearsDayTest extends EnglandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { @@ -58,14 +53,14 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -79,7 +74,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -94,9 +89,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +101,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -121,7 +116,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/SpringBankHolidayTest.php b/tests/UnitedKingdom/England/SpringBankHolidayTest.php index 738ed55b6..d74489e61 100644 --- a/tests/UnitedKingdom/England/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/England/SpringBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SpringBankHolidayTest extends EnglandBaseTestCase implements HolidayTestCa /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exceptions in 2002 and 2012. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayException(): void { @@ -65,21 +59,21 @@ public function testHolidayException(): void self::REGION, self::HOLIDAY, 2002, - new DateTime('2002-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2002-6-4', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2012, - new DateTime('2012-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2012-6-4', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/England/SummerBankHolidayTest.php b/tests/UnitedKingdom/England/SummerBankHolidayTest.php index 54070539a..3e9563bdd 100644 --- a/tests/UnitedKingdom/England/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/England/SummerBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,8 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\England; -use DateTime; -use DateTimeZone; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -43,7 +41,6 @@ class SummerBankHolidayTest extends EnglandBaseTestCase implements HolidayTestCa * Tests the holiday defined in this test. * * @throws \Exception - * @throws \ReflectionException */ public function testHoliday(): void { @@ -52,7 +49,7 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } @@ -60,7 +57,6 @@ public function testHoliday(): void * Tests the holiday exception in 2020. * * @throws \Exception - * @throws \ReflectionException */ public function testHolidayBefore1965(): void { @@ -69,14 +65,13 @@ public function testHolidayBefore1965(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday during trial period in 1965-1970. * - * @throws \ReflectionException * @throws \Exception */ public function testHolidayTrialPeriod(): void @@ -85,44 +80,44 @@ public function testHolidayTrialPeriod(): void self::REGION, self::HOLIDAY, 1965, - new DateTime('1965-8-30', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1965-8-30', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1966, - new DateTime('1966-8-29', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1966-8-29', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1967, - new DateTime('1967-8-28', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1967-8-28', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1968, - new DateTime('1968-9-2', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1968-9-2', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1969, - new DateTime('1969-9-1', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1969-9-1', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1970, - new DateTime('1970-8-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1970-8-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws \ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -136,7 +131,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws \ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -151,7 +146,7 @@ public function testTranslation(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws \ReflectionException + * @throws \Exception */ public function testTranslationBeforeRename(): void { @@ -166,7 +161,7 @@ public function testTranslationBeforeRename(): void /** * Tests type of the holiday defined in this test. * - * @throws \ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/GoodFridayTest.php b/tests/UnitedKingdom/GoodFridayTest.php index 3e8170d8f..d34fd9225 100644 --- a/tests/UnitedKingdom/GoodFridayTest.php +++ b/tests/UnitedKingdom/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends UnitedKingdomBaseTestCase implements HolidayTestCas /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/KingCharlesCoronationBankHolidayTest.php b/tests/UnitedKingdom/KingCharlesCoronationBankHolidayTest.php new file mode 100644 index 000000000..53c1de40b --- /dev/null +++ b/tests/UnitedKingdom/KingCharlesCoronationBankHolidayTest.php @@ -0,0 +1,108 @@ + + */ + +namespace Yasumi\tests\UnitedKingdom; + +use Yasumi\Holiday; +use Yasumi\tests\HolidayTestCase; + +/** + * Class for testing the King Charle's Coronation Bank Holiday in the United Kingdom. + */ +class KingCharlesCoronationBankHolidayTest extends UnitedKingdomBaseTestCase implements HolidayTestCase +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'kingCharlesCoronationBankHoliday'; + + /** + * The year in which the holiday occurred. + */ + public const ACTIVE_YEAR = 2023; + + /** + * The date on which the holiday occurred. + */ + public const ACTIVE_DATE = '2023-5-8'; + + /** + * Tests the holiday defined in this test. + * + * @throws \Exception + */ + public function testHoliday(): void + { + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + new \DateTime(self::ACTIVE_DATE, new \DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests the holiday defined in this test before the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayBeforeActive(): void + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ACTIVE_YEAR - 1) + ); + } + + /** + * Tests the holiday defined in this test after the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayAfterActive(): void + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ACTIVE_YEAR + 1) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + [self::LOCALE => 'King Charles III’s Coronation Bank Holiday'] + ); + } + + /** + * Tests type of the holiday defined in this test. + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + Holiday::TYPE_BANK + ); + } +} diff --git a/tests/UnitedKingdom/MayDayBankHolidayTest.php b/tests/UnitedKingdom/MayDayBankHolidayTest.php index d4f91680e..da3317745 100644 --- a/tests/UnitedKingdom/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/MayDayBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayBankHolidayTest extends UnitedKingdomBaseTestCase implements Holiday /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 1995 and 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayExceptions(): void { @@ -65,21 +59,21 @@ public function testHolidayExceptions(): void self::REGION, self::HOLIDAY, 1995, - new DateTime('1995-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1995-5-8', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2020, - new DateTime('2020-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2020-5-8', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/MotheringSundayTest.php b/tests/UnitedKingdom/MotheringSundayTest.php index 4717b09d8..5fb25ed5c 100644 --- a/tests/UnitedKingdom/MotheringSundayTest.php +++ b/tests/UnitedKingdom/MotheringSundayTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,11 +15,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; use Yasumi\tests\UnitedKingdom\England\EnglandBaseTestCase; @@ -31,8 +26,7 @@ class MotheringSundayTest extends EnglandBaseTestCase implements HolidayTestCase /** * @dataProvider HolidayDataProvider * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -40,14 +34,14 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -56,7 +50,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->sub(new DateInterval('P3W')); + $date->sub(new \DateInterval('P3W')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -69,7 +63,7 @@ public function HolidayDataProvider(): array } /** - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -82,7 +76,7 @@ public function testTranslation(): void } /** - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NewYearsDayTest.php b/tests/UnitedKingdom/NewYearsDayTest.php index 204c316e3..c9af4f9d7 100644 --- a/tests/UnitedKingdom/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class NewYearsDayTest extends UnitedKingdomBaseTestCase implements HolidayTestCa * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { @@ -58,14 +53,14 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -79,7 +74,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -94,9 +89,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +101,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -121,7 +116,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php index 0aa8159a1..e6a6ebe63 100644 --- a/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BattleOfTheBoyneTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,12 +40,11 @@ class BattleOfTheBoyneTest extends NorthernIrelandBaseTestCase implements Holida * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -61,7 +56,7 @@ public function testHoliday(int $year, string $expected): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -75,9 +70,9 @@ public function testHolidayBeforeEstablishment(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -85,7 +80,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-7-12", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-7-12", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -95,7 +90,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -110,7 +105,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php index 45890c1bc..7bbe975d8 100644 --- a/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class BoxingDayTest extends NorthernIrelandBaseTestCase implements HolidayTestCa * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php index 12ce2faae..7f65429d5 100644 --- a/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class ChristmasDayTest extends NorthernIrelandBaseTestCase implements HolidayTes * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php index 30805ff8d..0e766e3ca 100644 --- a/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends NorthernIrelandBaseTestCase implements HolidayTes * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php b/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php index 74bbcbdcd..1013388ba 100644 --- a/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends NorthernIrelandBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php index a60cb5f4d..a6ef31c28 100644 --- a/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/MayDayBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayBankHolidayTest extends NorthernIrelandBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 1995 and 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayExceptions(): void { @@ -65,21 +59,21 @@ public function testHolidayExceptions(): void self::REGION, self::HOLIDAY, 1995, - new DateTime('1995-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1995-5-8', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2020, - new DateTime('2020-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2020-5-8', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php index f3bb05962..3e4b1c265 100644 --- a/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class NewYearsDayTest extends NorthernIrelandBaseTestCase implements HolidayTest * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { @@ -58,14 +53,14 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -79,7 +74,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -94,9 +89,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +101,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -121,7 +116,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/NorthernIrelandBaseTestCase.php b/tests/UnitedKingdom/NorthernIreland/NorthernIrelandBaseTestCase.php index dbcec8d3d..90abe0a8d 100644 --- a/tests/UnitedKingdom/NorthernIreland/NorthernIrelandBaseTestCase.php +++ b/tests/UnitedKingdom/NorthernIreland/NorthernIrelandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/UnitedKingdom/NorthernIreland/NorthernIrelandTest.php b/tests/UnitedKingdom/NorthernIreland/NorthernIrelandTest.php index 203b91f2f..a171795cc 100644 --- a/tests/UnitedKingdom/NorthernIreland/NorthernIrelandTest.php +++ b/tests/UnitedKingdom/NorthernIreland/NorthernIrelandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class NorthernIrelandTest extends NorthernIrelandBaseTestCase implements Provide /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Northern Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -51,8 +50,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Northern Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -61,8 +58,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Northern Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -71,25 +66,45 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Northern Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', + $holidays = [ 'easterMonday', - 'mayDayBankHoliday', - 'springBankHoliday', - 'battleOfTheBoyne', 'secondChristmasDay', - ], self::REGION, $this->year, Holiday::TYPE_BANK); + ]; + + $year = $this->generateRandomYear(); + + if (1926 >= $this->year) { + $holidays[] = 'battleOfTheBoyne'; + } + + if (1965 >= $this->year) { + $holidays[] = 'springBankHoliday'; + } + + if (1974 > $this->year) { + $holidays[] = 'newYearsDay'; + } + + if (1978 >= $this->year) { + $holidays[] = 'mayDayBankHoliday'; + } + + if (2022 === $year) { + $holidays[] = 'queenElizabethFuneralBankHoliday'; + } + + if (2023 === $year) { + $holidays[] = 'kingCharlesCoronationBankHoliday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_BANK); } /** * Tests if all other holidays in Northern Ireland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -97,7 +112,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php index dedf403a3..19d420c7c 100644 --- a/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/SpringBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SpringBankHolidayTest extends NorthernIrelandBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php index df0ca5a3d..f6ec148d4 100644 --- a/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/StPatricksDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,12 +40,11 @@ class StPatricksDayTest extends NorthernIrelandBaseTestCase implements HolidayTe * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -61,7 +56,7 @@ public function testHoliday(int $year, string $expected): void /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -75,9 +70,9 @@ public function testHolidayBeforeEstablishment(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -85,7 +80,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-3-17", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-3-17", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -95,7 +90,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -110,7 +105,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php index 6678181c9..daf4fc1b8 100644 --- a/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/NorthernIreland/SummerBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\NorthernIreland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class SummerBankHolidayTest extends NorthernIrelandBaseTestCase implements Holid /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -54,15 +49,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayBefore1965(): void { @@ -71,15 +65,14 @@ public function testHolidayBefore1965(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday during trial period in 1965-1970. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayTrialPeriod(): void { @@ -87,44 +80,44 @@ public function testHolidayTrialPeriod(): void self::REGION, self::HOLIDAY, 1965, - new DateTime('1965-8-30', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1965-8-30', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1966, - new DateTime('1966-8-29', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1966-8-29', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1967, - new DateTime('1967-8-28', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1967-8-28', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1968, - new DateTime('1968-9-2', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1968-9-2', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1969, - new DateTime('1969-9-1', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1969-9-1', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1970, - new DateTime('1970-8-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1970-8-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -138,7 +131,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -153,7 +146,7 @@ public function testTranslation(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslationBeforeRename(): void { @@ -168,7 +161,7 @@ public function testTranslationBeforeRename(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/PlatinumJubileeBankHolidayTest.php b/tests/UnitedKingdom/PlatinumJubileeBankHolidayTest.php index 1a5200b2d..a2a96070d 100644 --- a/tests/UnitedKingdom/PlatinumJubileeBankHolidayTest.php +++ b/tests/UnitedKingdom/PlatinumJubileeBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class PlatinumJubileeBankHolidayTest extends UnitedKingdomBaseTestCase implement /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -53,14 +48,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, self::ACTIVE_YEAR, - new DateTime(self::ACTIVE_DATE, new DateTimeZone(self::TIMEZONE)) + new \DateTime(self::ACTIVE_DATE, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before the year in which it occurred. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeActive(): void { @@ -74,7 +69,7 @@ public function testHolidayBeforeActive(): void /** * Tests the holiday defined in this test after the year in which it occurred. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayAfterActive(): void { @@ -87,8 +82,6 @@ public function testHolidayAfterActive(): void /** * Tests the translated name of the holiday defined in this test. - * - * @throws ReflectionException */ public function testTranslation(): void { @@ -102,8 +95,6 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. - * - * @throws ReflectionException */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/QueenElizabethFuneralBankHolidayTest.php b/tests/UnitedKingdom/QueenElizabethFuneralBankHolidayTest.php new file mode 100644 index 000000000..05b8b1121 --- /dev/null +++ b/tests/UnitedKingdom/QueenElizabethFuneralBankHolidayTest.php @@ -0,0 +1,108 @@ + + */ + +namespace Yasumi\tests\UnitedKingdom; + +use Yasumi\Holiday; +use Yasumi\tests\HolidayTestCase; + +/** + * Class for testing the Queen Elizabeth's Funeral Bank Holiday in the United Kingdom. + */ +class QueenElizabethFuneralBankHolidayTest extends UnitedKingdomBaseTestCase implements HolidayTestCase +{ + /** + * The name of the holiday. + */ + public const HOLIDAY = 'queenElizabethFuneralBankHoliday'; + + /** + * The year in which the holiday occurred. + */ + public const ACTIVE_YEAR = 2022; + + /** + * The date on which the holiday occurred. + */ + public const ACTIVE_DATE = '2022-9-19'; + + /** + * Tests the holiday defined in this test. + * + * @throws \Exception + */ + public function testHoliday(): void + { + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + new \DateTime(self::ACTIVE_DATE, new \DateTimeZone(self::TIMEZONE)) + ); + } + + /** + * Tests the holiday defined in this test before the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayBeforeActive(): void + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(1000, self::ACTIVE_YEAR - 1) + ); + } + + /** + * Tests the holiday defined in this test after the year in which it occurred. + * + * @throws \Exception + */ + public function testHolidayAfterActive(): void + { + $this->assertNotHoliday( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(self::ACTIVE_YEAR + 1) + ); + } + + /** + * Tests the translated name of the holiday defined in this test. + */ + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + [self::LOCALE => 'Queen Elizabeth II’s State Funeral Bank Holiday'] + ); + } + + /** + * Tests type of the holiday defined in this test. + */ + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + self::ACTIVE_YEAR, + Holiday::TYPE_BANK + ); + } +} diff --git a/tests/UnitedKingdom/Scotland/BoxingDayTest.php b/tests/UnitedKingdom/Scotland/BoxingDayTest.php index 466be0f67..df1b9d444 100644 --- a/tests/UnitedKingdom/Scotland/BoxingDayTest.php +++ b/tests/UnitedKingdom/Scotland/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class BoxingDayTest extends ScotlandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php index 1aa746349..6151ac516 100644 --- a/tests/UnitedKingdom/Scotland/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Scotland/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class ChristmasDayTest extends ScotlandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/GoodFridayTest.php b/tests/UnitedKingdom/Scotland/GoodFridayTest.php index b33bf19c0..51976a627 100644 --- a/tests/UnitedKingdom/Scotland/GoodFridayTest.php +++ b/tests/UnitedKingdom/Scotland/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends ScotlandBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php b/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php index d2616bfa0..a07ff57c3 100644 --- a/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/MayDayBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayBankHolidayTest extends ScotlandBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 1995 and 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayExceptions(): void { @@ -65,21 +59,21 @@ public function testHolidayExceptions(): void self::REGION, self::HOLIDAY, 1995, - new DateTime('1995-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1995-5-8', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2020, - new DateTime('2020-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2020-5-8', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php index f7e5da741..74f42e96a 100644 --- a/tests/UnitedKingdom/Scotland/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -50,16 +45,15 @@ class NewYearsDayTest extends ScotlandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,7 +61,7 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -81,7 +75,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -96,9 +90,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +100,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-1", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-1-1", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -116,7 +110,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -131,7 +125,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php b/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php index 52d1ce81a..64e1537e3 100644 --- a/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php +++ b/tests/UnitedKingdom/Scotland/ScotlandBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/UnitedKingdom/Scotland/ScotlandTest.php b/tests/UnitedKingdom/Scotland/ScotlandTest.php index 53162b0ef..d0fefb34f 100644 --- a/tests/UnitedKingdom/Scotland/ScotlandTest.php +++ b/tests/UnitedKingdom/Scotland/ScotlandTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class ScotlandTest extends ScotlandBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Scotland are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -49,8 +48,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Scotland are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -59,8 +56,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Scotland are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -69,25 +64,42 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Scotland are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { - $this->assertDefinedHolidays([ - 'goodFriday', - 'mayDayBankHoliday', - 'springBankHoliday', + $holidays = [ 'christmasDay', + 'goodFriday', 'secondChristmasDay', - 'newYearsDay', - ], self::REGION, $this->year, Holiday::TYPE_BANK); + ]; + + $year = $this->generateRandomYear(); + + if (1965 >= $this->year) { + $holidays[] = 'springBankHoliday'; + } + + if (1974 > $this->year) { + $holidays[] = 'newYearsDay'; + } + + if (1978 >= $this->year) { + $holidays[] = 'mayDayBankHoliday'; + } + + if (2022 === $year) { + $holidays[] = 'queenElizabethFuneralBankHoliday'; + } + + if (2023 === $year) { + $holidays[] = 'kingCharlesCoronationBankHoliday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_BANK); } /** * Tests if all other holidays in Scotland are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -95,7 +107,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php index a6a01db64..ed55041e8 100644 --- a/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php +++ b/tests/UnitedKingdom/Scotland/SecondNewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -50,16 +45,15 @@ class SecondNewYearsDayTest extends ScotlandBaseTestCase implements HolidayTestC * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $date->add(new \DateInterval('P2D')); $this->assertHoliday(self::REGION, 'substituteHoliday:'.self::HOLIDAY, $year, $date); } } @@ -67,7 +61,7 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -81,7 +75,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -96,9 +90,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +100,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-1-2", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-1-2", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -116,7 +110,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -131,7 +125,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php index 5e6a83e3f..99bb3e33a 100644 --- a/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SpringBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SpringBankHolidayTest extends ScotlandBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php index 9c2e92e3d..c0d310a5f 100644 --- a/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php +++ b/tests/UnitedKingdom/Scotland/StAndrewsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,12 +40,11 @@ class StAndrewsDayTest extends ScotlandBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { @@ -61,9 +56,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -71,7 +66,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR); - $date = new DateTime("$year-11-30", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-11-30", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -81,7 +76,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -96,7 +91,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php index 59dad9593..c6e6da703 100644 --- a/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/Scotland/SummerBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Scotland; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SummerBankHolidayTest extends ScotlandBaseTestCase implements HolidayTestC /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,14 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -70,7 +65,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -85,7 +80,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/SpringBankHolidayTest.php b/tests/UnitedKingdom/SpringBankHolidayTest.php index 9762e0078..32a07bd5c 100644 --- a/tests/UnitedKingdom/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/SpringBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SpringBankHolidayTest extends UnitedKingdomBaseTestCase implements Holiday /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exceptions in 2002, 2012 and 2022. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayException(): void { @@ -65,28 +59,28 @@ public function testHolidayException(): void self::REGION, self::HOLIDAY, 2002, - new DateTime('2002-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2002-6-4', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2012, - new DateTime('2012-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2012-6-4', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2022, - new DateTime('2022-6-2', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2022-6-2', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -100,7 +94,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -115,7 +109,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/SummerBankHolidayTest.php b/tests/UnitedKingdom/SummerBankHolidayTest.php index 104a6a95e..01e693495 100644 --- a/tests/UnitedKingdom/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/SummerBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class SummerBankHolidayTest extends UnitedKingdomBaseTestCase implements Holiday /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -54,15 +49,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayBefore1965(): void { @@ -71,15 +65,14 @@ public function testHolidayBefore1965(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday during trial period in 1965-1970. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayTrialPeriod(): void { @@ -87,44 +80,44 @@ public function testHolidayTrialPeriod(): void self::REGION, self::HOLIDAY, 1965, - new DateTime('1965-8-30', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1965-8-30', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1966, - new DateTime('1966-8-29', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1966-8-29', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1967, - new DateTime('1967-8-28', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1967-8-28', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1968, - new DateTime('1968-9-2', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1968-9-2', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1969, - new DateTime('1969-9-1', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1969-9-1', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1970, - new DateTime('1970-8-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1970-8-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -138,7 +131,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -153,7 +146,7 @@ public function testTranslation(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslationBeforeRename(): void { @@ -168,7 +161,7 @@ public function testTranslationBeforeRename(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/UnitedKingdomBaseTestCase.php b/tests/UnitedKingdom/UnitedKingdomBaseTestCase.php index c707533b0..edbee9c18 100644 --- a/tests/UnitedKingdom/UnitedKingdomBaseTestCase.php +++ b/tests/UnitedKingdom/UnitedKingdomBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/UnitedKingdom/UnitedKingdomTest.php b/tests/UnitedKingdom/UnitedKingdomTest.php index e50979293..1daac4fea 100644 --- a/tests/UnitedKingdom/UnitedKingdomTest.php +++ b/tests/UnitedKingdom/UnitedKingdomTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\UnitedKingdom; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class UnitedKingdomTest extends UnitedKingdomBaseTestCase implements ProviderTes /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in the United Kingdom are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -51,8 +50,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in the United Kingdom are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -61,8 +58,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in the United Kingdom are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -71,24 +66,41 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in the United Kingdom are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', + $holidays = [ 'easterMonday', - 'mayDayBankHoliday', - 'springBankHoliday', 'secondChristmasDay', - ], self::REGION, $this->year, Holiday::TYPE_BANK); + ]; + + $year = $this->generateRandomYear(); + + if (1965 >= $this->year) { + $holidays[] = 'springBankHoliday'; + } + + if (1974 > $this->year) { + $holidays[] = 'newYearsDay'; + } + + if (1978 >= $this->year) { + $holidays[] = 'mayDayBankHoliday'; + } + + if (2022 === $year) { + $holidays[] = 'queenElizabethFuneralBankHoliday'; + } + + if (2023 === $year) { + $holidays[] = 'kingCharlesCoronationBankHoliday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_BANK); } /** * Tests if all other holidays in the United Kingdom are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -96,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/UnitedKingdom/Wales/BoxingDayTest.php b/tests/UnitedKingdom/Wales/BoxingDayTest.php index 37c9cb595..0d56a0d94 100644 --- a/tests/UnitedKingdom/Wales/BoxingDayTest.php +++ b/tests/UnitedKingdom/Wales/BoxingDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class BoxingDayTest extends WalesBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-26", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-26", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/ChristmasDayTest.php b/tests/UnitedKingdom/Wales/ChristmasDayTest.php index a3c48d62c..524441f5a 100644 --- a/tests/UnitedKingdom/Wales/ChristmasDayTest.php +++ b/tests/UnitedKingdom/Wales/ChristmasDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,16 +35,15 @@ class ChristmasDayTest extends WalesBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { - $date = new DateTime($expected, new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)); $this->assertHoliday(self::REGION, self::HOLIDAY, $year, $date); if (\in_array((int) $date->format('w'), [0, 6], true)) { - $date->add(new DateInterval('P2D')); + $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); } @@ -58,9 +52,9 @@ public function testHoliday(int $year, string $expected): void /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -68,7 +62,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < self::TEST_ITERATIONS; ++$y) { $year = $this->generateRandomYear(); - $date = new DateTime("$year-12-25", new DateTimeZone(self::TIMEZONE)); + $date = new \DateTime("$year-12-25", new \DateTimeZone(self::TIMEZONE)); $data[] = [$year, $date->format('Y-m-d')]; } @@ -79,7 +73,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -94,7 +88,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/EasterMondayTest.php b/tests/UnitedKingdom/Wales/EasterMondayTest.php index 90619720a..b00923ce5 100644 --- a/tests/UnitedKingdom/Wales/EasterMondayTest.php +++ b/tests/UnitedKingdom/Wales/EasterMondayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,11 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -40,8 +35,7 @@ class EasterMondayTest extends WalesBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHoliday(int $year, string $expected): void { @@ -49,16 +43,16 @@ public function testHoliday(int $year, string $expected): void self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Returns a list of test dates. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -67,7 +61,7 @@ public function HolidayDataProvider(): array for ($y = 0; $y < 50; ++$y) { $year = $this->generateRandomYear(); $date = $this->calculateEaster($year, self::TIMEZONE); - $date->add(new DateInterval('P1D')); + $date->add(new \DateInterval('P1D')); $data[] = [$year, $date->format('Y-m-d')]; } @@ -78,7 +72,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -93,7 +87,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/GoodFridayTest.php b/tests/UnitedKingdom/Wales/GoodFridayTest.php index d31ee8e8a..8b0a71b01 100644 --- a/tests/UnitedKingdom/Wales/GoodFridayTest.php +++ b/tests/UnitedKingdom/Wales/GoodFridayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -34,8 +30,7 @@ class GoodFridayTest extends WalesBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -44,14 +39,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-3-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-3-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -66,7 +61,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php b/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php index f43fe3d68..5aef020f9 100644 --- a/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/MayDayBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class MayDayBankHolidayTest extends WalesBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-2", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-2", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 1995 and 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayExceptions(): void { @@ -65,21 +59,21 @@ public function testHolidayExceptions(): void self::REGION, self::HOLIDAY, 1995, - new DateTime('1995-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1995-5-8', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2020, - new DateTime('2020-5-8', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2020-5-8', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/NewYearsDayTest.php b/tests/UnitedKingdom/Wales/NewYearsDayTest.php index b35bfe2a1..a9ac5664c 100644 --- a/tests/UnitedKingdom/Wales/NewYearsDayTest.php +++ b/tests/UnitedKingdom/Wales/NewYearsDayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -49,8 +45,7 @@ class NewYearsDayTest extends WalesBaseTestCase implements HolidayTestCase * @param int $year the year for which the holiday defined in this test needs to be tested * @param string $expected the expected date * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayOnAfterEstablishment(int $year, string $expected): void { @@ -58,14 +53,14 @@ public function testHolidayOnAfterEstablishment(int $year, string $expected): vo self::REGION, self::HOLIDAY, $year, - new DateTime($expected, new DateTimeZone(self::TIMEZONE)) + new \DateTime($expected, new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -79,7 +74,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests that the holiday defined in this test is of the type 'observance' before the year it was changed. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayIsObservedTypeBeforeChange(): void { @@ -94,9 +89,9 @@ public function testHolidayIsObservedTypeBeforeChange(): void /** * Returns a list of random test dates used for assertion of the holiday defined in this test. * - * @return array list of test dates for the holiday defined in this test + * @return array list of test dates for the holiday defined in this test * - * @throws Exception + * @throws \Exception */ public function HolidayDataProvider(): array { @@ -106,7 +101,7 @@ public function HolidayDataProvider(): array /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -121,7 +116,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php b/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php index 1bed1806d..1f0960803 100644 --- a/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/SpringBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -39,8 +35,7 @@ class SpringBankHolidayTest extends WalesBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -49,15 +44,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("$year-5-30", new DateTimeZone(self::TIMEZONE)) + new \DateTime("$year-5-30", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exceptions in 2002 and 2012. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayException(): void { @@ -65,21 +59,21 @@ public function testHolidayException(): void self::REGION, self::HOLIDAY, 2002, - new DateTime('2002-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2002-6-4', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 2012, - new DateTime('2012-6-4', new DateTimeZone(self::TIMEZONE)) + new \DateTime('2012-6-4', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -93,7 +87,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -108,7 +102,7 @@ public function testTranslation(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php b/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php index 9cc37231e..218dd6999 100644 --- a/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php +++ b/tests/UnitedKingdom/Wales/SummerBankHolidayTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,10 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use DateTime; -use DateTimeZone; -use Exception; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\HolidayTestCase; @@ -44,8 +40,7 @@ class SummerBankHolidayTest extends WalesBaseTestCase implements HolidayTestCase /** * Tests the holiday defined in this test. * - * @throws Exception - * @throws ReflectionException + * @throws \Exception */ public function testHoliday(): void { @@ -54,15 +49,14 @@ public function testHoliday(): void self::REGION, self::HOLIDAY, $year, - new DateTime("last monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("last monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday exception in 2020. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayBefore1965(): void { @@ -71,15 +65,14 @@ public function testHolidayBefore1965(): void self::REGION, self::HOLIDAY, $year, - new DateTime("first monday of august $year", new DateTimeZone(self::TIMEZONE)) + new \DateTime("first monday of august $year", new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday during trial period in 1965-1970. * - * @throws ReflectionException - * @throws Exception + * @throws \Exception */ public function testHolidayTrialPeriod(): void { @@ -87,44 +80,44 @@ public function testHolidayTrialPeriod(): void self::REGION, self::HOLIDAY, 1965, - new DateTime('1965-8-30', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1965-8-30', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1966, - new DateTime('1966-8-29', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1966-8-29', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1967, - new DateTime('1967-8-28', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1967-8-28', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1968, - new DateTime('1968-9-2', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1968-9-2', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1969, - new DateTime('1969-9-1', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1969-9-1', new \DateTimeZone(self::TIMEZONE)) ); $this->assertHoliday( self::REGION, self::HOLIDAY, 1970, - new DateTime('1970-8-31', new DateTimeZone(self::TIMEZONE)) + new \DateTime('1970-8-31', new \DateTimeZone(self::TIMEZONE)) ); } /** * Tests the holiday defined in this test before establishment. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayBeforeEstablishment(): void { @@ -138,7 +131,7 @@ public function testHolidayBeforeEstablishment(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslation(): void { @@ -153,7 +146,7 @@ public function testTranslation(): void /** * Tests the translated name of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testTranslationBeforeRename(): void { @@ -168,7 +161,7 @@ public function testTranslationBeforeRename(): void /** * Tests type of the holiday defined in this test. * - * @throws ReflectionException + * @throws \Exception */ public function testHolidayType(): void { diff --git a/tests/UnitedKingdom/Wales/WalesBaseTestCase.php b/tests/UnitedKingdom/Wales/WalesBaseTestCase.php index 84ea75288..40bfccf34 100644 --- a/tests/UnitedKingdom/Wales/WalesBaseTestCase.php +++ b/tests/UnitedKingdom/Wales/WalesBaseTestCase.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/UnitedKingdom/Wales/WalesTest.php b/tests/UnitedKingdom/Wales/WalesTest.php index 7eda1f42e..a0082d6c1 100644 --- a/tests/UnitedKingdom/Wales/WalesTest.php +++ b/tests/UnitedKingdom/Wales/WalesTest.php @@ -4,7 +4,7 @@ /* * This file is part of the Yasumi package. * - * Copyright (c) 2015 - 2022 AzuyaLabs + * Copyright (c) 2015 - 2023 AzuyaLabs * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,6 @@ namespace Yasumi\tests\UnitedKingdom\Wales; -use ReflectionException; use Yasumi\Holiday; use Yasumi\tests\ProviderTestCase; @@ -26,10 +25,12 @@ class WalesTest extends WalesBaseTestCase implements ProviderTestCase /** * @var int year random year number used for all tests in this Test Case */ - protected $year; + protected int $year; /** * Initial setup of this Test Case. + * + * @throws \Exception */ protected function setUp(): void { @@ -38,8 +39,6 @@ protected function setUp(): void /** * Tests if all official holidays in Wales are defined by the provider class. - * - * @throws ReflectionException */ public function testOfficialHolidays(): void { @@ -51,8 +50,6 @@ public function testOfficialHolidays(): void /** * Tests if all observed holidays in Wales are defined by the provider class. - * - * @throws ReflectionException */ public function testObservedHolidays(): void { @@ -61,8 +58,6 @@ public function testObservedHolidays(): void /** * Tests if all seasonal holidays in Wales are defined by the provider class. - * - * @throws ReflectionException */ public function testSeasonalHolidays(): void { @@ -71,24 +66,41 @@ public function testSeasonalHolidays(): void /** * Tests if all bank holidays in Wales are defined by the provider class. - * - * @throws ReflectionException */ public function testBankHolidays(): void { - $this->assertDefinedHolidays([ - 'newYearsDay', + $holidays = [ 'easterMonday', - 'mayDayBankHoliday', - 'springBankHoliday', 'secondChristmasDay', - ], self::REGION, $this->year, Holiday::TYPE_BANK); + ]; + + $year = $this->generateRandomYear(); + + if (1965 >= $this->year) { + $holidays[] = 'springBankHoliday'; + } + + if (1974 > $this->year) { + $holidays[] = 'newYearsDay'; + } + + if (1978 >= $this->year) { + $holidays[] = 'mayDayBankHoliday'; + } + + if (2022 === $year) { + $holidays[] = 'queenElizabethFuneralBankHoliday'; + } + + if (2023 === $year) { + $holidays[] = 'kingCharlesCoronationBankHoliday'; + } + + $this->assertDefinedHolidays($holidays, self::REGION, $year, Holiday::TYPE_BANK); } /** * Tests if all other holidays in Wales are defined by the provider class. - * - * @throws ReflectionException */ public function testOtherHolidays(): void { @@ -96,7 +108,8 @@ public function testOtherHolidays(): void } /** - * @throws ReflectionException + * @throws \ReflectionException + * @throws \Exception */ public function testSources(): void { diff --git a/tests/YasumiBase.php b/tests/YasumiBase.php index c1f756842..2afc84194 100644 --- a/tests/YasumiBase.php +++ b/tests/YasumiBase.php @@ -1,10 +1,11 @@ $expectedHolidays list of all known holidays of the given provider + * @param string $provider holiday provider (i.e. country/state) for which the holidays need to be + * tested. + * @param int $year holiday calendar year + * @param string $type type of holiday. Use the following constants: TYPE_OFFICIAL, + * TYPE_OBSERVANCE, TYPE_SEASON, TYPE_BANK or TYPE_OTHER. * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException */ public function assertDefinedHolidays( array $expectedHolidays, @@ -84,32 +73,30 @@ public function assertDefinedHolidays( break; } - // Loop through all known holidays and assert they are defined by the provider class + // Loop through all known holidays and assert they are defined by the provider class. foreach ($expectedHolidays as $holiday) { self::assertArrayHasKey($holiday, iterator_to_array($holidays)); } } /** - * Asserts that the expected date is indeed a holiday for that given year and name. + * Asserts expected date is a holiday for the given year and name. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key string the key of the holiday to be checked against - * @param int $year holiday calendar year - * @param DateTime $expected the date to be checked against + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the holiday to be checked against + * @param int $year holiday calendar year + * @param \DateTime $expected date to be checked against * * @throws UnknownLocaleException - * @throws InvalidDateException - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws AssertionFailedError - * @throws ReflectionException */ public function assertHoliday( string $provider, string $key, int $year, - DateTime $expected + \DateTimeInterface $expected ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); @@ -120,25 +107,23 @@ public function assertHoliday( } /** - * Asserts that the expected date is indeed a substitute holiday for that given year and name. + * Asserts the expected date is a substitute holiday for that given year and name. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key string the key of the substituted holiday to be checked against - * @param int $year holiday calendar year - * @param DateTime $expected the date to be checked against + * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the substituted holiday to be checked against + * @param int $year holiday calendar year + * @param \DateTime $expected date to be checked against * * @throws UnknownLocaleException - * @throws InvalidDateException - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws AssertionFailedError - * @throws ReflectionException */ public function assertSubstituteHoliday( string $provider, string $key, int $year, - DateTime $expected + \DateTimeInterface $expected ): void { $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday('substituteHoliday:'.$key); @@ -149,18 +134,16 @@ public function assertSubstituteHoliday( } /** - * Asserts that the given substitute holiday for that given year does not exist. + * Asserts the given substitute holiday for a given year does not exist. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key the key of the substituted holiday to be checked against + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the substituted holiday to be checked against * @param int $year holiday calendar year * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws InvalidDateException * @throws AssertionFailedError - * @throws ReflectionException */ public function assertNotSubstituteHoliday( string $provider, @@ -175,18 +158,16 @@ public function assertNotSubstituteHoliday( } /** - * Asserts that the given holiday for that given year does not exist. + * Asserts the given holiday for a given year does not exist. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key the key of the holiday to be checked against + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the holiday to be checked against * @param int $year holiday calendar year * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws InvalidDateException * @throws AssertionFailedError - * @throws ReflectionException */ public function assertNotHoliday( string $provider, @@ -200,18 +181,17 @@ public function assertNotHoliday( } /** - * Asserts that the expected name is indeed provided as a translated holiday name for that given year and name. + * Asserts the expected name is provided as a translated holiday name for that given year and name. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be tested - * @param string $key string the key of the holiday to be checked against - * @param int $year holiday calendar year - * @param array $translations the translations to be checked against + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the holiday to be checked against + * @param int $year holiday calendar year + * @param array $translations translations to be checked against * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException * @throws AssertionFailedError - * @throws ReflectionException */ public function assertTranslatedHolidayName( string $provider, @@ -222,44 +202,41 @@ public function assertTranslatedHolidayName( $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); - self::assertInstanceOf(Holiday::class, $holiday); - self::assertTrue($holidays->isHoliday($holiday)); + self::assertInstanceOf(Holiday::class, $holiday, sprintf('No instance for the year `%u`', $year)); + self::assertTrue($holidays->isHoliday($holiday), sprintf('Holiday `%s` not defined for the year `%u`', $key, $year)); - if (\is_array($translations) && !empty($translations)) { - foreach ($translations as $locale => $name) { - $locales = [$locale]; - $parts = explode('_', $locale); - while (array_pop($parts) && $parts) { - $locales[] = implode('_', $parts); - } + foreach ($translations as $locale => $name) { + $locales = [$locale]; + $parts = explode('_', $locale); + while (array_pop($parts) && $parts) { + $locales[] = implode('_', $parts); + } - $translation = null; - foreach ($locales as $l) { - if (isset($holiday->translations[$l])) { - $translation = $holiday->translations[$l]; - break; - } + $translation = null; + foreach ($locales as $l) { + if (isset($holiday->translations[$l])) { + $translation = $holiday->translations[$l]; + break; } - - self::assertTrue(isset($translation)); - self::assertEquals($name, $translation); } + + self::assertTrue(isset($translation)); + self::assertEquals($name, $translation); } } /** - * Asserts that the expected type is indeed the associated type of the given holiday. + * Asserts the expected type is the associated type for the given holiday. * - * @param string $provider the holiday provider (i.e. country/region) for which the holiday need to be tested - * @param string $key string the key of the holiday to be checked against + * @param string $provider holiday provider (i.e. country/region) for which the holiday need to be tested. + * @param string $key the key of the holiday to be checked against * @param int $year holiday calendar year - * @param string $type the type to be checked against + * @param string $type type to be checked against * - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws AssertionFailedError * @throws UnknownLocaleException - * @throws ReflectionException */ public function assertHolidayType( string $provider, @@ -270,24 +247,22 @@ public function assertHolidayType( $holidays = Yasumi::create($provider, $year); $holiday = $holidays->getHoliday($key); - self::assertInstanceOf(Holiday::class, $holiday); - self::assertEquals($type, $holiday->getType()); + self::assertInstanceOf(Holiday::class, $holiday, sprintf('No instance for the year `%u`', $year)); + self::assertEquals($type, $holiday->getType(), sprintf('Expected type `%s`, got `%s` for the year `%u`', $type, $holiday->getType(), $year)); } /** - * Asserts that the expected week day is indeed the week day for the given holiday and year. + * Asserts the expected week day is the week day for the given holiday and year. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be - * tested - * @param string $key string the key of the holiday to be checked against + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param string $key key of the holiday to be checked against * @param int $year holiday calendar year - * @param string $expectedDayOfWeek the expected week day (i.e. "Saturday", "Sunday", etc.) + * @param string $expectedDayOfWeek expected week day (i.e. "Saturday", "Sunday", etc.). * * @throws AssertionFailedError - * @throws InvalidArgumentException - * @throws RuntimeException + * @throws \InvalidArgumentException + * @throws \RuntimeException * @throws UnknownLocaleException - * @throws ReflectionException */ public function assertDayOfWeek( string $provider, @@ -304,13 +279,12 @@ public function assertDayOfWeek( } /** - * Asserts that the holiday provider has the number of expected sources defined. + * Asserts the holiday provider has the expected sources number. * - * @param string $provider the holiday provider (i.e. country/state) for which the holiday need to be - * tested - * @param int $expectedSourceCount the expected number of sources + * @param string $provider holiday provider (i.e. country/state) for which the holiday need to be tested. + * @param int $expectedSourceCount expected sources number * - * @throws ReflectionException + * @throws \Exception */ public function assertSources(string $provider, int $expectedSourceCount): void { @@ -318,414 +292,4 @@ public function assertSources(string $provider, int $expectedSourceCount): void self::assertCount($expectedSourceCount, $holidayProvider->getSources()); } - - /** - * Returns a list of random test dates used for assertion of holidays. - * - * @param int $month month (number) for which the test date needs to be generated - * @param int $day day (number) for which the test date needs to be generated - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomDates( - int $month, - int $day, - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $data = []; - $range = $range ?? 1000; - for ($y = 1; $y <= ($iterations ?? 10); ++$y) { - $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); - $data[] = [$year, new DateTime("$year-$month-$day", new DateTimeZone($timezone ?? 'UTC'))]; - } - - return $data; - } - - /** - * Returns a list of random easter test dates used for assertion of holidays. - * - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random easter test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomEasterDates( - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $data = []; - $range = $range ?? 1000; - - for ($i = 1; $i <= ($iterations ?? 10); ++$i) { - $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); - $date = $this->calculateEaster($year, $timezone ?? 'UTC'); - - $data[] = [$year, $date->format('Y-m-d')]; - } - - return $data; - } - - /** - * Returns a list of random Easter Monday test dates used for assertion of holidays. - * - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random Easter Monday test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomEasterMondayDates( - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $range = $range ?? 1000; - - return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { - $date->add(new DateInterval('P1D')); - }, $timezone ?? 'UTC', $iterations ?? 10, $range); - } - - /** - * Returns a list of random modified Easter day test dates for assertion of holidays. - * - * @param callable $cb callback(DateTime $date) to modify $date by custom rules - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random modified Easter day test dates for assertion of holidays - * - * @throws Exception - */ - public function generateRandomModifiedEasterDates( - callable $cb, - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $data = []; - $range = $range ?? 1000; - for ($i = 1; $i <= ($iterations ?? 10); ++$i) { - $year = (int) self::dateTimeBetween("-$range years", "+$range years")->format('Y'); - $date = $this->calculateEaster($year, $timezone ?? 'UTC'); - - $cb($date); - - $data[] = [$year, $date->format('Y-m-d')]; - } - - return $data; - } - - /** - * Returns a list of random Good Friday test dates used for assertion of holidays. - * - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random Good Friday test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomGoodFridayDates( - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $range = $range ?? 1000; - - return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { - $date->sub(new DateInterval('P2D')); - }, $timezone ?? 'UTC', $iterations ?? 10, $range); - } - - /** - * Returns a list of random Pentecost test dates used for assertion of holidays. - * - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random Pentecost test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomPentecostDates( - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - $range = $range ?? 1000; - - return $this->generateRandomModifiedEasterDates(static function (DateTime $date) { - $date->add(new DateInterval('P49D')); - }, $timezone ?? 'UTC', $iterations ?? 10, $range); - } - - /** - * Returns a list of random test dates used for assertion of holidays. If the date falls in a weekend, random - * holiday day is moved to to Monday. - * - * @param int $month month (number) for which the test date needs to be generated - * @param int $day day (number) for which the test date needs to be generated - * @param string|null $timezone name of the timezone for which the dates need to be generated - * @param int|null $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int|null $range year range from which dates will be generated (default: 1000) - * - * @return array list of random test dates used for assertion of holidays - * - * @throws Exception - */ - public function generateRandomDatesWithHolidayMovedToMonday( - int $month, - int $day, - string $timezone = null, - int $iterations = null, - int $range = null - ): array { - return $this->generateRandomDatesWithModifier($month, $day, function ($range, DateTime $date) { - if ($this->isWeekend($date)) { - $date->modify('next monday'); - } - }, $iterations ?? 10, $range, $timezone ?? 'UTC'); - } - - /** - * Returns a list of random test dates used for assertion of holidays with applied callback. - * - * @param int $month month (number) for which the test date needs to be generated - * @param int $day day (number) for which the test date needs to be generated - * @param callable $callback callback(int $year, \DateTime $dateTime) to modify $dateTime by custom rules - * @param int $iterations number of iterations (i.e. samples) that need to be generated (default: 10) - * @param int $range year range from which dates will be generated (default: 1000) - * @param string|null $timezone name of the timezone for which the dates need to be generated - * - * @return array list of random test dates used for assertion of holidays with applied callback - * - * @throws Exception - */ - public function generateRandomDatesWithModifier( - int $month, - int $day, - callable $callback, - int $iterations, - int $range, - string $timezone = null - ): array { - $data = []; - - for ($i = 1; $i <= $iterations; ++$i) { - $year = $this->generateRandomYear($range); - $date = new DateTime("$year-$month-$day", new DateTimeZone($timezone ?? 'UTC')); - - $callback($year, $date); - - $data[] = [$year, $date->format('Y-m-d')]; - } - - return $data; - } - - /** - * Generates a random year (number). - * - * @param int|null $lowerLimit the lower limit for generating a year number (default: 1000) - * @param int|null $upperLimit the upper limit for generating a year number (default: 9999) - * - * @return int a year number - */ - public function generateRandomYear( - int $lowerLimit = null, - int $upperLimit = null - ): int { - return self::numberBetween($lowerLimit ?? 1000, $upperLimit ?? 9999); - } - - /** - * Checks if given $dateTime is a weekend. - * - * @param DateTimeInterface $dateTime date for which weekend will be checked - * @param array $weekendDays weekend days. Saturday and Sunday are used by default. - * - * @return bool true if $dateTime is a weekend, false otherwise - */ - public function isWeekend( - DateTimeInterface $dateTime, - array $weekendDays = [0, 6] - ): bool { - return \in_array((int) $dateTime->format('w'), $weekendDays, true); - } - - /** - * Returns a random number between $int1 and $int2 (any order). - * - * @param int $int1 default to 0 - * @param int $int2 defaults to 32 bit max integer, ie 2147483647 - * - * @example 79907610 - */ - public static function numberBetween($int1 = 0, $int2 = 2147483647): int - { - $min = $int1 < $int2 ? $int1 : $int2; - $max = $int1 < $int2 ? $int2 : $int1; - - return random_int($min, $max); - } - - /** - * Get a DateTime object based on a random date between two given dates. - * Accepts date strings that can be recognized by strtotime(). - * - * @param \DateTime|string $startDate Defaults to 30 years ago - * @param \DateTime|string $endDate Defaults to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @example DateTime('1999-02-02 11:42:52') - * - * @see http://php.net/manual/en/timezones.php - * @see http://php.net/manual/en/function.date-default-timezone-get.php - */ - public static function dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null): DateTime - { - $startTimestamp = $startDate instanceof \DateTime ? $startDate->getTimestamp() : strtotime($startDate); - $endTimestamp = static::getMaxTimestamp($endDate); - - if ($startTimestamp > $endTimestamp) { - throw new \InvalidArgumentException('Start date must be anterior to end date.'); - } - - $timestamp = random_int($startTimestamp, $endTimestamp); - - return static::setTimezone( - new \DateTime('@'.$timestamp), - $timezone - ); - } - - /** - * Calculates the date for Easter. - * - * Easter is a festival and holiday celebrating the resurrection of Jesus Christ from the dead. Easter is celebrated - * on a date based on a certain number of days after March 21st. - * - * This function uses the standard PHP 'easter_days' function if the calendar extension is enabled. In case the - * calendar function is not enabled, a fallback calculation has been implemented that is based on the same - * 'easter_days' c function. - * - * Note: In calendrical calculations, frequently operations called integer division are used. - * - * @param int $year the year for which Easter needs to be calculated - * @param string $timezone the timezone in which Easter is celebrated - * - * @return DateTime date of Easter - * - * @throws Exception - * - * @see easter_days - * @see https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/ext/calendar/easter.c - * @see http://www.gmarts.org/index.php?go=415#EasterMallen - * @see http://www.tondering.dk/claus/cal/easter.php - */ - protected function calculateEaster(int $year, string $timezone): DateTimeInterface - { - if (\extension_loaded('calendar')) { - $easter_days = easter_days($year); - } else { - $golden = (($year % 19) + 1); // The Golden Number - - // The Julian calendar applies to the original method from 326AD. The Gregorian calendar was first - // introduced in October 1582 in Italy. Easter algorithms using the Gregorian calendar apply to years - // 1583 AD to 4099 (A day adjustment is required in or shortly after 4100 AD). - // After 1752, most western churches have adopted the current algorithm. - if ($year <= 1752) { - $dom = ($year + (int) ($year / 4) + 5) % 7; // The 'Dominical number' - finding a Sunday - if ($dom < 0) { - $dom += 7; - } - - $pfm = (3 - (11 * $golden) - 7) % 30; // Uncorrected date of the Paschal full moon - if ($pfm < 0) { - $pfm += 30; - } - } else { - $dom = ($year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400)) % 7; // The 'Dominical number' - finding a Sunday - if ($dom < 0) { - $dom += 7; - } - - $solar = (int) (($year - 1600) / 100) - (int) (($year - 1600) / 400); // The solar correction - $lunar = (int) (((int) (($year - 1400) / 100) * 8) / 25); // The lunar correction - - $pfm = (3 - (11 * $golden) + $solar - $lunar) % 30; // Uncorrected date of the Paschal full moon - if ($pfm < 0) { - $pfm += 30; - } - } - - // Corrected date of the Paschal full moon, - days after 21st March - if ((29 === $pfm) || (28 === $pfm && $golden > 11)) { - --$pfm; - } - - $tmp = (4 - $pfm - $dom) % 7; - if ($tmp < 0) { - $tmp += 7; - } - - $easter_days = ($pfm + $tmp + 1); // Easter as the number of days after 21st March - } - - $easter = new DateTime("$year-3-21", new DateTimeZone($timezone)); - $easter->add(new DateInterval('P'.$easter_days.'D')); - - return $easter; - } - - /** - * @param \DateTime|string|float|int $max - * - * @return int|false - */ - protected static function getMaxTimestamp($max = 'now') - { - if (is_numeric($max)) { - return (int) $max; - } - - if ($max instanceof \DateTime) { - return $max->getTimestamp(); - } - - return strtotime(empty($max) ? 'now' : $max); - } - - /** - * Internal method to set the time zone on a DateTime. - */ - private static function setTimezone(DateTime $dt, ?string $timezone): DateTime - { - return $dt->setTimezone(new \DateTimeZone(static::resolveTimezone($timezone))); - } - - private static function resolveTimezone(?string $timezone): ?string - { - return $timezone ?? (static::$defaultTimezone ?? date_default_timezone_get()); - } }