@@ 350-360 (lines=11) @@ | ||
347 | * |
|
348 | * @api |
|
349 | */ |
|
350 | public function getForecastUVIndex($lat, $lon, $cnt) |
|
351 | { |
|
352 | $answer = $this->getRawUVIndexData('forecast', $lat, $lon, $cnt); |
|
353 | $data = $this->parseJson($answer); |
|
354 | ||
355 | $mapData = function ($entry) { |
|
356 | return new UVIndex($entry); |
|
357 | }; |
|
358 | ||
359 | return array_map($mapData, $data); |
|
360 | } |
|
361 | ||
362 | /** |
|
363 | * Returns the current uv index at the location you specified. |
|
@@ 378-388 (lines=11) @@ | ||
375 | * |
|
376 | * @api |
|
377 | */ |
|
378 | public function getHistoryUVIndex($lat, $lon, $cnt, $start, $end) |
|
379 | { |
|
380 | $answer = $this->getRawUVIndexData('history', $lat, $lon, $cnt, $start, $end); |
|
381 | $data = $this->parseJson($answer); |
|
382 | ||
383 | $mapData = function ($entry) { |
|
384 | return new UVIndex($entry); |
|
385 | }; |
|
386 | ||
387 | return array_map($mapData, $data); |
|
388 | } |
|
389 | ||
390 | /** |
|
391 | * Directly returns the xml/json/html string returned by OpenWeatherMap for the current weather. |