Skip to content

Commit 46593c1

Browse files
committed
Merge pull request #27 from pablopereira27/master
cnt modified
2 parents 6a9ecab + 83a2f6d commit 46593c1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Cmfcmf/OpenWeatherMap.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function getWeather($query, $units = 'imperial', $lang = 'en', $appid = '
179179
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
180180
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
181181
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
182-
* @param int $days For how much days you want to get a forecast. Default 1, maximum: 14.
182+
* @param int $days For how much days you want to get a forecast. Default 1, maximum: 16.
183183
*
184184
* @throws OpenWeatherMap\Exception If OpenWeatherMap returns an error.
185185
* @throws \InvalidArgumentException If an argument error occurs.
@@ -220,10 +220,10 @@ public function getWeatherForecast($query, $units = 'imperial', $lang = 'en', $a
220220

221221
if ($days <= 5) {
222222
$answer = $this->getRawHourlyForecastData($query, $units, $lang, $appid, 'xml');
223-
} else if ($days <= 14) {
223+
} else if ($days <= 16) {
224224
$answer = $this->getRawDailyForecastData($query, $units, $lang, $appid, 'xml', $days);
225225
} else {
226-
throw new \InvalidArgumentException('Error: forecasts are only available for the next 14 days. $days must be lower than 15.');
226+
throw new \InvalidArgumentException('Error: forecasts are only available for the next 16 days. $days must be lower than 17.');
227227
}
228228

229229
try {
@@ -407,9 +407,9 @@ public function getRawHourlyForecastData($query, $units = 'imperial', $lang = 'e
407407
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
408408
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
409409
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default)
410-
* @param int $cnt How many days of forecast shall be returned? Maximum (and default): 14
410+
* @param int $cnt How many days of forecast shall be returned? Maximum (and default): 16
411411
*
412-
* @throws \InvalidArgumentException If $cnt is higher than 14.
412+
* @throws \InvalidArgumentException If $cnt is higher than 16.
413413
* @return string Returns false on failure and the fetched data in the format you specified on success.
414414
*
415415
* Warning If an error occurred, OpenWeatherMap returns data in json format ALWAYS
@@ -440,10 +440,10 @@ public function getRawHourlyForecastData($query, $units = 'imperial', $lang = 'e
440440
*
441441
* @api
442442
*/
443-
public function getRawDailyForecastData($query, $units = 'imperial', $lang = 'en', $appid = '', $mode = 'xml', $cnt = 14)
443+
public function getRawDailyForecastData($query, $units = 'imperial', $lang = 'en', $appid = '', $mode = 'xml', $cnt = 16)
444444
{
445-
if ($cnt > 14) {
446-
throw new \InvalidArgumentException('$cnt must be 14 or below!');
445+
if ($cnt > 16) {
446+
throw new \InvalidArgumentException('$cnt must be 16 or below!');
447447
}
448448
$url = $this->buildUrl($query, $units, $lang, $appid, $mode, $this->weatherDailyForecastUrl) . "&cnt=$cnt";
449449

0 commit comments

Comments
 (0)