Skip to content

Commit 2c051b5

Browse files
emimarzcmfcmf
authored andcommitted
Update CurrentWeather.php (#88)
* Update CurrentWeather.php [] is PHP 5.4.0 changing to array() to keep retro compatibility * Update CurrentWeather.php
1 parent 31465dc commit 2c051b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Cmfcmf/OpenWeatherMap/CurrentWeather.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function __construct($data, $units)
124124

125125
// the rain field is not always present in the JSON response
126126
// and sometimes it contains the field '1h', sometimes the field '3h'
127-
$rain = isset($data->rain) ? (array) $data->rain : [];
127+
$rain = isset($data->rain) ? (array) $data->rain : array();
128128
$rainUnit = !empty($rain) ? key($rain) : '';
129129
$rainValue = !empty($rain) ? current($rain) : 0.0;
130130
$this->precipitation = new Unit($rainValue, $rainUnit);

0 commit comments

Comments
 (0)