Test Failed
Push — master ( e2e181...baee16 )
by Fabian
02:01
created

TradeBalanceResponse   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 113
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 113
rs 10
c 0
b 0
f 0
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getCostBasis() 0 3 1
A getUnrealizedNetProfitLoss() 0 3 1
A getEquivavlentBalance() 0 3 1
A getCurrentFloatingValuation() 0 3 1
A manualMapping() 0 10 1
A getEquity() 0 3 1
A getTradeBalance() 0 3 1
A getFreeMargin() 0 3 1
A getMarginAmount() 0 3 1
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\TradeBalance;
4
5
use HanischIt\KrakenApi\Model\ResponseInterface;
6
use Model\OHLCData\OHLCDataModel;
0 ignored issues
show
Bug introduced by
The type Model\OHLCData\OHLCDataModel was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * Class TradeBalanceResponse
10
 * @package HanischIt\KrakenApi\Model\TradeBalance
11
 */
12
class TradeBalanceResponse implements ResponseInterface
13
{
14
    /**
15
     * @var float
16
     */
17
    private $equivavlentBalance;
18
    /**
19
     * @var float
20
     */
21
    private $tradeBalance;
22
    /**
23
     * @var float
24
     */
25
    private $marginAmount;
26
    /**
27
     * @var float
28
     */
29
    private $unrealizedNetProfitLoss;
30
    /**
31
     * @var float
32
     */
33
    private $costBasis;
34
    /**
35
     * @var float
36
     */
37
    private $currentFloatingValuation;
38
    /**
39
     * @var float
40
     */
41
    private $equity;
42
    /**
43
     * @var float
44
     */
45
    private $freeMargin;
46
47
48
    /**
49
     * @param array $data
50
     */
51
    public function manualMapping($data)
52
    {
53
        $this->equivavlentBalance = $data["eb"];
54
        $this->tradeBalance = $data["tb"];
55
        $this->marginAmount = $data["m"];
56
        $this->unrealizedNetProfitLoss = $data["n"];
57
        $this->costBasis = $data["c"];
58
        $this->currentFloatingValuation = $data["v"];
59
        $this->equity = $data["e"];
60
        $this->freeMargin = $data["mf"];
61
    }
62
63
    /**
64
     * @return float
65
     */
66
    public function getEquivavlentBalance()
67
    {
68
        return $this->equivavlentBalance;
69
    }
70
71
    /**
72
     * @return float
73
     */
74
    public function getTradeBalance()
75
    {
76
        return $this->tradeBalance;
77
    }
78
79
    /**
80
     * @return float
81
     */
82
    public function getMarginAmount()
83
    {
84
        return $this->marginAmount;
85
    }
86
87
    /**
88
     * @return float
89
     */
90
    public function getUnrealizedNetProfitLoss()
91
    {
92
        return $this->unrealizedNetProfitLoss;
93
    }
94
95
    /**
96
     * @return float
97
     */
98
    public function getCostBasis()
99
    {
100
        return $this->costBasis;
101
    }
102
103
    /**
104
     * @return float
105
     */
106
    public function getCurrentFloatingValuation()
107
    {
108
        return $this->currentFloatingValuation;
109
    }
110
111
    /**
112
     * @return float
113
     */
114
    public function getEquity()
115
    {
116
        return $this->equity;
117
    }
118
119
    /**
120
     * @return float
121
     */
122
    public function getFreeMargin()
123
    {
124
        return $this->freeMargin;
125
    }
126
}
127