Passed
Push — develop ( a27dd2...8f2abb )
by Edwin
03:09
created

Config   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 89
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getDomain() 0 4 1
A getKey() 0 4 1
A getSecret() 0 4 1
A getResources() 0 4 1
A getAccessToken() 0 4 1
1
<?php
2
3
namespace ShopifyClient;
4
5
class Config
6
{
7
    /**
8
     * @var string
9
     */
10
    private $domain;
11
12
    /**
13
     * @var string
14
     */
15
    private $key;
16
17
    /**
18
     * @var string
19
     */
20
    private $secret;
21
22
    /**
23
     * @var array
24
     */
25
    private $resources;
26
27
    /**
28
     * @var string
29
     */
30
    private $accessToken;
31
32
    /**
33
     * Config constructor.
34
     * @param string $domain
35
     * @param string $key
36
     * @param string $secret
37
     * @param array $resources
38
     * @param string|null $accessToken
39
     */
40 4
    public function __construct(
41
        string $domain,
42
        string $key,
43
        string $secret,
44
        array $resources = [],
45
        string $accessToken = null
46
    ) {
47 4
        $this->domain      = $domain;
48 4
        $this->key         = $key;
49 4
        $this->secret      = $secret;
50 4
        $this->resources   = $resources;
51 4
        $this->accessToken = $accessToken;
52 4
    }
53
54
    /**
55
     * @return string
56
     */
57 4
    public function getDomain(): string
58
    {
59 4
        return $this->domain;
60
    }
61
62
    /**
63
     * @return string
64
     */
65 3
    public function getKey(): string
66
    {
67 3
        return $this->key;
68
    }
69
70
    /**
71
     * @return string
72
     */
73 3
    public function getSecret(): string
74
    {
75 3
        return $this->secret;
76
    }
77
78
    /**
79
     * @return array
80
     */
81 4
    public function getResources(): array
82
    {
83 4
        return $this->resources;
84
    }
85
86
    /**
87
     * @return string|null
88
     */
89 4
    public function getAccessToken()
90
    {
91 4
        return $this->accessToken;
92
    }
93
}
94