Skip to content

Commit 23906c4

Browse files
committed
docs: updated withLanguage and withUnitSystem sections
1 parent 67d5598 commit 23906c4

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

docs/03-supported-apis.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,41 +218,39 @@ $location = $api->geocoding()->getByZipCode('1000-001', 'pt');
218218

219219
## Common Methods
220220

221-
#### `withUnitSystem`
221+
#### `withLanguage`
222222

223223
```php
224-
withUnitSystem(string $unitSystem): self
224+
withLanguage(string $language): self
225225
```
226226

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.
230229

231230
```php
232-
use ProgrammatorDev\OpenWeatherMap\UnitSystem\UnitSystem;
231+
use ProgrammatorDev\OpenWeatherMap\Language\Language
233232

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)
237236
->getCurrent(50, 50);
238237
```
239238

240-
#### `withLanguage`
239+
#### `withUnitSystem`
241240

242241
```php
243-
withLanguage(string $language): self
242+
withUnitSystem(string $unitSystem): self
244243
```
245244

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.
249247

250248
```php
251-
use ProgrammatorDev\OpenWeatherMap\Language\Language
249+
use ProgrammatorDev\OpenWeatherMap\UnitSystem\UnitSystem;
252250

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)
256254
->getCurrent(50, 50);
257255
```
258256

0 commit comments

Comments
 (0)