Skip to content

Commit

Permalink
Merge branch 'develop' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Jan 7, 2024
2 parents 8358241 + 9c8af7f commit c4ed1e8
Show file tree
Hide file tree
Showing 1,691 changed files with 2,429 additions and 1,936 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
52 changes: 38 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Change Log
# Changelog

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).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Changes related to the business logic of the holidays or their providers are listed first, followed by any technical or architectural
changes.
Expand All @@ -12,29 +12,48 @@ changes.

### Added

### Changed

### Fixed

### Removed

## [2.7.0] - 2024-01-02

### Added

- Mexico Provider [\#329](https://github.com/azuyalabs/yasumi/pull/329) ([Luis Gonzalez](https://github.com/gogl92)).
- From 2024, Romania will officially include the holidays of St. Johns ('Sfântul Ioan Botezătorul') and Epiphany ('Bobotează').
[#310](https://github.com/azuyalabs/yasumi/pull/310) ([AngelinCalu](https://github.com/AngelinCalu) )
- For the German state of Mecklenburg-Western Pomerania, International Womens Day is considered to be officially
- For the German state of Mecklenburg-Western Pomerania, International Women's Day is considered to be officially
observed. [#311](https://github.com/azuyalabs/yasumi/pull/311) ([ihmels](https://github.com/ihmels))
- Recently, the South Korean government announced a bill to apply alternative public holidays to Buddha's Day
and Christmas Day, which we have reflected in our South Korea provider.
and Christmas Day.
[\#314](https://github.com/azuyalabs/yasumi/pull/314) ([barami](https://github.com/barami))
- Include PHP 8.3 in the unit test CI pipeline. [#328](https://github.com/azuyalabs/yasumi/pull/328) ([fezfez](https://github.com/fezfez))
- Extra checks in case date subtraction fails for some holiday providers.
- PHP 8.3 support for the unit test CI pipeline. [#328](https://github.com/azuyalabs/yasumi/pull/328) ([fezfez](https://github.com/fezfez))
- Add code styling rules to have a space after the `NOT` operator and mark parameters with a default null value as nullable.

### Changed

- Updated links to related documentation in the SouthKorea provider's note and added links to conversion utilities.
[\#314](https://github.com/azuyalabs/yasumi/pull/314) ([barami](https://github.com/barami))
- Refactored the complexity of the SouthKorea provider to make it easier to understand in case of future changes.
- Refactor the rules for calculating holidays in South Korea based on the history of holiday changes.
([#314](https://github.com/azuyalabs/yasumi/issues/314)) [barami](https://github.com/[email protected])
- Update links to related documentation in the South Korea provider's note and added links to conversion utilities.
[\#314](https://github.com/azuyalabs/yasumi/pull/314) ([barami](https://github.com/barami))
- Optimize the method for the Emperor's birthday calculation in Japan.
- For Croatia, extract Day of Antifascist Struggle calculation to a private method and simplify Statehood Day calculation
to make it more concise.
- Simplify the conditions for the Coming of Age day (Japan) calculation.
- Simplify the calculation of Carnival in Argentina, Brazil and the Netherlands to reduce duplication.
- Avoid silent exceptions by throwing a new one from the previous exception.

### Fixed

- In the South Korea provider some of the past dates for Buddha's Day, Chuseok, Armed Forces Day
and United Nations Day were incorrect during holidays. [\#314](https://github.com/azuyalabs/yasumi/pull/314) ([barami](https://github.com/barami))
- The holiday `twoDaysLaterNewYearsDay` has been removed from 1990, however the unit test for the name and holiday type
allowed the possible testing range to include the year 1990.
- For South Korea, some of the past dates for Buddha's Day, Chuseok, Armed Forces Day
and United Nations Day were incorrectly calculated during for certain periods. [\#314](https://github.com/azuyalabs/yasumi/pull/314) ([barami](https://github.com/barami))
- The holiday `twoDaysLaterNewYearsDay` of South Korea has been removed from 1990, however the unit test for the name
and holiday type allowed the possible testing range to include the year 1990.
- New Years Day tests for South Korea were failing due to incorrect date checks.
- The Easter Date calculation resulted in wrong values for the year 2025, due to an incorrect rounding for the lunar
correction when the calendar extension is not used. [#326](https://github.com/azuyalabs/yasumi/pull/326) ([rChassat](https://github.com/rChassat))

Expand All @@ -44,8 +63,11 @@ changes.
- Summertime and Wintertime in the Netherlands and Denmark as these can't be reliably established for historical dates and
aren't true holidays in the context of Yasumi. Refer to this [discussion](https://github.com/azuyalabs/yasumi/discussions/321)
for further details and rationale. [#322](https://github.com/azuyalabs/yasumi/pull/322)
- PHP 7.4 support.
- The PHP [Infection](https://infection.github.io/) test package as it was hardly used.
- Unit tests from a Git export to reduce the export size. [#323](https://github.com/azuyalabs/yasumi/pull/323) ([fezfez](https://github.com/fezfez))
- Checks for superfluous naming as we follow PER which supports such convention.
- MacOS from testing matrix as it returns errors (requires further investigation).

## [2.6.0] - 2023-04-27

Expand Down Expand Up @@ -787,7 +809,9 @@ changes.

- Initial Release

[Unreleased]: https://github.com/azuyalabs/yasumi/compare/2.6.0...HEAD
[Unreleased]: https://github.com/azuyalabs/yasumi/compare/2.7.0...HEAD

[2.7.0]: https://github.com/azuyalabs/yasumi/compare/2.6.0...2.7.0

[2.6.0]: https://github.com/azuyalabs/yasumi/compare/2.5.0...2.6.0

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 - 2023 AzuyaLabs
Copyright (c) 2015 - 2024 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
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"@psalm"
],
"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",
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
require 'vendor/autoload.php';

/** Provider for all observed holidays by the NYSE (New York Stock Exchange) */
class NYSE extends \Yasumi\Provider\USA
class NYSE extends Yasumi\Provider\USA
{
/**
* Initialize holidays for the NYSE.
*
* @throws \Exception
* @throws Exception
*/
public function initialize(): void
{
Expand Down
16 changes: 8 additions & 8 deletions phpinsights.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@
],

'remove' => [
\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class,
\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowShortTernaryOperatorSniff::class,
\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class,
\SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowShortTernaryOperatorSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class,
SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class,

// Remove checks for superfluous naming as we follow PER which supports such convention
\SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class,
\SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class,
\SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class,
],

'config' => [
\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
'lineLimit' => 120,
'absoluteLineLimit' => 140,
'ignoreComments' => false,
Expand Down
21 changes: 12 additions & 9 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
parameters:
level: 6
paths:
- src
- examples
ignoreErrors:
-
message: '#Comparison operation "<=" between [0-9]+ and int<[0-9]+, max> is always true.#'
path: src/Yasumi/Provider/Turkey.php
checkGenericClassInNonGenericObjectType: false
level: 6
paths:
- src
- examples
ignoreErrors:
-
message: '#Comparison operation "<=" between [0-9]+ and int<[0-9]+, max> is always true.#'
path: src/Yasumi/Provider/Turkey.php
checkGenericClassInNonGenericObjectType: false
reportUnmatchedIgnoredErrors: true # Do not allow outdated errors in the baseline
treatPhpDocTypesAsCertain: false
tipsOfTheDay: false
18 changes: 11 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
<!--
~ This file is part of the Yasumi package.
~
~ Copyright (c) 2015 - 2023 AzuyaLabs
~ Copyright (c) 2015 - 2024 AzuyaLabs
~
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
~
~ @author Sacha Telgenhof <me at sachatelgenhof dot com>
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
>

<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src/Yasumi</directory>
Expand All @@ -23,6 +26,7 @@
<directory suffix=".php">./src/Yasumi/data</directory>
</exclude>
</coverage>

<testsuites>
<testsuite name="Yasumi Test Suite">
<directory>./tests</directory>
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
~ This file is part of the Yasumi package.
~
~ Copyright (c) 2015 - 2023 AzuyaLabs
~ Copyright (c) 2015 - 2024 AzuyaLabs
~
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
Expand Down
7 changes: 5 additions & 2 deletions src/Yasumi/Exception/Exception.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,4 +18,6 @@
/**
* Interface Exception.
*/
interface Exception {}
interface Exception
{
}
6 changes: 4 additions & 2 deletions src/Yasumi/Exception/InvalidYearException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -20,4 +20,6 @@
*
* @author Quentin Neyrat <[email protected]>
*/
class InvalidYearException extends \InvalidArgumentException implements Exception {}
class InvalidYearException extends \InvalidArgumentException implements Exception
{
}
3 changes: 2 additions & 1 deletion src/Yasumi/Exception/MissingTranslationException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
7 changes: 5 additions & 2 deletions src/Yasumi/Exception/ProviderNotFoundException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -19,4 +20,6 @@
*
* @author Quentin Neyrat <[email protected]>
*/
class ProviderNotFoundException extends \InvalidArgumentException implements Exception {}
class ProviderNotFoundException extends \InvalidArgumentException implements Exception
{
}
7 changes: 5 additions & 2 deletions src/Yasumi/Exception/UnknownLocaleException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,4 +18,6 @@
/**
* Class UnknownLocaleException.
*/
class UnknownLocaleException extends \InvalidArgumentException implements Exception {}
class UnknownLocaleException extends \InvalidArgumentException implements Exception
{
}
2 changes: 1 addition & 1 deletion src/Yasumi/Filters/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
3 changes: 2 additions & 1 deletion src/Yasumi/Filters/BankHolidaysFilter.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Filters/BetweenFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
3 changes: 2 additions & 1 deletion src/Yasumi/Filters/ObservedHolidaysFilter.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
3 changes: 2 additions & 1 deletion src/Yasumi/Filters/OfficialHolidaysFilter.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Filters/OnFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2023 AzuyaLabs
* Copyright (c) 2015 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
Loading

0 comments on commit c4ed1e8

Please sign in to comment.