Skip to content

Commit b39dadb

Browse files
committed
docs: updated Weather related info
1 parent 84a5862 commit b39dadb

File tree

5 files changed

+38
-150
lines changed

5 files changed

+38
-150
lines changed

docs/03-supported-apis.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,38 +78,31 @@ echo $weather->getTemperature();
7878
#### `getCurrent`
7979

8080
```php
81-
getCurrent(float $latitude, float $longitude): WeatherLocation
81+
getCurrent(float $latitude, float $longitude): Weather
8282
```
8383

8484
Get current weather data.
8585

86-
Returns a [`WeatherLocation`](05-entities.md#weatherlocation-1) object:
86+
Returns a [`Weather`](05-entities.md#weather-2) object:
8787

8888
```php
89-
$weather = $openWeatherMap->weather()->getCurrent(50, 50);
90-
91-
echo $weather->getTemperature();
89+
$currentWeather = $api->weather()->getCurrent(50, 50);
9290
```
9391

9492
#### `getForecast`
9593

9694
```php
97-
getForecast(float $latitude, float $longitude, int $numResults = 40): WeatherLocationList
95+
getForecast(float $latitude, float $longitude, int $numResults = 40): WeatherCollection
9896
```
9997

100-
Get weather forecast data per 3-hour steps for the next 5 days.
98+
Get weather forecast for the next 5 days in 3-hour steps.
10199

102-
Returns a [`WeatherLocationList`](05-entities.md#weatherlocationlist) object:
100+
Returns a [`WeatherCollection`](05-entities.md#weathercollection) object:
103101

104102
```php
105-
// Since it returns 3-hour steps,
103+
// Since it returns data in 3-hour steps,
106104
// passing 8 as the numResults means it will return results for the next 24 hours
107-
$weatherForecast = $openWeatherMap->weather()->getForecast(50, 50, 8);
108-
109-
foreach ($weatherForecast->getList() as $weather) {
110-
echo $weather->getDateTime()->format('Y-m-d H:i:s');
111-
echo $weather->getTemperature();
112-
}
105+
$weatherForecast = $api->weather()->getForecast(50, 50, 8);
113106
```
114107

115108
### Air Pollution

docs/05-entities.md

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
- [WeatherLocation](#weatherlocation)
1010
- [Weather](#weather-1)
1111
- [Weather](#weather-2)
12-
- [WeatherLocation](#weatherlocation-1)
13-
- [WeatherLocationList](#weatherlocationlist)
12+
- [WeatherCollection](#weathercollection)
13+
- [WeatherData](#weatherdata)
1414
- [Air Pollution](#air-pollution)
1515
- [AirPollution](#airpollution)
1616
- [AirPollutionLocation](#airpollutionlocation)
@@ -19,17 +19,14 @@
1919
- [Geocoding](#geocoding)
2020
- [ZipLocation](#ziplocation)
2121
- [Common](#common)
22-
- [AtmosphericPressure](#atmosphericpressure)
2322
- [Coordinate](#coordinate)
23+
- [Condition](#condition)
2424
- [Icon](#icon)
2525
- [Location](#location)
2626
- [MoonPhase](#moonphase)
27-
- [Rain](#rain)
28-
- [Snow](#snow)
2927
- [Temperature](#temperature)
3028
- [Timezone](#timezone)
3129
- [Wind](#wind)
32-
- [WeatherCondition](#weathercondition)
3330

3431
## One Call
3532

@@ -121,44 +118,44 @@
121118

122119
### Weather
123120

121+
- `getLocation()`: [`Location`](#location)
122+
- `getDateTime()`: `\DateTimeImmutable`
124123
- `getTemperature()`: `float`
125124
- `getTemperatureFeelsLike()`: `float`
126125
- `getMinTemperature()`: `float`
127126
- `getMaxTemperature()`: `float`
128127
- `getHumidity()`: `int`
129128
- `getCloudiness()`: `int`
130129
- `getVisibility()`: `int`
131-
- `getWeatherConditions()`: [`WeatherCondition[]`](#weathercondition)
130+
- `getAtmosphericPressure()`: `int`
131+
- `getConditions()`: [`Condition[]`](#condition)
132132
- `getWind()`: [`Wind`](#wind)
133133
- `getPrecipitationProbability()`: `?int`
134-
- `getRain()`: [`?Rain`](#rain)
135-
- `getSnow()`: [`?Snow`](#snow)
136-
- `getAtmosphericPressure()`: [`AtmosphericPressure`](#atmosphericpressure)
137-
- `getDateTime()`: `\DateTimeImmutable`
134+
- `getRainVolume()`: `?float`
135+
- `getSnowVolume()`: `?float`
138136

139-
### WeatherLocation
137+
### WeatherCollection
140138

139+
- `getNumResults()`: `int`
141140
- `getLocation()`: [`Location`](#location)
141+
- `getData()`: [`WeatherData[]`](#weatherdata)
142+
143+
### WeatherData
144+
145+
- `getDateTime()`: `\DateTimeImmutable`
142146
- `getTemperature()`: `float`
143147
- `getTemperatureFeelsLike()`: `float`
144148
- `getMinTemperature()`: `float`
145149
- `getMaxTemperature()`: `float`
146150
- `getHumidity()`: `int`
147151
- `getCloudiness()`: `int`
148152
- `getVisibility()`: `int`
149-
- `getWeatherConditions()`: [`WeatherCondition[]`](#weathercondition)
153+
- `getAtmosphericPressure()`: `int`
154+
- `getConditions()`: [`Condition[]`](#condition)
150155
- `getWind()`: [`Wind`](#wind)
151156
- `getPrecipitationProbability()`: `?int`
152-
- `getRain()`: [`?Rain`](#rain)
153-
- `getSnow()`: [`?Snow`](#snow)
154-
- `getAtmosphericPressure()`: [`AtmosphericPressure`](#atmosphericpressure)
155-
- `getDateTime()`: `\DateTimeImmutable`
156-
157-
### WeatherLocationList
158-
159-
- `getNumResults()`: `int`
160-
- `getLocation()`: [`Location`](#location)
161-
- `getList()`: [`Weather[]`](#weather-2)
157+
- `getRainVolume()`: `?float`
158+
- `getSnowVolume()`: `?float`
162159

163160
## Air Pollution
164161

@@ -210,21 +207,23 @@
210207

211208
## Common
212209

213-
### AtmosphericPressure
214-
215-
- `getPressure()`: `int`
216-
- `getSeaLevelPressure()`: `?int`
217-
- `getGroundLevelPressure()`: `?int`
218-
219210
### Coordinate
220211

221212
- `getLatitude()`: `float`
222213
- `getLongitude()`: `float`
223214

215+
### Condition
216+
217+
- `getId()`: `int`
218+
- `getName()`: `string`
219+
- `getDescription()`: `string`
220+
- `getIcon()`: [`Icon`](#icon)
221+
- `getSystemName()`: `string`
222+
224223
### Icon
225224

226225
- `getId()`: `string`
227-
- `getImageUrl()`: `string`
226+
- `getUrl()`: `string`
228227

229228
### Location
230229

@@ -235,6 +234,7 @@
235234
- `getCountryCode()`: `?string`
236235
- `getLocalNames()`: `?array`
237236
- `getLocalName(string $countryCode)`: `?string`
237+
- `getPopulation()`: `?int`
238238
- `getTimezone()`: [`?Timezone`](#timezone)
239239
- `getSunriseAt()`: `?\DateTimeImmutable`
240240
- `getSunsetAt()`: `?\DateTimeImmutable`
@@ -245,16 +245,6 @@
245245
- `getName()`: `string`
246246
- `getSysName()`: `string`
247247

248-
### Rain
249-
250-
- `getLastOneHourVolume()`: `?float`
251-
- `getLastThreeHoursVolume()`: `?float`
252-
253-
### Snow
254-
255-
- `getLastOneHourVolume()`: `?float`
256-
- `getLastThreeHoursVolume()`: `?float`
257-
258248
### Temperature
259249

260250
- `getMorning()`: `float`
@@ -269,14 +259,6 @@
269259
- `getOffset()`: `int`
270260
- `getIdentifier()`: `?string`
271261

272-
### WeatherCondition
273-
274-
- `getId()`: `int`
275-
- `getName()`: `string`
276-
- `getDescription()`: `string`
277-
- `getIcon()`: [`Icon`](#icon)
278-
- `getSysName()`: `string`
279-
280262
### Wind
281263

282264
- `getSpeed()`: `float`

src/Test/Util/TestExceptionsTrait.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/Test/Util/TestResponsesTrait.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

tests/Unit/ZipLocationTest.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)