BadenWurttemberg::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the Yasumi package.
4
 *
5
 * Copyright (c) 2015 - 2020 AzuyaLabs
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Sacha Telgenhof <[email protected]>
11
 */
12
13
namespace Yasumi\Provider\Germany;
14
15
use Yasumi\Exception\InvalidDateException;
16
use Yasumi\Exception\UnknownLocaleException;
17
use Yasumi\Holiday;
18
use Yasumi\Provider\Germany;
19
20
/**
21
 * Provider for all holidays in Baden-Württemberg (Germany).
22
 *
23
 * Baden-Württemberg is a state in Germany located in the southwest, east of the Upper Rhine. It is Germany’s third
24
 * largest state in terms of size and population, with an area of 36,410 square kilometres (14,060 sq mi) and 10.7
25
 * million inhabitants. The state capital and largest city is Stuttgart.
26
 *
27
 * @link https://en.wikipedia.org/wiki/Baden-W%C3%BCrttemberg
28
 */
29
class BadenWurttemberg extends Germany
30
{
31
    /**
32
     * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective
33
     * country or sub-region.
34
     */
35
    public const ID = 'DE-BW';
36
37
    /**
38
     * Initialize holidays for Baden-Württemberg (Germany).
39
     *
40
     * @throws InvalidDateException
41
     * @throws \InvalidArgumentException
42
     * @throws UnknownLocaleException
43
     * @throws \Exception
44
     */
45
    public function initialize(): void
46
    {
47
        parent::initialize();
48
49
        // Add custom Christian holidays
50
        $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
51
        $this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale));
52
        $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
53
    }
54
}
55