3 * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
7 * Please see the LICENSE file distributed with this source code for further
8 * information regarding copyright and licensing.
10 * Please visit the following links to read about the usage policies and the license of
11 * OpenWeatherMap before using this class:
13 * @see http://www.OpenWeatherMap.org
14 * @see http://www.OpenWeatherMap.org/terms
15 * @see http://openweathermap.org/appid
18 namespace Cmfcmf\OpenWeatherMap;
20 use Cmfcmf\OpenWeatherMap\Util\Temperature;
21 use Cmfcmf\OpenWeatherMap\Util\Unit;
22 use Cmfcmf\OpenWeatherMap\Util\Weather;
23 use Cmfcmf\OpenWeatherMap\Util\Wind;
26 * Class WeatherHistory.
38 * The temperature object.
40 * @var Util\Temperature
67 public $precipitation;
75 * @var \DateTime The time of the history.
92 public function __construct($city, $weather, $temperature, $pressure, $humidity, $clouds, $rain, $wind, $time)
95 $this->weather = new Weather($weather['id'], $weather['description'], $weather['icon']);
96 $this->temperature = new Temperature(new Unit($temperature['now'] - 273.15, "\xB0C"), new Unit($temperature['min'] - 273.15, "\xB0C"), new Unit($temperature['max'] - 273.15, "\xB0C"));
97 $this->pressure = new Unit($pressure, 'kPa');
98 $this->humidity = new Unit($humidity, '%');
99 $this->clouds = new Unit($clouds, '%');
100 $this->precipitation = new Unit($rain['val'], $rain['unit']);
101 $this->wind = new Wind(new Unit($wind['speed']), new Unit($wind['deg']));