WeatherBase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 47
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getParams() 0 6 1
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