Aragon   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 7 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\Spain;
14
15
use Yasumi\Exception\InvalidDateException;
16
use Yasumi\Exception\UnknownLocaleException;
17
use Yasumi\Holiday;
18
use Yasumi\Provider\ChristianHolidays;
19
use Yasumi\Provider\Spain;
20
21
/**
22
 * Provider for all holidays in Aragon (Spain).
23
 *
24
 * Aragon is an autonomous community in Spain, coextensive with the medieval Kingdom of Aragon. Located in northeastern
25
 * Spain, the Aragonese autonomous community comprises three provinces (from north to south): Huesca, Zaragoza, and
26
 * Teruel. Its capital is Zaragoza (also called Saragossa in English). The current Statute of Autonomy declares Aragon a
27
 * nationality of Spain.
28
 *
29
 * @link https://en.wikipedia.org/wiki/Aragon
30
 */
31
class Aragon extends Spain
32
{
33
    use ChristianHolidays;
34
35
    /**
36
     * Code to identify this Holiday Provider. Typically this is the ISO3166 code corresponding to the respective
37
     * country or sub-region.
38
     */
39
    public const ID = 'ES-AR';
40
41
    /**
42
     * Initialize holidays for Aragon (Spain).
43
     *
44
     * @throws InvalidDateException
45
     * @throws \InvalidArgumentException
46
     * @throws UnknownLocaleException
47
     * @throws \Exception
48
     */
49
    public function initialize(): void
50
    {
51
        parent::initialize();
52
53
        // Add custom Christian holidays
54
        $this->addHoliday($this->maundyThursday($this->year, $this->timezone, $this->locale, Holiday::TYPE_OBSERVANCE));
55
        $this->addHoliday($this->stGeorgesDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OBSERVANCE));
56
    }
57
}
58