Test Failed
Push — master ( f1d563...1fab6c )
by Vladislav
10:20 queued 07:53
created

WalletBalanceResponseItem   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 145
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 43
dl 0
loc 145
rs 10
c 1
b 0
f 0
wmc 15

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getAccountIM() 0 3 1
A getOrderMargin() 0 3 1
A getAvailableBalance() 0 3 1
A getEquity() 0 3 1
A getWalletBalance() 0 3 1
A __construct() 0 16 1
A getPositionMargin() 0 3 1
A getServiceCash() 0 3 1
A getUnrealisedPnl() 0 3 1
A getCoin() 0 3 1
A getGivenCash() 0 3 1
A getOccClosingFee() 0 3 1
A getOccFundingFee() 0 3 1
A getCumRealisedPnl() 0 3 1
A getAccountMM() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Account\WalletBalance\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\WalletBalance\Interfaces\IWalletBalanceResponseItemInterface;
7
8
class WalletBalanceResponseItem extends AbstractResponse implements IWalletBalanceResponseItemInterface
9
{
10
    private string $coin;
11
    private float $equity;
12
    private float $walletBalance;
13
    private float $positionMargin;
14
    private float $availableBalance;
15
    private float $orderMargin;
16
    private float $occClosingFee;
17
    private float $occFundingFee;
18
    private float $unrealisedPnl;
19
    private float $cumRealisedPnl;
20
    private float $givenCash;
21
    private float $serviceCash;
22
    private float $accountIM;
23
    private float $accountMM;
24
25
    public function __construct(array $data)
26
    {
27
        $this->coin = $data['coin'];
28
        $this->equity = $data['equity'];
29
        $this->walletBalance = (float) $data['walletBalance'];
30
        $this->positionMargin = (float) $data['positionMargin'];
31
        $this->availableBalance = (float) $data['availableBalance'];
32
        $this->orderMargin = (float) $data['orderMargin'];
33
        $this->occClosingFee = (float) $data['occClosingFee'];
34
        $this->occFundingFee = (float) $data['occFundingFee'];
35
        $this->unrealisedPnl = (float) $data['unrealisedPnl'];
36
        $this->cumRealisedPnl = (float) $data['cumRealisedPnl'];
37
        $this->givenCash = (float) $data['givenCash'];
38
        $this->serviceCash = (float) $data['serviceCash'];
39
        $this->accountIM = (float) $data['accountIM'];
40
        $this->accountMM = (float) $data['accountMM'];
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getCoin(): string
47
    {
48
        return $this->coin;
49
    }
50
51
    /**
52
     * @return float
53
     */
54
    public function getEquity(): float
55
    {
56
        return $this->equity;
57
    }
58
59
    /**
60
     * @return float
61
     */
62
    public function getWalletBalance(): float
63
    {
64
        return $this->walletBalance;
65
    }
66
67
    /**
68
     * @return float
69
     */
70
    public function getPositionMargin(): float
71
    {
72
        return $this->positionMargin;
73
    }
74
75
    /**
76
     * @return float
77
     */
78
    public function getAvailableBalance(): float
79
    {
80
        return $this->availableBalance;
81
    }
82
83
    /**
84
     * @return float
85
     */
86
    public function getOrderMargin(): float
87
    {
88
        return $this->orderMargin;
89
    }
90
91
    /**
92
     * @return float
93
     */
94
    public function getOccClosingFee(): float
95
    {
96
        return $this->occClosingFee;
97
    }
98
99
    /**
100
     * @return float
101
     */
102
    public function getOccFundingFee(): float
103
    {
104
        return $this->occFundingFee;
105
    }
106
107
    /**
108
     * @return float
109
     */
110
    public function getUnrealisedPnl(): float
111
    {
112
        return $this->unrealisedPnl;
113
    }
114
115
    /**
116
     * @return float
117
     */
118
    public function getCumRealisedPnl(): float
119
    {
120
        return $this->cumRealisedPnl;
121
    }
122
123
    /**
124
     * @return float
125
     */
126
    public function getGivenCash(): float
127
    {
128
        return $this->givenCash;
129
    }
130
131
    /**
132
     * @return float
133
     */
134
    public function getServiceCash(): float
135
    {
136
        return $this->serviceCash;
137
    }
138
139
    /**
140
     * @return string
141
     */
142
    public function getAccountIM(): float
143
    {
144
        return $this->accountIM;
145
    }
146
147
    /**
148
     * @return string
149
     */
150
    public function getAccountMM(): float
151
    {
152
        return $this->accountMM;
153
    }
154
}