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

PurchaseRedeemHistoryResponseItem::getOrderTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
namespace Carpenstar\ByBitAPI\Spot\LeverageToken\PurchaseRedeemHistory\Response;
3
4
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper;
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Spot\LeverageToken\PurchaseRedeemHistory\Interfaces\IPurchaseReedemHistoryResponseItemInterface;
7
8
class PurchaseRedeemHistoryResponseItem extends AbstractResponse implements IPurchaseReedemHistoryResponseItemInterface
9
{
10
    /**
11
     * Actual purchase quantity of the ETP
12
     * @var float $amount
13
     */
14
    private float $amount;
15
16
    /**
17
     * Last update time of the order status
18
     * @var \DateTime $execTime
19
     */
20
    private \DateTime $execTime;
21
22
    /**
23
     * Trading fees
24
     * @var float $fee
25
     */
26
    private float $fee;
27
28
    /**
29
     * Abbreviation of the LT
30
     * @var string $ltCode
31
     */
32
    private string $ltCode;
33
34
    /**
35
     * Order ID
36
     * @var string $orderId
37
     */
38
    private string $orderId;
39
40
    /**
41
     * Order status. 1: Completed; 2: In progress; 3: Failed
42
     * @var int $orderStatus
43
     */
44
    private int $orderStatus;
45
46
    /**
47
     * Order time
48
     * @var \DateTime $orderTime
49
     */
50
    private \DateTime $orderTime;
51
52
    /**
53
     * Order type; 1. Purchase; 2. Redemption
54
     * @var int $orderType
55
     */
56
    private int $orderType;
57
58
    /**
59
     * Serial number
60
     * @var string $serialNo
61
     */
62
    private string $serialNo;
63
64
    /**
65
     * Filled value
66
     * @var float $value
67
     */
68
    private float $value;
69
70
    /**
71
     * Quote asset
72
     * @var string $valueCoin
73
     */
74
    private string $valueCoin;
75
76
77
    public function __construct(array $data)
78
    {
79
        $this->amount = (float) $data['amount'];
80
        $this->execTime = DateTimeHelper::makeFromTimestamp((int) $data['excTime']);
81
        $this->fee = (float) $data['fee'];
82
        $this->ltCode = $data['ltCode'];
83
        $this->orderId = $data['orderId'];
84
        $this->orderStatus = $data['orderStatus'];
85
        $this->orderTime = DateTimeHelper::makeFromTimestamp((int) $data['orderTime']);
86
        $this->orderType = $data['orderType'];
87
        $this->serialNo = $data['serialNo'];
88
        $this->value = (float) $data['value'];
89
        $this->valueCoin = $data['valueCoin'];
90
    }
91
92
    /**
93
     * @return float
94
     */
95
    public function getAmount(): float
96
    {
97
        return $this->amount;
98
    }
99
100
    /**
101
     * @return \DateTime
102
     */
103
    public function getExecTime(): \DateTime
104
    {
105
        return $this->execTime;
106
    }
107
108
    /**
109
     * @return float
110
     */
111
    public function getFee(): float
112
    {
113
        return $this->fee;
114
    }
115
116
    /**
117
     * @return string
118
     */
119
    public function getLtCode(): string
120
    {
121
        return $this->ltCode;
122
    }
123
124
    /**
125
     * @return string
126
     */
127
    public function getOrderId(): string
128
    {
129
        return $this->orderId;
130
    }
131
132
    /**
133
     * @return int
134
     */
135
    public function getOrderStatus(): int
136
    {
137
        return $this->orderStatus;
138
    }
139
140
    /**
141
     * @return \DateTime
142
     */
143
    public function getOrderTime(): \DateTime
144
    {
145
        return $this->orderTime;
146
    }
147
148
    /**
149
     * @return int
150
     */
151
    public function getOrderType(): int
152
    {
153
        return $this->orderType;
154
    }
155
156
    /**
157
     * @return string
158
     */
159
    public function getSerialNo(): string
160
    {
161
        return $this->serialNo;
162
    }
163
164
    /**
165
     * @return float
166
     */
167
    public function getValue(): float
168
    {
169
        return $this->value;
170
    }
171
172
    /**
173
     * @return string
174
     */
175
    public function getValueCoin(): string
176
    {
177
        return $this->valueCoin;
178
    }
179
}