Skip to content

Commit e33833d

Browse files
committed
chore: Changed OneCall entities
1 parent 129e9dd commit e33833d

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

src/Endpoint/OneCallEndpoint.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use Http\Client\Exception;
66
use ProgrammatorDev\OpenWeatherMap\Endpoint\Util\WithLanguageTrait;
77
use ProgrammatorDev\OpenWeatherMap\Endpoint\Util\WithUnitSystemTrait;
8-
use ProgrammatorDev\OpenWeatherMap\Entity\OneCall\HistoryDaySummary;
9-
use ProgrammatorDev\OpenWeatherMap\Entity\OneCall\HistoryMoment;
8+
use ProgrammatorDev\OpenWeatherMap\Entity\OneCall\WeatherAggregate;
9+
use ProgrammatorDev\OpenWeatherMap\Entity\OneCall\WeatherMoment;
1010
use ProgrammatorDev\OpenWeatherMap\Entity\OneCall\OneCall;
1111
use ProgrammatorDev\OpenWeatherMap\Exception\BadRequestException;
1212
use ProgrammatorDev\OpenWeatherMap\Exception\NotFoundException;
@@ -28,7 +28,7 @@ class OneCallEndpoint extends AbstractEndpoint
2828

2929
private string $urlOneCallHistoryMoment = 'https://api.openweathermap.org/data/3.0/onecall/timemachine';
3030

31-
private string $urlOneCallHistoryDaySummary = 'https://api.openweathermap.org/data/3.0/onecall/day_summary';
31+
private string $urlOneCallHistoryAggregate = 'https://api.openweathermap.org/data/3.0/onecall/day_summary';
3232

3333
/**
3434
* @throws Exception
@@ -66,7 +66,7 @@ public function getWeather(float $latitude, float $longitude): OneCall
6666
* @throws UnexpectedErrorException
6767
* @throws ValidationException
6868
*/
69-
public function getHistoryMoment(float $latitude, float $longitude, \DateTimeInterface $dateTime): HistoryMoment
69+
public function getHistoryMoment(float $latitude, float $longitude, \DateTimeInterface $dateTime): WeatherMoment
7070
{
7171
$this->validateCoordinate($latitude, $longitude);
7272
$this->validateLessThan('dateTime', $dateTime, new \DateTimeImmutable('now'));
@@ -83,7 +83,7 @@ public function getHistoryMoment(float $latitude, float $longitude, \DateTimeInt
8383
]
8484
);
8585

86-
return new HistoryMoment($data);
86+
return new WeatherMoment($data);
8787
}
8888

8989
/**
@@ -95,14 +95,14 @@ public function getHistoryMoment(float $latitude, float $longitude, \DateTimeInt
9595
* @throws UnexpectedErrorException
9696
* @throws ValidationException
9797
*/
98-
public function getHistoryDaySummary(float $latitude, float $longitude, \DateTimeInterface $dateTime): HistoryDaySummary
98+
public function getHistoryAggregate(float $latitude, float $longitude, \DateTimeInterface $dateTime): WeatherAggregate
9999
{
100100
$this->validateCoordinate($latitude, $longitude);
101101
$this->validateLessThan('dateTime', $dateTime, new \DateTimeImmutable('now'));
102102

103103
$data = $this->sendRequest(
104104
method: 'GET',
105-
baseUrl: $this->urlOneCallHistoryDaySummary,
105+
baseUrl: $this->urlOneCallHistoryAggregate,
106106
query: [
107107
'lat' => $latitude,
108108
'lon' => $longitude,
@@ -112,6 +112,6 @@ public function getHistoryDaySummary(float $latitude, float $longitude, \DateTim
112112
]
113113
);
114114

115-
return new HistoryDaySummary($data);
115+
return new WeatherAggregate($data);
116116
}
117117
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use ProgrammatorDev\OpenWeatherMap\Entity\Timezone;
77
use ProgrammatorDev\OpenWeatherMap\Entity\Wind;
88

9-
class HistoryDaySummary
9+
class WeatherAggregate
1010
{
1111
private Coordinate $coordinate;
1212

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use ProgrammatorDev\OpenWeatherMap\Entity\Coordinate;
66
use ProgrammatorDev\OpenWeatherMap\Entity\Timezone;
77

8-
class HistoryMoment extends Weather
8+
class WeatherMoment extends Weather
99
{
1010
private Coordinate $coordinate;
1111

0 commit comments

Comments
 (0)