| @@ 27-37 (lines=11) @@ | ||
| 24 | return $this->denormalizer->denormalize($result, new UltravioletIndexResponse()); |
|
| 25 | } |
|
| 26 | ||
| 27 | public function fetchForecastUltravioletIndex(GeographicCoordinates $coordinates, DaysCount $daysCount): AggregatedUltravioletIndex |
|
| 28 | { |
|
| 29 | $params = $this->factory->buildBag(self::BASE_URL . '/forecast'); |
|
| 30 | $params->setGetParameter($coordinates->getLatitude()); |
|
| 31 | $params->setGetParameter($coordinates->getLongitude()); |
|
| 32 | $params->setGetParameter($daysCount); |
|
| 33 | ||
| 34 | $result = $this->getResult($this->factory->build($params)); |
|
| 35 | ||
| 36 | return $this->denormalizer->denormalize($result, new AggregatedUltravioletIndex()); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function fetchHistoricalUltravioletIndex(GeographicCoordinates $coordinates, Period $period, DaysCount $daysCount): AggregatedUltravioletIndex |
|
| 40 | { |
|
| @@ 58-67 (lines=10) @@ | ||
| 55 | /** |
|
| 56 | * {@inheritdoc} |
|
| 57 | */ |
|
| 58 | public function fetchForecastByCityGeographicCoordinates(GeographicCoordinates $coordinates): AggregatedHourForecast |
|
| 59 | { |
|
| 60 | $params = $this->factory->buildBag(self::BASE_URL); |
|
| 61 | $params->setGetParameter($coordinates->getLatitude()); |
|
| 62 | $params->setGetParameter($coordinates->getLongitude()); |
|
| 63 | ||
| 64 | $response = $this->getResult($this->factory->build($params)); |
|
| 65 | ||
| 66 | return $this->denormalizer->denormalize($response, new AggregatedHourForecast()); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 50-59 (lines=10) @@ | ||
| 47 | /** |
|
| 48 | * {@inheritdoc} |
|
| 49 | */ |
|
| 50 | public function byGeographicCoordinates(GeographicCoordinates $coordinates): WeatherResponse |
|
| 51 | { |
|
| 52 | $params = $this->factory->buildBag(self::URL_WEATHER); |
|
| 53 | $params->setGetParameter($coordinates->getLatitude()); |
|
| 54 | $params->setGetParameter($coordinates->getLongitude()); |
|
| 55 | ||
| 56 | $response = $this->getResult($this->factory->build($params)); |
|
| 57 | ||
| 58 | return $this->denormalizer->denormalize($response, new WeatherResponse()); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * {@inheritdoc} |
|
| @@ 91-102 (lines=12) @@ | ||
| 88 | /** |
|
| 89 | * {@inheritdoc} |
|
| 90 | */ |
|
| 91 | public function inCycle(GeographicCoordinates $coordinates, Cluster $cluster, CityCount $cnt): AggregatedWeather |
|
| 92 | { |
|
| 93 | $params = $this->factory->buildBag(self::URL_CYCLE); |
|
| 94 | $params->setGetParameter($coordinates->getLatitude()); |
|
| 95 | $params->setGetParameter($coordinates->getLongitude()); |
|
| 96 | $params->setGetParameter($cluster); |
|
| 97 | $params->setGetParameter($cnt); |
|
| 98 | ||
| 99 | $response = $this->getResult($this->factory->build($params)); |
|
| 100 | ||
| 101 | return $this->denormalizer->denormalize($response, new AggregatedWeather()); |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * {@inheritdoc} |
|