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

BTCTradeAPI::getBinanceExchange()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
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
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
}