Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Mar 29, 2019
2 parents f756448 + 6eaad09 commit 5a086db
Show file tree
Hide file tree
Showing 97 changed files with 783 additions and 276 deletions.
34 changes: 29 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,41 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Removed


## [2.1.0] - 2019-03-29

### Added
- As the Japanese Emperor will abdicate the throne on May 1st 2019, the holiday of the Emporers Birthday will change to February 23rd from 2020 (No holiday in 2019). In addition, Coronation Day and the Enthronement Proclamation Ceremony will be extra holidays in 2019. [\#130](https://github.com/azuyalabs/yasumi/pull/130) ([cookie-maker](https://github.com/cookie-maker))
- International Women's Day is an official holiday since 2019 in Berlin (Germany). [#133](https://github.com/azuyalabs/yasumi/pull/133) ([huehnerhose](https://github.com/huehnerhose))

### Changed
- Japanese Health And Sports Day will be renamed to Sports Day from 2020. [\#129](https://github.com/azuyalabs/yasumi/pull/129) ([cookie-maker](https://github.com/cookie-maker))
- Dutch spelling for Easter/Pentecost/Christmas to use lower case. [\#128](https://github.com/azuyalabs/yasumi/pull/128) ([c960657](https://github.com/c960657))
- Refactored the Netherlands Holiday provider by moving the calculation of individual holidays to private methods. This will reduce the complexity of the initialize method.
- Visibility of internal class functions to 'private'. These are to be used within the class only and should not be public.

### Fixed
- "Bridge Day" for Japan takes two days in 2019. Currently the code only allows for 1 bridge day at a maximum. [\#141](https://github.com/azuyalabs/yasumi/pull/141) ([cookie-maker](https://github.com/cookie-maker))
- Tests for Bremen, Lower Saxony and Schleswig Holstein (Germany) also celebrated Reformation Day in 2017. The unit tests were failing as it didn't account for that.
- Changed the USA Provider to check all holidays for potential substitute holidays, not just New Year's Day, Independence Day, and Christmas Day. [\#140](https://github.com/azuyalabs/yasumi/pull/140) ([jagers](https://github.com/jagers))
- Adjusted tests for the 'next' and 'previous' methods to avoid actually exceeding the year boundaries.
- Deprecation warning for the package mikey179/vfStream. Composer 2.0 requires package names to not contain any upper case characters. [\#135](https://github.com/azuyalabs/yasumi/pull/135) ([IceShack](https://github.com/IceShack))
- Incorrect comment about weekends in India [\#126](https://github.com/azuyalabs/yasumi/pull/126) ([c960657](https://github.com/c960657))
- Correction to the test of New Year's day in the United Kingdom. It has been identified as a Bank Holiday only since 1975 (not from 1974).

### Removed
- Duplicate definition of newYearsDay [\#125](https://github.com/azuyalabs/yasumi/pull/125) ([c960657](https://github.com/c960657))


## [2.0.0] - 2019-01-11

### Added
- New filter to select holidays that happen on a given date [\#119](https://github.com/azuyalabs/yasumi/pull/119) ([cruxicheiros](https://github.com/cruxicheiros))
- Holiday Providers for all Australian states and territories. [\#112](https://github.com/azuyalabs/yasumi/pull/112) ([Milamber33](https://github.com/Milamber33))
- Holiday Provider for Bosnia. [\#94](https://github.com/azuyalabs/yasumi/pull/94) ([TheAdnan](https://github.com/TheAdnan))
- Added Reformation Day as offical holiday since 2018 in Lower Saxony (Germany). [#115](https://github.com/azuyalabs/yasumi/issues/115) ([Taxcamp](https://github.com/Taxcamp))
- Added Reformation Day as offical holiday since 2018 in Schleswig-Holstein (Germany). [#106](https://github.com/azuyalabs/yasumi/pull/106) ([HenningCash](https://github.com/HenningCash))
- Added Reformation Day as offical holiday since 2018 in Hamburg (Germany). [#108](https://github.com/azuyalabs/yasumi/pull/108) ([HenningCash](https://github.com/HenningCash))
- Added Reformation Day as offical holiday since 2018 in Bremen (Germany). [#116](https://github.com/azuyalabs/yasumi/issues/116) ([TalonTR](https://github.com/TalonTR))
- Added International Women's Day as official holidy since 2019 in Berlin (Germany). [#133](https://github.com/azuyalabs/yasumi/pull/133) ([huehnerhose](https://github.com/huehnerhose))
- Added Reformation Day as official holiday since 2018 in Lower Saxony (Germany). [#115](https://github.com/azuyalabs/yasumi/issues/115) ([Taxcamp](https://github.com/Taxcamp))
- Added Reformation Day as official holiday since 2018 in Schleswig-Holstein (Germany). [#106](https://github.com/azuyalabs/yasumi/pull/106) ([HenningCash](https://github.com/HenningCash))
- Added Reformation Day as official holiday since 2018 in Hamburg (Germany). [#108](https://github.com/azuyalabs/yasumi/pull/108) ([HenningCash](https://github.com/HenningCash))
- Added Reformation Day as official holiday since 2018 in Bremen (Germany). [#116](https://github.com/azuyalabs/yasumi/issues/116) ([TalonTR](https://github.com/TalonTR))
- The (observed) holidays Lukkeloven, Constitution Day, New Year's Eve and Labour Day, as well as summertime and wintertime are included for Denmark [\#104](https://github.com/azuyalabs/yasumi/pull/104) ([c960657](https://github.com/c960657))

### Changed
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Blog
----
Checkout the [blog](https://azuyalabs.github.io/yasumi/blog/) section on documentation site regularly for latest updates. Keeping you informed about any news, releases, etc. in a handy blog post format!

## Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on Github :) Create [Github Issues](https://github.com/azuyalabs/yasumi/issues) for bugs and new features and comment on the ones you are interested in.

If you enjoy what I am making, an extra cup of coffee is very much appreciated :). Your support helps me to put more time into Open-Source Software projects like this.

<a href="https://www.buymeacoffee.com/sachatelgenhof" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

License
-------

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.14",
"fzaninotto/faker": "~1.8",
"mikey179/vfsStream": "~1.6",
"mikey179/vfsstream": "~1.6",
"phpunit/phpunit": "~7.5"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class AbstractProvider implements ProviderInterface, Countable, Iterato
// Friday
'IR' => [5], // Iran, Islamic Republic of

// Friday
// Sunday
'IN' => [0], // India
];

Expand Down
8 changes: 4 additions & 4 deletions src/Yasumi/Provider/Australia.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function initialize(): void
* @throws \Yasumi\Exception\UnknownLocaleException
* @throws \Exception
*/
public function calculateAustraliaDay(): void
private function calculateAustraliaDay(): void
{
$date = new DateTime("$this->year-01-26", new DateTimeZone($this->timezone));

Expand Down Expand Up @@ -122,7 +122,7 @@ public function calculateHoliday(
* @throws \Yasumi\Exception\UnknownLocaleException
* @throws \Exception
*/
public function calculateNewYearHolidays(): void
private function calculateNewYearHolidays(): void
{
$newyearsday = new DateTime("$this->year-01-01", new DateTimeZone($this->timezone));
$this->calculateHoliday('newYearsDay', ['en_AU' => 'New Year\'s Day'], $newyearsday, false, false);
Expand Down Expand Up @@ -154,7 +154,7 @@ public function calculateNewYearHolidays(): void
* @throws \Yasumi\Exception\UnknownLocaleException
* @throws \Exception
*/
public function calculateAnzacDay(): void
private function calculateAnzacDay(): void
{
if ($this->year < 1921) {
return;
Expand Down Expand Up @@ -187,7 +187,7 @@ public function calculateAnzacDay(): void
* @throws \Yasumi\Exception\UnknownLocaleException
* @throws \Exception
*/
public function calculateChristmasDay(): void
private function calculateChristmasDay(): void
{
$christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone));
$boxingDay = new DateTime("$this->year-12-26", new DateTimeZone($this->timezone));
Expand Down
12 changes: 6 additions & 6 deletions src/Yasumi/Provider/Australia/ACT.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateCanberraDay(): void
private function calculateCanberraDay(): void
{
if ($this->year < 2007) {
$date = new DateTime("third monday of march $this->year", new DateTimeZone($this->timezone));
Expand All @@ -71,7 +71,7 @@ public function calculateCanberraDay(): void
*
* @throws \Exception
*/
public function calculateReconciliationDay(): void
private function calculateReconciliationDay(): void
{
if ($this->year < 2018) {
return;
Expand All @@ -90,7 +90,7 @@ public function calculateReconciliationDay(): void
*
* @throws \Exception
*/
public function calculateLabourDay(): void
private function calculateLabourDay(): void
{
$date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone));

Expand Down Expand Up @@ -118,7 +118,7 @@ public function calculateLabourDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
private function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
{
return new Holiday(
'easterSaturday',
Expand Down Expand Up @@ -150,7 +150,7 @@ public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function easterSunday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
private function easterSunday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
{
return new Holiday(
'easter',
Expand All @@ -176,7 +176,7 @@ public function easterSunday($year, $timezone, $locale, $type = Holiday::TYPE_OF
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
$this->calculateHoliday(
'queensBirthday',
Expand Down
8 changes: 4 additions & 4 deletions src/Yasumi/Provider/Australia/NSW.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateLabourDay(): void
private function calculateLabourDay(): void
{
$date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone));

Expand Down Expand Up @@ -83,7 +83,7 @@ public function calculateLabourDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
private function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
{
return new Holiday(
'easterSaturday',
Expand All @@ -109,7 +109,7 @@ public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
$this->calculateHoliday(
'queensBirthday',
Expand All @@ -126,7 +126,7 @@ public function calculateQueensBirthday(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateBankHoliday(): void
private function calculateBankHoliday(): void
{
$this->calculateHoliday(
'bankHoliday',
Expand Down
8 changes: 4 additions & 4 deletions src/Yasumi/Provider/Australia/NT.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateMayDay(): void
private function calculateMayDay(): void
{
$date = new DateTime("first monday of may $this->year", new DateTimeZone($this->timezone));

Expand All @@ -69,7 +69,7 @@ public function calculateMayDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculatePicnicDay(): void
private function calculatePicnicDay(): void
{
$this->calculateHoliday(
'picnicDay',
Expand Down Expand Up @@ -101,7 +101,7 @@ public function calculatePicnicDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
private function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
{
return new Holiday(
'easterSaturday',
Expand All @@ -127,7 +127,7 @@ public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
$this->calculateHoliday(
'queensBirthday',
Expand Down
4 changes: 2 additions & 2 deletions src/Yasumi/Provider/Australia/Queensland.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateLabourDay(): void
private function calculateLabourDay(): void
{
if ($this->year === 2013 || $this->year === 2014 || $this->year === 2015) {
$date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone));
Expand All @@ -77,7 +77,7 @@ public function calculateLabourDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
if ($this->year < 2012 || $this->year === 2013 || $this->year === 2014 || $this->year === 2015) {
$this->calculateHoliday(
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Queensland/Brisbane.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function initialize(): void
* @throws \Yasumi\Exception\UnknownLocaleException
* @throws \Exception
*/
public function calculatePeoplesDay(): void
private function calculatePeoplesDay(): void
{
$date = new DateTime('first friday of august ' . $this->year, new DateTimeZone($this->timezone));
if ($date->format('d') < 5) {
Expand Down
10 changes: 5 additions & 5 deletions src/Yasumi/Provider/Australia/SA.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateProclamationDay(): void
private function calculateProclamationDay(): void
{
$christmasDay = new DateTime("$this->year-12-25", new DateTimeZone($this->timezone));
$this->calculateHoliday('christmasDay', ['en_AU' => 'Christmas Day'], $christmasDay, false, false);
Expand Down Expand Up @@ -95,7 +95,7 @@ public function calculateProclamationDay(): void
*
* @throws \Exception
*/
public function calculateLabourDay(): void
private function calculateLabourDay(): void
{
$date = new DateTime("first monday of october $this->year", new DateTimeZone($this->timezone));

Expand All @@ -110,7 +110,7 @@ public function calculateLabourDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateAdelaideCupDay(): void
private function calculateAdelaideCupDay(): void
{
if ($this->year >= 1973) {
if ($this->year < 2006) {
Expand Down Expand Up @@ -154,7 +154,7 @@ public function calculateAdelaideCupDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
private function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_OFFICIAL): Holiday
{
return new Holiday(
'easterSaturday',
Expand All @@ -180,7 +180,7 @@ public function easterSaturday($year, $timezone, $locale, $type = Holiday::TYPE_
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
$this->calculateHoliday(
'queensBirthday',
Expand Down
6 changes: 3 additions & 3 deletions src/Yasumi/Provider/Australia/Tasmania.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateEightHoursDay(): void
private function calculateEightHoursDay(): void
{
$date = new DateTime("second monday of march $this->year", new DateTimeZone($this->timezone));

Expand All @@ -74,7 +74,7 @@ public function calculateEightHoursDay(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateQueensBirthday(): void
private function calculateQueensBirthday(): void
{
$this->calculateHoliday(
'queensBirthday',
Expand All @@ -93,7 +93,7 @@ public function calculateQueensBirthday(): void
* @throws \InvalidArgumentException
* @throws \Exception
*/
public function calculateRecreationDay(): void
private function calculateRecreationDay(): void
{
$this->calculateHoliday(
'recreationDay',
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Tasmania/CentralNorth.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateDevonportShow(): void
private function calculateDevonportShow(): void
{
$date = new DateTime($this->year . '-12-02', new DateTimeZone($this->timezone));
$date = $date->modify('previous friday');
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Tasmania/FlindersIsland.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateFlindersIslandShow(): void
private function calculateFlindersIslandShow(): void
{
$date = new DateTime('third saturday of october ' . $this->year, new DateTimeZone($this->timezone));
$date = $date->sub(new DateInterval('P1D'));
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Tasmania/KingIsland.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateKingIslandShow(): void
private function calculateKingIslandShow(): void
{
$this->calculateHoliday(
'kingIslandShow',
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Tasmania/Northeast.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateLauncestonShow(): void
private function calculateLauncestonShow(): void
{
$date = new DateTime('second saturday of october ' . $this->year, new DateTimeZone($this->timezone));
$date = $date->sub(new DateInterval('P2D'));
Expand Down
2 changes: 1 addition & 1 deletion src/Yasumi/Provider/Australia/Tasmania/Northwest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateBurnieShow(): void
private function calculateBurnieShow(): void
{
$date = new DateTime('first saturday of october ' . $this->year, new DateTimeZone($this->timezone));
$date = $date->sub(new DateInterval('P1D'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function initialize(): void
*
* @throws \Exception
*/
public function calculateAGFEST(): void
private function calculateAGFEST(): void
{
$date = new DateTime('first thursday of may ' . $this->year, new DateTimeZone($this->timezone));
$date = $date->add(new DateInterval('P1D'));
Expand Down
Loading

0 comments on commit 5a086db

Please sign in to comment.