|
@@ 292-294 (lines=3) @@
|
| 289 |
|
*/ |
| 290 |
|
public function getWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
| 291 |
|
{ |
| 292 |
|
if (!in_array($type, array('tick', 'hour', 'day'))) { |
| 293 |
|
throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
| 294 |
|
} |
| 295 |
|
|
| 296 |
|
$xml = json_decode($this->getRawWeatherHistory($query, $start, $endOrCount, $type, $units, $lang, $appid), true); |
| 297 |
|
|
|
@@ 493-495 (lines=3) @@
|
| 490 |
|
*/ |
| 491 |
|
public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '') |
| 492 |
|
{ |
| 493 |
|
if (!in_array($type, array('tick', 'hour', 'day'))) { |
| 494 |
|
throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"'); |
| 495 |
|
} |
| 496 |
|
|
| 497 |
|
$url = $this->buildUrl($query, $units, $lang, $appid, 'json', $this->weatherHistoryUrl); |
| 498 |
|
$url .= "&type=$type&start={$start->format('U')}"; |