@@ 506-508 (lines=3) @@ | ||
503 | */ |
|
504 | public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
|
505 | { |
|
506 | if (!in_array($type, array('tick', 'hour', 'day'))) { |
|
507 | throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
|
508 | } |
|
509 | ||
510 | $url = $this->buildUrl($query, $units, $lang, $appid, 'json', $this->weatherHistoryUrl); |
|
511 | $url .= "&type=$type&start={$start->format('U')}"; |
|
@@ 302-304 (lines=3) @@ | ||
299 | */ |
|
300 | public function getWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
|
301 | { |
|
302 | if (!in_array($type, array('tick', 'hour', 'day'))) { |
|
303 | throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
|
304 | } |
|
305 | ||
306 | $xml = json_decode($this->getRawWeatherHistory($query, $start, $endOrCount, $type, $units, $lang, $appid), true); |
|
307 |