Skip to content

Commit caf8ea1

Browse files
authored
[BUGFIX] abs() in timezone method fails if arg is simplexmlelement (#154)
1 parent 7ba829d commit caf8ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Cmfcmf/OpenWeatherMap/Util/City.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct($id, $name = null, $lat = null, $lon = null, $countr
6767
$this->name = isset($name) ? (string)$name : null;
6868
$this->country = isset($country) ? (string)$country : null;
6969
$this->population = isset($population) ? (int)$population : null;
70-
$this->timezone = isset($timezoneOffset) ? new \DateTimeZone(self::timezoneOffsetInSecondsToHours($timezoneOffset)) : null;
70+
$this->timezone = isset($timezoneOffset) ? new \DateTimeZone(self::timezoneOffsetInSecondsToHours((int)$timezoneOffset)) : null;
7171

7272
parent::__construct($lat, $lon);
7373
}

0 commit comments

Comments
 (0)