WeatherBase::getParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Netgen\Bundle\OpenWeatherMapBundle\Core;
4
5
use Netgen\Bundle\OpenWeatherMapBundle\Cache\HandlerInterface;
6
use Netgen\Bundle\OpenWeatherMapBundle\Http\HttpClientInterface;
7
8
abstract class WeatherBase extends Base
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $units;
14
15
    /**
16
     * @var string
17
     */
18
    protected $language;
19
20
    /**
21
     * @var string
22
     */
23
    protected $type;
24
25
    /**
26
     * WeatherBase constructor.
27
     *
28
     * @param \Netgen\Bundle\OpenWeatherMapBundle\Http\HttpClientInterface $client
29
     * @param string $apiKey
30
     * @param \Netgen\Bundle\OpenWeatherMapBundle\Cache\HandlerInterface $cacheService
31
     * @param string $units
32
     * @param string $language
33
     * @param string $type
34
     */
35
    public function __construct(HttpClientInterface $client, $apiKey, HandlerInterface $cacheService, $units, $language, $type)
36
    {
37
        parent::__construct($client, $apiKey, $cacheService);
38
        $this->units = $units;
39
        $this->language = $language;
40
        $this->type = $type;
41
    }
42
43
    /**
44
     * Return standard params.
45
     *
46
     * @return string
47
     */
48
    protected function getParams()
49
    {
50
        return '&units=' . $this->units . '&lang=' . $this->language
51
            . '&type=' . $this->type
52
            . '&appid=' . $this->apiKey;
53
    }
54
}
55