AddOrderResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTxid() 0 3 1
A manualMapping() 0 5 2
A getDescr() 0 3 1
1
<?php
2
3
namespace HanischIt\KrakenApi\Call\AddOrder;
4
5
use HanischIt\KrakenApi\Model\ResponseInterface;
6
7
/**
8
 * Class AddOrderResponse
9
 *
10
 * @package HanischIt\KrakenApi\Model\AddOrderResponse
11
 */
12
class AddOrderResponse implements ResponseInterface
13
{
14
15
    /**
16
     * order description info
17
     *
18
     * @var array
19
     */
20
    private $descr;
21
22
    /**
23
     * Transaction id
24
     *
25
     * @var string
26
     */
27
    private $txid;
28
29
    /**
30
     * @param array $result
31
     */
32 1
    public function manualMapping($result)
33
    {
34 1
        $this->descr = $result['descr']['order'];
35 1
        if(isset($result['txid'])) {
36 1
            $this->txid = $result['txid'][0];
37 1
        }
38 1
    }
39
40
41
    /**
42
     * @return array
43
     */
44 1
    public function getDescr()
45
    {
46 1
        return $this->descr;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getTxid()
53
    {
54 1
        return $this->txid;
55
    }
56
}
57