Config::getSecret()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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
}