Skip to content

Commit

Permalink
Merge branch 'release/2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Apr 26, 2023
2 parents ffe6342 + 8db37cd commit a73f198
Show file tree
Hide file tree
Showing 1,697 changed files with 11,707 additions and 16,889 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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

17 changes: 10 additions & 7 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

52 changes: 0 additions & 52 deletions .github/workflows/mutation-tests.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
32 changes: 19 additions & 13 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

/**
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2022 AzuyaLabs
* Copyright (c) 2015 - 2023 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -14,17 +16,21 @@

$config = new PhpCsFixer\Config();
$config->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;
77 changes: 75 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading

0 comments on commit a73f198

Please sign in to comment.