Alert::level()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * For the full copyright and license information, please view the LICENSE file
5
 * that was distributed with this source code.
6
 */
7
8
declare (
9
    strict_types = 1
10
);
11
12
namespace Component\Remote\BurzeDzisNet;
13
14
/**
15
 * Weather alert
16
 *
17
 * <strong>Only the Polish area</strong>
18
 * @see https://burze.dzis.net/?page=severe_weather_alert_map_poland Alert scale
19
 * @author Krzysztof Piasecki <[email protected]>
20
 */
21
class Alert implements AlertInterface
22
{
23
    /**
24
     * Alert level
25
     *
26
     * @var int alert level
27
     */
28
    private $level = 0;
29
30
    /**
31
     * Start day
32
     *
33
     * @var string start day
34
     */
35
    private $start = '';
36
37
    /**
38
     * End day
39
     *
40
     * @var string end day
41
     */
42
    private $end = '';
43
44
    /**
45
     * Weather alert
46
     *
47
     * @param int    $level alert level
48
     * @param string $start start day
49
     * @param string $end   end day
50
     */
51
    public function __construct(int $level, string $start, string $end)
52
    {
53
        $this->level = $level;
54
        $this->start = $start;
55
        $this->end = $end;
56
    }
57
58
    /**
59
     * Get alert level
60
     *
61
     * @see https://burze.dzis.net/?page=mapa_ostrzezen Alert scale
62
     * @return int alert level
63
     */
64
    public function level(): int
65
    {
66
        return $this->level;
67
    }
68
69
    /**
70
     * Get start day
71
     *
72
     * @return string start day
73
     */
74
    public function startDate(): string
75
    {
76
        return $this->start;
77
    }
78
79
    /**
80
     * Get end day
81
     *
82
     * @return string end day
83
     */
84
    public function endDate(): string
85
    {
86
        return $this->end;
87
    }
88
}
89