Moselle::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
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\France;
14
15
use Yasumi\Exception\InvalidDateException;
16
use Yasumi\Exception\UnknownLocaleException;
17
use Yasumi\Provider\ChristianHolidays;
18
use Yasumi\Provider\France;
19
20
/**
21
 * Provider for all holidays in Moselle (France).
22
 *
23
 * Moselle is one of the original 83 departments created during the French Revolution on March 4, 1790. It was created
24
 * from the former province of Lorraine. In 1793 France annexed the German enclaves of Manderen, Lixing-lès-Rouhling,
25
 * Momerstroff, and Créhange (Kriechingen) - all possessions of princes of the German Holy Roman Empire - and
26
 * incorporated them into the Moselle département.
27
 *
28
 * @link https://en.wikipedia.org/wiki/Moselle_(department)
29
 */
30
class Moselle extends France
31
{
32
    use ChristianHolidays;
33
34
    /**
35
     * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective
36
     * country or sub-region.
37
     */
38
    public const ID = 'FR-57';
39
40
    /**
41
     * Initialize holidays for Moselle (France).
42
     *
43
     * @throws InvalidDateException
44
     * @throws \InvalidArgumentException
45
     * @throws UnknownLocaleException
46
     * @throws \Exception
47
     */
48
    public function initialize(): void
49
    {
50
        parent::initialize();
51
52
        // Add custom Christian holidays
53
        $this->addHoliday($this->goodFriday($this->year, $this->timezone, $this->locale));
54
        $this->addHoliday($this->stStephensDay($this->year, $this->timezone, $this->locale));
55
    }
56
}
57