Completed
Push — master ( 344924...922541 )
by Mario
05:38
created

WeatherServices::getDailyForecastService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\WeatherServicesInterface
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\WeatherServicesInterface $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;
0 ignored issues
show
Documentation Bug introduced by
It seems like $weatherService of type object<Marek\OpenWeather...vices\WeatherInterface> is incompatible with the declared type object<Marek\OpenWeather...atherServicesInterface> of property $weatherService.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
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