@@ 299-301 (lines=3) @@ | ||
296 | */ |
|
297 | public function getWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
|
298 | { |
|
299 | if (!in_array($type, array('tick', 'hour', 'day'))) { |
|
300 | throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
|
301 | } |
|
302 | ||
303 | $xml = json_decode($this->getRawWeatherHistory($query, $start, $endOrCount, $type, $units, $lang, $appid), true); |
|
304 | ||
@@ 456-458 (lines=3) @@ | ||
453 | */ |
|
454 | public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
|
455 | { |
|
456 | if (!in_array($type, array('tick', 'hour', 'day'))) { |
|
457 | throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
|
458 | } |
|
459 | ||
460 | $url = $this->buildUrl($query, $units, $lang, $appid, 'json', $this->weatherHistoryUrl); |
|
461 | $url .= "&type=$type&start={$start->format('U')}"; |