1 | <?php |
||
12 | class Detail { |
||
13 | |||
14 | public $temperature_from; |
||
15 | public $temperature_to; |
||
16 | public $temperature_avg; |
||
17 | |||
18 | public $station; |
||
19 | public $observation_time; |
||
20 | public $uptime; |
||
21 | public $temperature; |
||
22 | public $weather_condition; |
||
23 | public $image; |
||
24 | public $image_v2; |
||
25 | public $image_v3; |
||
26 | public $weather_type; |
||
27 | public $wind_direction; |
||
28 | public $wind_speed; |
||
29 | public $humidity; |
||
30 | public $pressure; |
||
31 | public $mslp_pressure; |
||
32 | public $daytime; |
||
33 | public $season; |
||
34 | public $ipad_image; |
||
35 | |||
36 | |||
37 | |||
38 | public function getTemperatureStr() { |
||
41 | |||
42 | public function getTemperatureAvgStr() { |
||
45 | |||
46 | public function getTemperatureFromStr() { |
||
49 | |||
50 | public function getTemperatureToStr() { |
||
53 | |||
54 | public function getTemperatureFromTo() { |
||
55 | if($this->temperature_from && $this->temperature_to) |
||
56 | return $this->getTemperatureFromStr().'...'.$this->getTemperatureToStr(); |
||
57 | else |
||
58 | return $this->getTemperatureAvgStr(); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * Get current time |
||
63 | * @return bool|string |
||
64 | */ |
||
65 | public function getObservationTime() { |
||
68 | |||
69 | /** |
||
70 | * Get icon for weather |
||
71 | * @return mixed |
||
72 | */ |
||
73 | public function getIcon() { |
||
80 | |||
81 | /** |
||
82 | * Get wind direction |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function getWindDirection() { |
||
102 | |||
103 | |||
104 | |||
105 | } |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.