Melilla   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 Melilla (Spain).
23
 *
24
 * Melilla is a Spanish city located on the north coast of Africa, sharing a border with Morocco with an area of 12.3
25
 * square kilometres (4.7 sq mi). Melilla, along with Ceuta, is one of two permanently inhabited Spanish cities in
26
 * mainland Africa. It was part of Málaga province until 14 March 1995, when the city's Statute of Autonomy was passed.
27
 *
28
 * @link https://en.wikipedia.org/wiki/Melilla
29
 */
30
class Melilla extends Spain
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 = 'ES-ML';
39
40
    /**
41
     * Initialize holidays for Melilla (Spain).
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->stJosephsDay($this->year, $this->timezone, $this->locale, Holiday::TYPE_OBSERVANCE));
54
        $this->addHoliday($this->maundyThursday($this->year, $this->timezone, $this->locale, Holiday::TYPE_OBSERVANCE));
55
    }
56
}
57