Completed
Push — master ( 539a8b...4613ab )
by Derek Stephen
05:17
created

BTCTradeAPI   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 38
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getBinanceExchange() 0 6 1
A setConfig() 0 4 1
A getConfig() 0 4 1
1
<?php
2
3
namespace Del;
4
5
use Del\Exchange\Binance;
6
use Del\Exchange\Config;
7
8
class BTCTradeAPI
9
{
10
    /** @var array */
11
    private $config;
12
13
    public function __construct(array $config)
14
    {
15
        $this->setConfig($config);
16
    }
17
18
    /**
19 2
     * @return string
20
     */
21 2
    public function getBinanceExchange()
22 2
    {
23
        $config = new Config($this->config['binance']);
24
25
        return new Binance($config);
26
    }
27 1
28
    /**
29 1
     * @param array $config
30 1
     */
31
    public function setConfig($config)
32
    {
33
        $this->config = $config;
34
    }
35
36 2
    /**
37
     * @return array
38 2
     */
39 2
    public function getConfig()
40
    {
41
        return $this->config;
42
    }
43
44
45
}