@@ -218,41 +218,39 @@ $location = $api->geocoding()->getByZipCode('1000-001', 'pt');
218
218
219
219
## Common Methods
220
220
221
- #### ` withUnitSystem `
221
+ #### ` withLanguage `
222
222
223
223
``` php
224
- withUnitSystem (string $unitSystem ): self
224
+ withLanguage (string $language ): self
225
225
```
226
226
227
- Makes a request with a different unit system from the one globally defined in the [ configuration] ( 02-configuration.md#unitsystem ) .
228
-
229
- Only available for [ ` OneCall ` ] ( #one-call ) and [ ` Weather ` ] ( #weather ) APIs.
227
+ Set the language per request.
228
+ Only available for [ ` OneCall ` ] ( #one-call ) and [ ` Weather ` ] ( #weather ) API requests.
230
229
231
230
``` php
232
- use ProgrammatorDev\OpenWeatherMap\UnitSystem\UnitSystem;
231
+ use ProgrammatorDev\OpenWeatherMap\Language\Language
233
232
234
- // Uses 'imperial' unit system for this request alone
235
- $openWeatherMap ->weather()
236
- ->withUnitSystem(UnitSystem::IMPERIAL )
233
+ // uses the "pt" language for this request alone
234
+ $api ->weather()
235
+ ->withLanguage(Language::PORTUGUESE )
237
236
->getCurrent(50, 50);
238
237
```
239
238
240
- #### ` withLanguage `
239
+ #### ` withUnitSystem `
241
240
242
241
``` php
243
- withLanguage (string $language ): self
242
+ withUnitSystem (string $unitSystem ): self
244
243
```
245
244
246
- Makes a request with a different language from the one globally defined in the [ configuration] ( 02-configuration.md#language ) .
247
-
248
- Only available for [ ` OneCall ` ] ( #one-call ) and [ ` Weather ` ] ( #weather ) APIs.
245
+ Set the unit system per request.
246
+ Only available for [ ` OneCall ` ] ( #one-call ) and [ ` Weather ` ] ( #weather ) API requests.
249
247
250
248
``` php
251
- use ProgrammatorDev\OpenWeatherMap\Language\Language
249
+ use ProgrammatorDev\OpenWeatherMap\UnitSystem\UnitSystem;
252
250
253
- // Uses 'pt' language for this request alone
254
- $openWeatherMap ->weather()
255
- ->withLanguage(Language::PORTUGUESE )
251
+ // uses the "imperial" unit system for this request alone
252
+ $api ->weather()
253
+ ->withUnitSystem(UnitSystem::IMPERIAL )
256
254
->getCurrent(50, 50);
257
255
```
258
256
0 commit comments