Config   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 35
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
A getKey() 0 4 1
A getSecret() 0 4 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 10/09/15
5
 * Time: 15:47
6
 */
7
8
namespace Del\Exchange;
9
10
11
use InvalidArgumentException;
12
13
class Config
14
{
15
    private $key;
16
    private $secret;
17
18
    /**
19
     * @param array $config
20
     */
21 11
    public function __construct(array $config)
22
    {
23 11
        if(!isset($config['key']) || !isset($config['secret'])) {
24 1
            throw new InvalidArgumentException('Array does not contain both key and secret.');
25
        }
26 11
        $this->key = $config['key'];
27 11
        $this->secret = $config['secret'];
28 11
    }
29
30
    /**
31
     * @return string
32
     */
33 8
    public function getKey()
34
    {
35 8
        return $this->key;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 8
    public function getSecret()
42
    {
43 8
        return $this->secret;
44
    }
45
46
47
}