1 | <?php |
||
23 | class Temperature |
||
24 | { |
||
25 | /** |
||
26 | * @var Unit The current temperature. |
||
27 | */ |
||
28 | public $now; |
||
29 | |||
30 | /** |
||
31 | * @var Unit The minimal temperature. |
||
32 | */ |
||
33 | public $min; |
||
34 | |||
35 | /** |
||
36 | * @var Unit The maximal temperature. |
||
37 | */ |
||
38 | public $max; |
||
39 | |||
40 | /** |
||
41 | * @var Unit The day temperature. Might not be null. |
||
42 | */ |
||
43 | public $day; |
||
44 | |||
45 | /** |
||
46 | * @var Unit The morning temperature. Might not be null. |
||
47 | */ |
||
48 | public $morning; |
||
49 | |||
50 | /** |
||
51 | * @var Unit The evening temperature. Might not be null. |
||
52 | */ |
||
53 | public $evening; |
||
54 | |||
55 | /** |
||
56 | * @var Unit The night temperature. Might not be null. |
||
57 | */ |
||
58 | public $night; |
||
59 | |||
60 | /** |
||
61 | * Returns the current temperature as formatted string. |
||
62 | * |
||
63 | * @return string The current temperature as a formatted string. |
||
64 | */ |
||
65 | 2 | public function __toString() |
|
69 | |||
70 | /** |
||
71 | * Returns the current temperature's unit. |
||
72 | * |
||
73 | * @return string The current temperature's unit. |
||
74 | */ |
||
75 | 2 | public function getUnit() |
|
79 | |||
80 | /** |
||
81 | * Returns the current temperature. |
||
82 | * |
||
83 | * @return string The current temperature. |
||
84 | */ |
||
85 | 2 | public function getValue() |
|
89 | |||
90 | /** |
||
91 | * Returns the current temperature's description. |
||
92 | * |
||
93 | * @return string The current temperature's description. |
||
94 | */ |
||
95 | 1 | public function getDescription() |
|
96 | { |
||
97 | 1 | return $this->now->getDescription(); |
|
98 | } |
||
99 | |||
100 | /** |
||
101 | * Returns the current temperature as formatted string. |
||
102 | * |
||
103 | * @return string The current temperature as formatted string. |
||
104 | */ |
||
105 | 2 | public function getFormatted() |
|
109 | |||
110 | /** |
||
111 | * Create a new temperature object. |
||
112 | * |
||
113 | * @param Unit $now The current temperature. |
||
114 | * @param Unit $min The minimal temperature. |
||
115 | * @param Unit $max The maximal temperature. |
||
116 | * @param Unit $day The day temperature. Might not be null. |
||
117 | * @param Unit $morning The morning temperature. Might not be null. |
||
118 | * @param Unit $evening The evening temperature. Might not be null. |
||
119 | * @param Unit $night The night temperature. Might not be null. |
||
120 | * |
||
121 | * @internal |
||
122 | */ |
||
123 | 5 | public function __construct(Unit $now, Unit $min, Unit $max, Unit $day = null, Unit $morning = null, Unit $evening = null, Unit $night = null) |
|
133 | } |
||
134 |