Hesse::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 6
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\Provider\Germany;
18
19
/**
20
 * Provider for all holidays in Hesse (Germany).
21
 *
22
 * Hesse is a federal state (Land) of the Federal Republic of Germany, with just over six million inhabitants. The state
23
 * capital is Wiesbaden; the largest city is Frankfurt am Main. Until the formation of the German Reich in 1871, Hesse
24
 * was an independent country ruled by a Grand Duke (Grand Duchy of Hesse). Due to divisions after World War II, the
25
 * modern federal state does not cover the entire cultural region of Hesse which includes both the State of Hesse and
26
 * the area known as Rhenish Hesse (Rheinhessen) in the neighbouring state of Rhineland-Palatinate.
27
 *
28
 * @link https://en.wikipedia.org/wiki/Hesse
29
 */
30
class Hesse 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-HE';
37
38
    /**
39
     * Initialize holidays for Hesse (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->corpusChristi($this->year, $this->timezone, $this->locale));
52
    }
53
}
54