1 | <?php |
||
27 | class Storm implements StormInterface |
||
28 | { |
||
29 | /** |
||
30 | * The number of cloud-end-ground lightning in specified radius for a specified location |
||
31 | * |
||
32 | * @var int the number of cloud-end-ground lightning in specified radius for a specified location |
||
33 | */ |
||
34 | private $lightnings = 0; |
||
35 | |||
36 | /** |
||
37 | * The distance (km) to the nearest registered lightning. |
||
38 | * |
||
39 | * @var float distance to the nearest registered lightning |
||
40 | */ |
||
41 | private $distance; |
||
42 | |||
43 | /** |
||
44 | * The direction to the nearest lightning (E, E, N, NW, W, SW, S, SE). |
||
45 | * |
||
46 | * @var string direction to the nearest lightning |
||
47 | */ |
||
48 | private $direction; |
||
49 | |||
50 | /** |
||
51 | * The number of minutes of time containing the data (10, 15, 20 minutes). |
||
52 | * |
||
53 | * @var int number of minutes of time containing the data |
||
54 | */ |
||
55 | private $period; |
||
56 | |||
57 | /** |
||
58 | * The radius covered by specified location. |
||
59 | * |
||
60 | * @var int radius covered by specified location |
||
61 | */ |
||
62 | private $radius; |
||
63 | |||
64 | /** |
||
65 | * New Storm. |
||
66 | * |
||
67 | * @param int $lightnings number of cloud-end-ground lightning in specified radius for a selected location |
||
68 | * @param float $distance distance (km) to the nearest registered lightning |
||
69 | * @param string $direction direction to the nearest lightning (E, E, N, NW, W, SW, S, SE) |
||
70 | * @param int $period number of minutes of time containing the data (10, 15, 20 minutes) |
||
71 | * @param int $radius radius covered by the location |
||
72 | */ |
||
73 | public function __construct(int $lightnings, float $distance, string $direction, int $period, int $radius) |
||
81 | |||
82 | /** |
||
83 | * Get the number of cloud-end-ground lightning in specified radius for a selected location |
||
84 | * |
||
85 | * @return int number of cloud-end-ground lightning in specified radius for a selected location |
||
86 | */ |
||
87 | public function lightnings(): int |
||
91 | |||
92 | /** |
||
93 | * Get the distance to the nearest registered lightning |
||
94 | * |
||
95 | * @return float distance to the nearest registered lightning |
||
96 | */ |
||
97 | public function distance(): float |
||
101 | |||
102 | /** |
||
103 | * Get direction to the nearest lightning (E, E, N, NW, W, SW, S, SE) |
||
104 | * |
||
105 | * @return string direction to the nearest lightning |
||
106 | */ |
||
107 | public function direction(): string |
||
111 | |||
112 | /** |
||
113 | * Get the number of minutes of time containing the data (10, 15, 20 minutes) |
||
114 | * |
||
115 | * @return int number of minutes of time containing the data |
||
116 | */ |
||
117 | public function period(): int |
||
121 | |||
122 | /** |
||
123 | * Get radius covered by specified location |
||
124 | * |
||
125 | * @return int radius covered by location |
||
126 | */ |
||
127 | public function radius(): int |
||
131 | } |
||
132 |