Skip to content

Commit a08d55a

Browse files
committed
Minor formatting and docs improvements
1 parent 409bdc8 commit a08d55a

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Cmfcmf/OpenWeatherMap.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ public function getWeatherGroup($ids, $units = 'imperial', $lang = 'en', $appid
213213
}
214214

215215
/**
216-
* Returns the forecast for the place you specified. DANGER: Might return
217-
* fewer results than requested due to a bug in the OpenWeatherMap API!
216+
* Returns the forecast for the place you specified.
218217
*
219218
* @param array|int|string $query The place to get weather information for. For possible values see ::getWeather.
220219
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
@@ -244,8 +243,7 @@ public function getWeatherForecast($query, $units = 'imperial', $lang = 'en', $a
244243
}
245244

246245
/**
247-
* Returns the DAILY forecast for the place you specified. DANGER: Might return
248-
* fewer results than requested due to a bug in the OpenWeatherMap API!
246+
* Returns the DAILY forecast for the place you specified.
249247
*
250248
* @param array|int|string $query The place to get weather information for. For possible values see ::getWeather.
251249
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.

Cmfcmf/OpenWeatherMap/Forecast.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ public function __construct(\SimpleXMLElement $xml, $units)
5454

5555
$xml->temperature['value'] = round((floatval($xml->temperature['max']) + floatval($xml->temperature['min'])) / 2, 2);
5656

57-
$this->temperature = new Temperature(new Unit($xml->temperature['value'], $temperatureUnit), new Unit($xml->temperature['min'], $temperatureUnit), new Unit($xml->temperature['max'], $temperatureUnit), new Unit($xml->temperature['day'], $temperatureUnit), new Unit($xml->temperature['morn'], $temperatureUnit), new Unit($xml->temperature['eve'], $temperatureUnit), new Unit($xml->temperature['night'], $temperatureUnit));
57+
$this->temperature = new Temperature(
58+
new Unit($xml->temperature['value'], $temperatureUnit),
59+
new Unit($xml->temperature['min'], $temperatureUnit),
60+
new Unit($xml->temperature['max'], $temperatureUnit),
61+
new Unit($xml->temperature['day'], $temperatureUnit),
62+
new Unit($xml->temperature['morn'], $temperatureUnit),
63+
new Unit($xml->temperature['eve'], $temperatureUnit),
64+
new Unit($xml->temperature['night'], $temperatureUnit)
65+
);
5866
$this->humidity = new Unit($xml->humidity['value'], $xml->humidity['unit']);
5967
$this->pressure = new Unit($xml->pressure['value'], $xml->pressure['unit']);
6068

Examples/AirPollution.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
$owm = new OpenWeatherMap($myApiKey, $httpClient, $httpRequestFactory);
4444

45-
// Example 1: Get current uv index in Berlin.
45+
// Example 1: Get current air pollution in Berlin.
4646
$o3 = $owm->getAirPollution("O3", "52", "13");
4747
$no2 = $owm->getAirPollution("NO2", "52", "13");
4848
$so2 = $owm->getAirPollution("SO2", "52", "13");

Examples/UVIndex.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
$cli = true;
3030
}
3131

32-
// Language of data (try your own language here!):
33-
$lang = 'de';
34-
35-
// Units (can be 'metric' or 'imperial' [default]):
36-
$units = 'metric';
37-
3832
// You can use every PSR-17 compatible HTTP request factory
3933
// and every PSR-18 compatible HTTP client.
4034
$httpRequestFactory = new RequestFactory();

Examples/WeatherForecast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262

6363
// Example 2: Get forecast for the next 3 days for Berlin.
64-
$forecast = $owm->getWeatherForecast('Berlin', $units, $lang, '', 3);
64+
$forecast = $owm->getWeatherForecast('Berlin', $units, $lang, '', 16);
6565
echo "EXAMPLE 2<hr />\n\n\n";
6666

6767
foreach ($forecast as $weather) {

0 commit comments

Comments
 (0)