Bavaria::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 Bavaria (Germany).
22
 *
23
 * Bavaria is a federal state of Germany. In the southeast of the country with an area of 70,548 square kilometres
24
 * (27,200 sq mi), it is the largest state, making up almost a fifth of the total land area of Germany, and, with 12.6
25
 * million inhabitants, Germany's second most populous state. Munich, Bavaria's capital and largest city, is the third
26
 * largest city in Germany.
27
 *
28
 * @link https://en.wikipedia.org/wiki/Bavaria
29
 */
30
class Bavaria extends Germany
31
{
32
    /**
33
     * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective
34
     * country or sub-region.
35
     */
36
    public const ID = 'DE-BY';
37
38
    /**
39
     * Initialize holidays for Bavaria (Germany).
40
     *
41
     * @throws InvalidDateException
42
     * @throws \InvalidArgumentException
43
     * @throws UnknownLocaleException
44
     * @throws \Exception
45
     */
46
    public function initialize(): void
47
    {
48
        parent::initialize();
49
50
        // Add custom Christian holidays
51
        $this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
52
        $this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale));
53
        $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
54
    }
55
}
56