22
33- [ APIs] ( #apis )
44 - [ One Call] ( #one-call )
5- - [ getWeather] ( #getweatherfloat-latitude-float-longitude )
6- - [ getHistoryMoment] ( #gethistorymomentfloat-latitude-float-longitude-datetimeinterface-datetime )
7- - [ getHistoryAggregate] ( #gethistoryaggregatefloat-latitude-float-longitude-datetimeinterface-date )
5+ - [ getWeather] ( #getweather )
6+ - [ getHistoryMoment] ( #gethistorymoment )
7+ - [ getHistoryAggregate] ( #gethistoryaggregate )
88 - [ Weather] ( #weather )
9- - [ getCurrent] ( #getcurrentfloat-latitude-float-longitude )
10- - [ getForecast] ( #getforecastfloat-latitude-float-longitude-int-numresults--40 )
9+ - [ getCurrent] ( #getcurrent )
10+ - [ getForecast] ( #getforecast )
1111 - [ Air Pollution] ( #air-pollution )
12- - [ getCurrent] ( #getcurrentfloat-latitude-float-longitude -1 )
13- - [ getForecast] ( #getforecastfloat-latitude-float-longitude )
14- - [ getHistory] ( #gethistoryfloat-latitude-float-longitude-datetimeinterface-startdate-datetimeinterface-enddate )
12+ - [ getCurrent] ( #getcurrent -1 )
13+ - [ getForecast] ( #getforecast-1 )
14+ - [ getHistory] ( #gethistory )
1515 - [ Geocoding] ( #geocoding )
16- - [ getByLocationName] ( #getbylocationnamestring-locationname-int-numresults--5 )
17- - [ getByZipCode] ( #getbyzipcodestring-zipcode-string-countrycode )
18- - [ getByCoordinate] ( #getbycoordinatefloat-latitude-float-longitude-int-numresults--5 )
16+ - [ getByLocationName] ( #getbylocationname )
17+ - [ getByZipCode] ( #getbyzipcode )
18+ - [ getByCoordinate] ( #getbycoordinate )
1919- [ Common Methods] ( #common-methods )
20- - [ withUnitSystem] ( #withunitsystemstring-unitsystem )
21- - [ withLanguage] ( #withlanguagestring-language )
22- - [ withCacheTtl] ( #withcachettlint-time )
20+ - [ withUnitSystem] ( #withunitsystem )
21+ - [ withLanguage] ( #withlanguage )
22+ - [ withCacheTtl] ( #withcachettl )
2323
2424## APIs
2525
2626### One Call
2727
28- #### ` getWeather(float $latitude, float $longitude) `
28+ #### ` getWeather `
29+
30+ ``` php
31+ getWeather(float $latitude, float $longitude): OneCall
32+ ```
2933
3034Get current and forecast (minutely, hourly and daily) weather data.
3135
32- Returns a [ ` OneCall ` ] ( 05-objects.md#onecall ) object.
36+ Returns a [ ` OneCall ` ] ( 05-objects.md#onecall ) object:
3337
3438``` php
3539$weather = $openWeatherMap->getOneCall()->getWeather(50, 50);
3640
3741echo $weather->getCurrent()->getTemperature();
3842```
3943
40- #### ` getHistoryMoment(float $latitude, float $longitude, \DateTimeInterface $dateTime) `
44+ #### ` getHistoryMoment `
45+
46+ ``` php
47+ getHistoryMoment(float $latitude, float $longitude, \DateTimeInterface $dateTime): WeatherLocation
48+ ```
4149
4250Get weather data from a single moment in the past.
4351
44- Returns a [ ` WeatherLocation ` ] ( 05-objects.md#weatherlocation ) object.
52+ Returns a [ ` WeatherLocation ` ] ( 05-objects.md#weatherlocation ) object:
4553
4654``` php
4755$weather = $openWeatherMap->getOneCall()->getHistoryMoment(50, 50, new \DateTime('2023-01-01 12:00:00'));
4856
4957echo $weather->getTemperature();
5058```
5159
52- #### ` getHistoryAggregate(float $latitude, float $longitude, \DateTimeInterface $date) `
60+ #### ` getHistoryAggregate `
61+
62+ ``` php
63+ getHistoryAggregate(float $latitude, float $longitude, \DateTimeInterface $date): WeatherAggregate
64+ ```
5365
5466Get aggregated weather data from a single day in the past.
5567
56- Returns a [ ` WeatherAggregate ` ] ( 05-objects.md#weatheraggregate ) object.
68+ Returns a [ ` WeatherAggregate ` ] ( 05-objects.md#weatheraggregate ) object:
5769
5870``` php
5971$weather = $openWeatherMap->getOneCall()->getHistoryAggregate(50, 50, new \DateTime('1985-07-19'));
@@ -63,23 +75,31 @@ echo $weather->getTemperature();
6375
6476### Weather
6577
66- #### ` getCurrent(float $latitude, float $longitude) `
78+ #### ` getCurrent `
79+
80+ ``` php
81+ getCurrent(float $latitude, float $longitude): WeatherLocation
82+ ```
6783
6884Get current weather data.
6985
70- Returns a [ ` WeatherLocation ` ] ( 05-objects.md#weatherlocation-1 ) object.
86+ Returns a [ ` WeatherLocation ` ] ( 05-objects.md#weatherlocation-1 ) object:
7187
7288``` php
7389$weather = $openWeatherMap->getWeather()->getCurrent(50, 50);
7490
7591echo $weather->getTemperature();
7692```
7793
78- #### ` getForecast(float $latitude, float $longitude, int $numResults = 40) `
94+ #### ` getForecast `
95+
96+ ``` php
97+ getForecast(float $latitude, float $longitude, int $numResults = 40): WeatherLocationList
98+ ```
7999
80100Get weather forecast data per 3-hour steps for the next 5 days.
81101
82- Returns a [ ` WeatherLocationList ` ] ( 05-objects.md#weatherlocationlist ) object.
102+ Returns a [ ` WeatherLocationList ` ] ( 05-objects.md#weatherlocationlist ) object:
83103
84104``` php
85105// Since it returns 3-hour steps,
@@ -94,11 +114,15 @@ foreach ($weatherForecast->getList() as $weather) {
94114
95115### Air Pollution
96116
97- #### ` getCurrent(float $latitude, float $longitude) `
117+ #### ` getCurrent `
118+
119+ ``` php
120+ getCurrent(float $latitude, float $longitude): AirPollutionLocation
121+ ```
98122
99123Get current air pollution data.
100124
101- Returns a [ ` AirPollutionLocation ` ] ( 05-objects.md#airpollutionlocation ) object.
125+ Returns a [ ` AirPollutionLocation ` ] ( 05-objects.md#airpollutionlocation ) object:
102126
103127``` php
104128$airPollution = $openWeatherMap->getAirPollution()->getCurrent(50, 50);
@@ -107,11 +131,15 @@ echo $airPollution->getAirQuality()->getQualitativeName();
107131echo $airPollution->getCarbonMonoxide();
108132```
109133
110- #### ` getForecast(float $latitude, float $longitude) `
134+ #### ` getForecast `
135+
136+ ``` php
137+ getForecast(float $latitude, float $longitude): AirPollutionLocationList
138+ ```
111139
112140Get air pollution forecast data per 1-hour for the next 24 hours.
113141
114- Returns a [ ` AirPollutionLocationList ` ] ( 05-objects.md#airpollutionlocationlist ) object.
142+ Returns a [ ` AirPollutionLocationList ` ] ( 05-objects.md#airpollutionlocationlist ) object:
115143
116144``` php
117145$airPollutionForecast = $openWeatherMap->getAirPollution()->getForecast(50, 50);
@@ -123,11 +151,15 @@ foreach ($airPollutionForecast->getList() as $airPollution) {
123151}
124152```
125153
126- #### ` getHistory(float $latitude, float $longitude, \DateTimeInterface $startDate, \DateTimeInterface $endDate) `
154+ #### ` getHistory `
155+
156+ ``` php
157+ getHistory(float $latitude, float $longitude, \DateTimeInterface $startDate, \DateTimeInterface $endDate): AirPollutionLocationList
158+ ```
127159
128160Get air pollution history data between two dates.
129161
130- Returns a [ ` AirPollutionLocationList ` ] ( 05-objects.md#airpollutionlocationlist ) object.
162+ Returns a [ ` AirPollutionLocationList ` ] ( 05-objects.md#airpollutionlocationlist ) object:
131163
132164``` php
133165$startDate = new \DateTime('-7 days'); // 7 days ago
@@ -143,11 +175,18 @@ foreach ($airPollutionHistory->getList() as $airPollution) {
143175
144176### Geocoding
145177
146- #### ` getByLocationName(string $locationName, int $numResults = 5) `
178+ #### ` getByLocationName `
179+
180+ ``` php
181+ /**
182+ * @return Location[]
183+ */
184+ getByLocationName(string $locationName, int $numResults = 5): array
185+ ```
147186
148187Get locations data by location name.
149188
150- Returns an array of [ ` Location ` ] ( 05-objects.md#location ) objects.
189+ Returns an array of [ ` Location ` ] ( 05-objects.md#location ) objects:
151190
152191``` php
153192$locations = $openWeatherMap->getGeocoding()->getByLocationName('lisbon');
@@ -158,23 +197,34 @@ foreach ($locations as $location) {
158197}
159198```
160199
161- #### ` getByZipCode(string $zipCode, string $countryCode) `
200+ #### ` getByZipCode `
201+
202+ ``` php
203+ getByZipCode(string $zipCode, string $countryCode): ZipCodeLocation
204+ ```
162205
163206Get location data by zip/post code.
164207
165- Returns a [ ` ZipCodeLocation ` ] ( 05-objects.md#zipcodelocation ) object.
208+ Returns a [ ` ZipCodeLocation ` ] ( 05-objects.md#zipcodelocation ) object:
166209
167210``` php
168211$location = $openWeatherMap->getGeocoding()->getByZipCode('1000-001', 'pt');
169212
170213echo $location->getName();
171214```
172215
173- #### ` getByCoordinate(float $latitude, float $longitude, int $numResults = 5) `
216+ #### ` getByCoordinate `
217+
218+ ``` php
219+ /**
220+ * @return Location[]
221+ */
222+ getByCoordinate(float $latitude, float $longitude, int $numResults = 5): array
223+ ```
174224
175225Get locations data by coordinate.
176226
177- Returns an array of [ ` Location ` ] ( 05-objects.md#location ) objects.
227+ Returns an array of [ ` Location ` ] ( 05-objects.md#location ) objects:
178228
179229``` php
180230$locations = $openWeatherMap->getGeocoding()->getByCoordinate(50, 50);
@@ -187,7 +237,11 @@ foreach ($locations as $location) {
187237
188238## Common Methods
189239
190- #### ` withUnitSystem(string $unitSystem) `
240+ #### ` withUnitSystem `
241+
242+ ``` php
243+ withUnitSystem(string $unitSystem): self
244+ ```
191245
192246Makes a request with a different unit system from the one globally defined in the [ configuration] ( 02-configuration.md#unitsystem ) .
193247
@@ -202,7 +256,11 @@ $openWeatherMap->getWeather()
202256 ->getCurrent(50, 50);
203257```
204258
205- #### ` withLanguage(string $language) `
259+ #### ` withLanguage `
260+
261+ ``` php
262+ withLanguage(string $language): self
263+ ```
206264
207265Makes a request with a different language from the one globally defined in the [ configuration] ( 02-configuration.md#language ) .
208266
@@ -217,7 +275,11 @@ $openWeatherMap->getWeather()
217275 ->getCurrent(50, 50);
218276```
219277
220- #### ` withCacheTtl(?int $time) `
278+ #### ` withCacheTtl `
279+
280+ ``` php
281+ withCacheTtl(?int $time): self
282+ ```
221283
222284Makes a request and saves into cache with the provided time duration value (in seconds).
223285Check the [ Cache TTL] ( 02-configuration.md#cache-ttl ) section for more information regarding default values.
0 commit comments