Zug   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 20
c 1
b 0
f 0
dl 0
loc 40
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 22 1
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\Switzerland;
14
15
use Yasumi\Exception\InvalidDateException;
16
use Yasumi\Exception\UnknownLocaleException;
17
use Yasumi\Holiday;
18
use Yasumi\Provider\ChristianHolidays;
19
use Yasumi\Provider\Switzerland;
20
21
/**
22
 * Provider for all holidays in Zug (Switzerland).
23
 *
24
 * @link https://en.wikipedia.org/wiki/Canton_of_Zug
25
 */
26
class Zug extends Switzerland
27
{
28
    use ChristianHolidays;
29
30
    /**
31
     * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective
32
     * country or sub-region.
33
     */
34
    public const ID = 'CH-ZG';
35
36
    /**
37
     * Initialize holidays for Zug (Switzerland).
38
     *
39
     * @throws InvalidDateException
40
     * @throws \InvalidArgumentException
41
     * @throws UnknownLocaleException
42
     * @throws \Exception
43
     */
44
    public function initialize(): void
45
    {
46
        parent::initialize();
47
48
        $this->addHoliday($this->goodFriday($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
49
        $this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale));
50
        $this->addHoliday($this->assumptionOfMary($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
51
        $this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
52
        $this->addHoliday($this->immaculateConception(
53
            $this->year,
54
            $this->timezone,
55
            $this->locale,
56
            Holiday::TYPE_OTHER
57
        ));
58
        $this->addHoliday($this->stStephensDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
59
        $this->addHoliday($this->newYearsDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
60
        $this->addHoliday($this->christmasDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
61
        $this->addHoliday($this->ascensionDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
62
        $this->addHoliday($this->easterMonday($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
63
        $this->addHoliday($this->pentecostMonday($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
64
65
        $this->calculateBerchtoldsTag();
66
    }
67
}
68