APIConfiguration   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 70
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getKey() 0 4 1
A getUnits() 0 4 1
A getLanguage() 0 4 1
A getType() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marek\OpenWeatherMap\API\Value\Configuration;
6
7
use Marek\OpenWeatherMap\API\Constraints\Language;
8
use Marek\OpenWeatherMap\API\Constraints\SearchAccuracy;
9
use Marek\OpenWeatherMap\API\Constraints\UnitsFormat;
10
11
final class APIConfiguration
12
{
13
    /**
14
     * @var string
15
     */
16
    private $key;
17
18
    /**
19
     * @var string
20
     */
21
    private $units;
22
23
    /**
24
     * @var string
25
     */
26
    private $language;
27
28
    /**
29
     * @var string
30
     */
31
    private $type;
32
33
    /**
34
     * APIConfiguration constructor.
35
     *
36
     * @param string $key
37
     * @param string $units
38
     * @param string $language
39
     * @param string $type
40
     */
41
    public function __construct(string $key, string $units = UnitsFormat::STANDARD, string $language = Language::ENGLISH, string $type = SearchAccuracy::ACCURATE)
42
    {
43
        $this->key = $key;
44
        $this->units = $units;
45
        $this->language = $language;
46
        $this->type = $type;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getKey(): string
53
    {
54
        return $this->key;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getUnits(): string
61
    {
62
        return $this->units;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getLanguage(): string
69
    {
70
        return $this->language;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getType(): string
77
    {
78
        return $this->type;
79
    }
80
}
81