Skip to content

Commit

Permalink
docs: updated Weather related info
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepimpao committed May 8, 2024
1 parent 84a5862 commit b39dadb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 150 deletions.
23 changes: 8 additions & 15 deletions docs/03-supported-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,31 @@ echo $weather->getTemperature();
#### `getCurrent`

```php
getCurrent(float $latitude, float $longitude): WeatherLocation
getCurrent(float $latitude, float $longitude): Weather
```

Get current weather data.

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

```php
$weather = $openWeatherMap->weather()->getCurrent(50, 50);

echo $weather->getTemperature();
$currentWeather = $api->weather()->getCurrent(50, 50);
```

#### `getForecast`

```php
getForecast(float $latitude, float $longitude, int $numResults = 40): WeatherLocationList
getForecast(float $latitude, float $longitude, int $numResults = 40): WeatherCollection
```

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

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

```php
// Since it returns 3-hour steps,
// Since it returns data in 3-hour steps,
// passing 8 as the numResults means it will return results for the next 24 hours
$weatherForecast = $openWeatherMap->weather()->getForecast(50, 50, 8);

foreach ($weatherForecast->getList() as $weather) {
echo $weather->getDateTime()->format('Y-m-d H:i:s');
echo $weather->getTemperature();
}
$weatherForecast = $api->weather()->getForecast(50, 50, 8);
```

### Air Pollution
Expand Down
78 changes: 30 additions & 48 deletions docs/05-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- [WeatherLocation](#weatherlocation)
- [Weather](#weather-1)
- [Weather](#weather-2)
- [WeatherLocation](#weatherlocation-1)
- [WeatherLocationList](#weatherlocationlist)
- [WeatherCollection](#weathercollection)
- [WeatherData](#weatherdata)
- [Air Pollution](#air-pollution)
- [AirPollution](#airpollution)
- [AirPollutionLocation](#airpollutionlocation)
Expand All @@ -19,17 +19,14 @@
- [Geocoding](#geocoding)
- [ZipLocation](#ziplocation)
- [Common](#common)
- [AtmosphericPressure](#atmosphericpressure)
- [Coordinate](#coordinate)
- [Condition](#condition)
- [Icon](#icon)
- [Location](#location)
- [MoonPhase](#moonphase)
- [Rain](#rain)
- [Snow](#snow)
- [Temperature](#temperature)
- [Timezone](#timezone)
- [Wind](#wind)
- [WeatherCondition](#weathercondition)

## One Call

Expand Down Expand Up @@ -121,44 +118,44 @@

### Weather

- `getLocation()`: [`Location`](#location)
- `getDateTime()`: `\DateTimeImmutable`
- `getTemperature()`: `float`
- `getTemperatureFeelsLike()`: `float`
- `getMinTemperature()`: `float`
- `getMaxTemperature()`: `float`
- `getHumidity()`: `int`
- `getCloudiness()`: `int`
- `getVisibility()`: `int`
- `getWeatherConditions()`: [`WeatherCondition[]`](#weathercondition)
- `getAtmosphericPressure()`: `int`
- `getConditions()`: [`Condition[]`](#condition)
- `getWind()`: [`Wind`](#wind)
- `getPrecipitationProbability()`: `?int`
- `getRain()`: [`?Rain`](#rain)
- `getSnow()`: [`?Snow`](#snow)
- `getAtmosphericPressure()`: [`AtmosphericPressure`](#atmosphericpressure)
- `getDateTime()`: `\DateTimeImmutable`
- `getRainVolume()`: `?float`
- `getSnowVolume()`: `?float`

### WeatherLocation
### WeatherCollection

- `getNumResults()`: `int`
- `getLocation()`: [`Location`](#location)
- `getData()`: [`WeatherData[]`](#weatherdata)

### WeatherData

- `getDateTime()`: `\DateTimeImmutable`
- `getTemperature()`: `float`
- `getTemperatureFeelsLike()`: `float`
- `getMinTemperature()`: `float`
- `getMaxTemperature()`: `float`
- `getHumidity()`: `int`
- `getCloudiness()`: `int`
- `getVisibility()`: `int`
- `getWeatherConditions()`: [`WeatherCondition[]`](#weathercondition)
- `getAtmosphericPressure()`: `int`
- `getConditions()`: [`Condition[]`](#condition)
- `getWind()`: [`Wind`](#wind)
- `getPrecipitationProbability()`: `?int`
- `getRain()`: [`?Rain`](#rain)
- `getSnow()`: [`?Snow`](#snow)
- `getAtmosphericPressure()`: [`AtmosphericPressure`](#atmosphericpressure)
- `getDateTime()`: `\DateTimeImmutable`

### WeatherLocationList

- `getNumResults()`: `int`
- `getLocation()`: [`Location`](#location)
- `getList()`: [`Weather[]`](#weather-2)
- `getRainVolume()`: `?float`
- `getSnowVolume()`: `?float`

## Air Pollution

Expand Down Expand Up @@ -210,21 +207,23 @@

## Common

### AtmosphericPressure

- `getPressure()`: `int`
- `getSeaLevelPressure()`: `?int`
- `getGroundLevelPressure()`: `?int`

### Coordinate

- `getLatitude()`: `float`
- `getLongitude()`: `float`

### Condition

- `getId()`: `int`
- `getName()`: `string`
- `getDescription()`: `string`
- `getIcon()`: [`Icon`](#icon)
- `getSystemName()`: `string`

### Icon

- `getId()`: `string`
- `getImageUrl()`: `string`
- `getUrl()`: `string`

### Location

Expand All @@ -235,6 +234,7 @@
- `getCountryCode()`: `?string`
- `getLocalNames()`: `?array`
- `getLocalName(string $countryCode)`: `?string`
- `getPopulation()`: `?int`
- `getTimezone()`: [`?Timezone`](#timezone)
- `getSunriseAt()`: `?\DateTimeImmutable`
- `getSunsetAt()`: `?\DateTimeImmutable`
Expand All @@ -245,16 +245,6 @@
- `getName()`: `string`
- `getSysName()`: `string`

### Rain

- `getLastOneHourVolume()`: `?float`
- `getLastThreeHoursVolume()`: `?float`

### Snow

- `getLastOneHourVolume()`: `?float`
- `getLastThreeHoursVolume()`: `?float`

### Temperature

- `getMorning()`: `float`
Expand All @@ -269,14 +259,6 @@
- `getOffset()`: `int`
- `getIdentifier()`: `?string`

### WeatherCondition

- `getId()`: `int`
- `getName()`: `string`
- `getDescription()`: `string`
- `getIcon()`: [`Icon`](#icon)
- `getSysName()`: `string`

### Wind

- `getSpeed()`: `float`
Expand Down
16 changes: 0 additions & 16 deletions src/Test/Util/TestExceptionsTrait.php

This file was deleted.

45 changes: 0 additions & 45 deletions src/Test/Util/TestResponsesTrait.php

This file was deleted.

26 changes: 0 additions & 26 deletions tests/Unit/ZipLocationTest.php

This file was deleted.

0 comments on commit b39dadb

Please sign in to comment.