-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Holiday providers for states of Austria (#182)
* Added holiday providers for states of Austria. * Implemented tests for holiday providers that belong to states of Austria. * Added translations for holidays that belong to states of Austria.
- Loading branch information
1 parent
9044e9f
commit 05b1688
Showing
35 changed files
with
1,763 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Burgenland (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Burgenland | ||
*/ | ||
class Burgenland extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-1'; | ||
|
||
/** | ||
* Initialize holidays for Burgenland (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom Common holidays. | ||
$this->addHoliday($this->stMartinsDay($this->year, $this->timezone, $this->locale)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use DateTime; | ||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Holiday; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Carinthia (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Carinthia | ||
*/ | ||
class Carinthia extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-2'; | ||
|
||
/** | ||
* Initialize holidays for Carinthia (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom Common holidays. | ||
$this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); | ||
$this->calculatePlebisciteDay(); | ||
} | ||
|
||
/** | ||
* Plebiscite Day. | ||
* | ||
* The Carinthian plebiscite was held on 10 October 1920 in the area | ||
* predominantly settled by Carinthian Slovenes. It determined the final | ||
* southern border between the Republic of Austria and the newly formed | ||
* Kingdom of Serbs, Croats and Slovenes (Yugoslavia) after World War I. | ||
* | ||
* @link https://en.wikipedia.org/wiki/1920_Carinthian_plebiscite | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
private function calculatePlebisciteDay(): void | ||
{ | ||
if ($this->year < 1920) { | ||
return; | ||
} | ||
|
||
$this->addHoliday(new Holiday( | ||
'plebisciteDay', | ||
[], | ||
new DateTime($this->year . '-10-10', new \DateTimeZone($this->timezone)), | ||
$this->locale | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Lower Austria (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Lower_Austria | ||
*/ | ||
class LowerAustria extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-3'; | ||
|
||
/** | ||
* Initialize holidays for Lower Austria (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom holidays. | ||
$this->calculateStLeopoldsDay(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use DateTime; | ||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Holiday; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Salzburg (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Salzburg_(state) | ||
*/ | ||
class Salzburg extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-5'; | ||
|
||
/** | ||
* Initialize holidays for Salzburg (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom holidays. | ||
$this->calculateStRupertsDay(); | ||
} | ||
|
||
/** | ||
* Saint Rupert's Day. | ||
* | ||
* Rupert of Salzburg was Bishop of Worms as well as the first Bishop of | ||
* Salzburg and abbot of St. Peter's in Salzburg. He was a contemporary of | ||
* the Frankish king Childebert III and is venerated as a saint in the | ||
* Roman Catholic and Eastern Orthodox Churches. Rupert is also patron | ||
* saint of the Austrian state of Salzburg. His feast day in Austria is | ||
* September 24 (since 710). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Rupert_of_Salzburg | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
private function calculateStRupertsDay(): void | ||
{ | ||
if ($this->year < 710) { | ||
return; | ||
} | ||
|
||
$this->addHoliday(new Holiday( | ||
'stRupertsDay', | ||
[], | ||
new DateTime($this->year . '-9-24', new \DateTimeZone($this->timezone)), | ||
$this->locale | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Styria (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Styria | ||
*/ | ||
class Styria extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-6'; | ||
|
||
/** | ||
* Initialize holidays for Styria (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom Common holidays. | ||
$this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me@sachatelgenhof.com> | ||
*/ | ||
|
||
namespace Yasumi\Provider\Austria; | ||
|
||
use Yasumi\Exception\InvalidDateException; | ||
use Yasumi\Exception\UnknownLocaleException; | ||
use Yasumi\Provider\Austria; | ||
|
||
/** | ||
* Provider for all holidays in Tyrol (Austria). | ||
* | ||
* @link https://en.wikipedia.org/wiki/Tyrol_(state) | ||
*/ | ||
class Tyrol extends Austria | ||
{ | ||
/** | ||
* Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective | ||
* country or sub-region. | ||
*/ | ||
public const ID = 'AT-7'; | ||
|
||
/** | ||
* Initialize holidays for Tyrol (Austria). | ||
* | ||
* @throws InvalidDateException | ||
* @throws \InvalidArgumentException | ||
* @throws UnknownLocaleException | ||
* @throws \Exception | ||
*/ | ||
public function initialize(): void | ||
{ | ||
parent::initialize(); | ||
|
||
// Add custom Common holidays. | ||
$this->addHoliday($this->stJosephsDay($this->year, $this->timezone, $this->locale)); | ||
} | ||
} |
Oops, something went wrong.