1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Marek\OpenWeatherMap\Core; |
6
|
|
|
|
7
|
|
|
use Marek\OpenWeatherMap\API\Weather\Services\AirPollutionInterface; |
8
|
|
|
use Marek\OpenWeatherMap\API\Weather\Services\HourForecastInterface; |
9
|
|
|
use Marek\OpenWeatherMap\API\Weather\Services\UltravioletIndexInterface; |
10
|
|
|
use Marek\OpenWeatherMap\API\Weather\Services\WeatherInterface; |
11
|
|
|
use Marek\OpenWeatherMap\API\Weather\WeatherServicesInterface; |
12
|
|
|
|
13
|
|
|
class WeatherServices implements WeatherServicesInterface |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var \Marek\OpenWeatherMap\API\Weather\Services\WeatherInterface |
17
|
|
|
*/ |
18
|
|
|
protected $weatherService; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var \Marek\OpenWeatherMap\API\Weather\Services\HourForecastInterface |
22
|
|
|
*/ |
23
|
|
|
protected $hourForecastService; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var \Marek\OpenWeatherMap\API\Weather\Services\UltravioletIndexInterface |
27
|
|
|
*/ |
28
|
|
|
protected $ultravioletIndexService; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var \Marek\OpenWeatherMap\API\Weather\Services\AirPollutionInterface |
32
|
|
|
*/ |
33
|
|
|
protected $airPollutionService; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* WeatherServices constructor. |
37
|
|
|
* |
38
|
|
|
* @param \Marek\OpenWeatherMap\API\Weather\Services\WeatherInterface $weatherService |
39
|
|
|
* @param \Marek\OpenWeatherMap\API\Weather\Services\HourForecastInterface $hourForecastService |
40
|
|
|
* @param \Marek\OpenWeatherMap\API\Weather\Services\UltravioletIndexInterface $ultravioletIndexService |
41
|
|
|
* @param \Marek\OpenWeatherMap\API\Weather\Services\AirPollutionInterface $airPollutionService |
42
|
|
|
*/ |
43
|
|
|
public function __construct( |
44
|
|
|
WeatherInterface $weatherService, |
45
|
|
|
HourForecastInterface $hourForecastService, |
46
|
|
|
UltravioletIndexInterface $ultravioletIndexService, |
47
|
|
|
AirPollutionInterface $airPollutionService |
48
|
|
|
) { |
49
|
|
|
$this->weatherService = $weatherService; |
50
|
|
|
$this->hourForecastService = $hourForecastService; |
51
|
|
|
$this->ultravioletIndexService = $ultravioletIndexService; |
52
|
|
|
$this->airPollutionService = $airPollutionService; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* {@inheritdoc} |
57
|
|
|
*/ |
58
|
|
|
public function getWeatherService(): WeatherInterface |
59
|
|
|
{ |
60
|
|
|
return $this->weatherService; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* {@inheritdoc} |
65
|
|
|
*/ |
66
|
|
|
public function getAirPollutionService(): AirPollutionInterface |
67
|
|
|
{ |
68
|
|
|
return $this->airPollutionService; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* {@inheritdoc} |
73
|
|
|
*/ |
74
|
|
|
public function getUltravioletIndexService(): UltravioletIndexInterface |
75
|
|
|
{ |
76
|
|
|
return $this->ultravioletIndexService; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* {@inheritdoc} |
81
|
|
|
*/ |
82
|
|
|
public function getHourForecastService(): HourForecastInterface |
83
|
|
|
{ |
84
|
|
|
return $this->hourForecastService; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|