Test Failed
Pull Request — master (#13)
by Vladislav
09:26 queued 01:13
created

WalletBalanceResponseItem   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 79
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocked() 0 3 1
A getCoinId() 0 3 1
A getFree() 0 3 1
A __construct() 0 7 1
A getCoin() 0 3 1
A getTotal() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Spot\Account\WalletBalance\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Spot\Account\WalletBalance\Interfaces\IWalletBalanceResponseInterfaces;
7
use Carpenstar\ByBitAPI\Spot\Account\WalletBalance\Interfaces\IWalletBalanceResponseItemInterfaces;
8
9
class WalletBalanceResponseItem extends AbstractResponse implements IWalletBalanceResponseItemInterfaces
10
{
11
    /**
12
     * Coin
13
     * @var string $coin
14
     */
15
    private string $coin;
16
17
    /**
18
     * Coin ID
19
     * @var string $coinId
20
     */
21
    private string $coinId;
22
23
    /**
24
     * Total equity
25
     * @var float
26
     */
27
    private float $total;
28
29
    /**
30
     * Available balance
31
     * @var float
32
     */
33
    private float $free;
34
35
    /**
36
     * Reserved for orders
37
     * @var bool
38
     */
39
    private bool $locked;
40
41
    public function __construct(array $data)
42
    {
43
        $this->coin = $data['coin'];
44
        $this->coinId = $data['coinId'];
45
        $this->free = $data['free'];
46
        $this->total = $data['total'];
47
        $this->locked = $data['locked'];
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getCoin(): string
54
    {
55
        return $this->coin;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getCoinId(): string
62
    {
63
        return $this->coinId;
64
    }
65
66
    /**
67
     * @return float
68
     */
69
    public function getTotal(): float
70
    {
71
        return $this->total;
72
    }
73
74
    /**
75
     * @return float
76
     */
77
    public function getFree(): float
78
    {
79
        return $this->free;
80
    }
81
82
    /**
83
     * @return bool
84
     */
85
    public function getLocked(): bool
86
    {
87
        return $this->locked;
88
    }
89
}