public function getWeatherForecast($query, $units = 'imperial', $lang = 'en', $appid = '', $days = 1)
{
if ($days <= 5) {
$answer = $this->getRawHourlyForecastData($query, $units, $lang, $appid, 'xml');
} elseif ($days <= 16) {
$answer = $this->getRawDailyForecastData($query, $units, $lang, $appid, 'xml', $days);
} else {
throw new \InvalidArgumentException('Error: forecasts are only available for the next 16 days. $days must be 16 or lower.');
}
$xml = $this->parseXML($answer);
return new WeatherForecast($xml, $units, $days);
}