@@ -110,60 +110,47 @@ $weatherForecast = $api->weather()->getForecast(50, 50, 8);
110
110
#### ` getCurrent `
111
111
112
112
``` php
113
- getCurrent(float $latitude, float $longitude): AirPollutionLocation
113
+ getCurrent(float $latitude, float $longitude): AirPollution
114
114
```
115
115
116
116
Get current air pollution data.
117
117
118
- Returns a [ ` AirPollutionLocation ` ] ( 05-entities.md#airpollutionlocation ) object:
118
+ Returns a [ ` AirPollution ` ] ( 05-entities.md#airpollution ) object:
119
119
120
120
``` php
121
- $airPollution = $openWeatherMap->airPollution()->getCurrent(50, 50);
122
-
123
- echo $airPollution->getAirQuality()->getQualitativeName();
124
- echo $airPollution->getCarbonMonoxide();
121
+ $currentAirPollution = $api->airPollution()->getCurrent(50, 50);
125
122
```
126
123
127
124
#### ` getForecast `
128
125
129
126
``` php
130
- getForecast(float $latitude, float $longitude): AirPollutionLocationList
127
+ getForecast(float $latitude, float $longitude): AirPollutionCollection
131
128
```
132
129
133
- Get air pollution forecast data per 1- hour for the next 24 hours .
130
+ Get air pollution forecast data per hour.
134
131
135
- Returns a [ ` AirPollutionLocationList ` ] ( 05-entities.md#airpollutionlocationlist ) object:
132
+ Returns a [ ` AirPollutionCollection ` ] ( 05-entities.md#airpollutioncollection ) object:
136
133
137
134
``` php
138
- $airPollutionForecast = $openWeatherMap->airPollution()->getForecast(50, 50);
139
-
140
- foreach ($airPollutionForecast->getList() as $airPollution) {
141
- echo $airPollution->getDateTime()->format('Y-m-d H:i:s');
142
- echo $airPollution->getAirQuality()->getQualitativeName();
143
- echo $airPollution->getCarbonMonoxide();
144
- }
135
+ $airPollutionForecast = $api->airPollution()->getForecast(50, 50);
145
136
```
146
137
147
138
#### ` getHistory `
148
139
149
140
``` php
150
- getHistory(float $latitude, float $longitude, \DateTimeInterface $startDate, \DateTimeInterface $endDate): AirPollutionLocationList
141
+ getHistory(float $latitude, float $longitude, \DateTimeInterface $startDate, \DateTimeInterface $endDate): AirPollutionCollection
151
142
```
152
143
153
- Get air pollution history data between two dates.
144
+ Get air pollution history data per hour between two dates.
154
145
155
- Returns a [ ` AirPollutionLocationList ` ] ( 05-entities.md#airpollutionlocationlist ) object:
146
+ Returns a [ ` AirPollutionCollection ` ] ( 05-entities.md#airpollutioncollection ) object:
156
147
157
148
``` php
158
- $startDate = new \DateTime('-7 days'); // 7 days ago
159
- $endDate = new \DateTime('-6 days'); // 6 days ago
160
- $airPollutionHistory = $openWeatherMap->airPollution()->getHistory(50, 50, $startDate, $endDate);
161
-
162
- foreach ($airPollutionHistory->getList() as $airPollution) {
163
- echo $airPollution->getDateTime()->format('Y-m-d H:i:s');
164
- echo $airPollution->getAirQuality()->getQualitativeName();
165
- echo $airPollution->getCarbonMonoxide();
166
- }
149
+ $startDate = new \DateTime('-1 day');
150
+ $endDate = new \DateTime('now');
151
+
152
+ // returns air pollution data for the last 24 hours
153
+ $airPollutionHistory = $api->airPollution()->getHistory(50, 50, $startDate, $endDate);
167
154
```
168
155
169
156
### Geocoding
@@ -210,7 +197,7 @@ getByZipCode(string $zipCode, string $countryCode): ZipLocation
210
197
211
198
Get location by zip code.
212
199
213
- Returns a [ ` ZipLocation ` ] ( 05-entities.md#ziplocation ) entity .
200
+ Returns a [ ` ZipLocation ` ] ( 05-entities.md#ziplocation ) object .
214
201
215
202
``` php
216
203
$location = $api->geocoding()->getByZipCode('1000-001', 'pt');
0 commit comments