InstrumentInfoResponseItem::getShowStatus()   A
last analyzed

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
3
namespace Carpenstar\ByBitAPI\Spot\MarketData\InstrumentInfo\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Spot\MarketData\InstrumentInfo\Interfaces\IInstrumentInfoResponseItemInterface;
7
8
class InstrumentInfoResponseItem extends AbstractResponse implements IInstrumentInfoResponseItemInterface
9
{
10
    /**
11
     * Name of the trading pair
12
     * @var string $name
13
     */
14
    private string $name;
15
16
    /**
17
     * Alias
18
     * @var string $alias
19
     */
20
    private string $alias;
21
22
    /**
23
     * Base currency
24
     * @var string $baseCoin
25
     */
26
    private string $baseCoin;
27
28
    /**
29
     * Quote currency
30
     * @var string $quoteCoin
31
     */
32
    private string $quoteCoin;
33
34
    /**
35
     * Decimal precision (base currency)
36
     * @var float $basePrecision
37
     */
38
    private float $basePrecision;
39
40
    /**
41
     * Decimal precision (quote currency)
42
     * @var float $quotePrecision
43
     */
44
    private float $quotePrecision;
45
46
    /**
47
     * Min. order qty (Not valid for market buy orders)
48
     * @var float $minTradeQty
49
     */
50
    private float $minTradeQty;
51
52
    /**
53
     * Min. order value (Only valid for market buy orders)
54
     * @var float $minTradeAmt
55
     */
56
    private float $minTradeAmt;
57
58
    /**
59
     * Min. number of decimal places
60
     * @var float $minPricePrecision
61
     */
62
    private float $minPricePrecision;
63
64
    /**
65
     * Max. order qty (It is ignored when you place an order with order type LIMIT_MAK
66
     * @var float $maxTradeQty
67
     */
68
    private float $maxTradeQty;
69
70
    /**
71
     * Max. order value (It is ignored when you place an order with order type LIMIT_MAKER)
72
     * @var float $maxTradeAmt
73
     */
74
    private float $maxTradeAmt;
75
76
    /**
77
     * Category
78
     * @var int $category
79
     */
80
    private int $category;
81
82
    /**
83
     * Indicates that the price of this currency is relatively volatile
84
     * @var int $innovation
85
     */
86
    private int $innovation;
87
88
    /**
89
     * Indicates that the symbol open for trading
90
     * @var int $showStatus
91
     */
92
    private int $showStatus;
93
94
    /**
95
     * @param array $data
96
     */
97
    public function __construct(array $data)
98
    {
99
        $this
100
            ->setName($data['name'])
101
            ->setAlias($data['alias'])
102
            ->setBaseCoin($data['baseCoin'])
103
            ->setQuoteCoin($data['quoteCoin'])
104
            ->setBasePrecision($data['basePrecision'])
105
            ->setQuotePrecision($data['quotePrecision'])
106
            ->setMinTradeQty($data['minTradeQty'])
107
            ->setMinTradeAmt($data['minTradeAmt'])
108
            ->setMaxTradeQty($data['maxTradeQty'])
109
            ->setMaxTradeAmt($data['maxTradeAmt'])
110
            ->setMinPricePrecision($data['minPricePrecision'])
111
            ->setCategory($data['category'])
112
            ->setShowStatus($data['showStatus'])
113
            ->setInnovation($data['innovation']);
114
    }
115
116
    /**
117
     * @param string $name
118
     * @return $this
119
     */
120
    private function setName(string $name): self
121
    {
122
        $this->name = $name;
123
        return $this;
124
    }
125
126
    /**
127
     * @return string
128
     */
129
    public function getName(): string
130
    {
131
        return $this->name;
132
    }
133
134
    /**
135
     * @param string $alias
136
     * @return $this
137
     */
138
    private function setAlias(string $alias): self
139
    {
140
        $this->alias = $alias;
141
        return $this;
142
    }
143
144
    /**
145
     * @return string
146
     */
147
    public function getAlias(): string
148
    {
149
        return $this->alias;
150
    }
151
152
    /**
153
     * @param string $baseCoin
154
     * @return $this
155
     */
156
    private function setBaseCoin(string $baseCoin): self
157
    {
158
        $this->baseCoin = $baseCoin;
159
        return $this;
160
    }
161
162
    /**
163
     * @return string
164
     */
165
    public function getBaseCoin(): string
166
    {
167
        return $this->baseCoin;
168
    }
169
170
    /**
171
     * @param string $quoteCoin
172
     * @return $this
173
     */
174
    private function setQuoteCoin(string $quoteCoin): self
175
    {
176
        $this->quoteCoin = $quoteCoin;
177
        return $this;
178
    }
179
180
    /**
181
     * @return string
182
     */
183
    public function getQuoteCoin(): string
184
    {
185
        return $this->quoteCoin;
186
    }
187
188
    /**
189
     * @param float $basePrecision
190
     * @return $this
191
     */
192
    private function setBasePrecision(float $basePrecision): self
193
    {
194
        $this->basePrecision = $basePrecision;
195
        return $this;
196
    }
197
198
    /**
199
     * @return float
200
     */
201
    public function getBasePrecision(): float
202
    {
203
        return $this->basePrecision;
204
    }
205
206
    /**
207
     * @param float $quotePrecision
208
     * @return $this
209
     */
210
    private function setQuotePrecision(float $quotePrecision): self
211
    {
212
        $this->quotePrecision = $quotePrecision;
213
        return $this;
214
    }
215
216
    /**
217
     * @return float
218
     */
219
    public function getQuotePrecision(): float
220
    {
221
        return $this->quotePrecision;
222
    }
223
224
    /**
225
     * @param float $minTradeQty
226
     * @return $this
227
     */
228
    private function setMinTradeQty(float $minTradeQty): self
229
    {
230
        $this->minTradeQty = $minTradeQty;
231
        return $this;
232
    }
233
234
    /**
235
     * @return float
236
     */
237
    public function getMinTradeQty(): float
238
    {
239
        return $this->minTradeQty;
240
    }
241
242
    /**
243
     * @param float $minTradeAmt
244
     * @return $this
245
     */
246
    private function setMinTradeAmt(float $minTradeAmt): self
247
    {
248
        $this->minTradeAmt = $minTradeAmt;
249
        return $this;
250
    }
251
252
    /**
253
     * @return float
254
     */
255
    public function getMinTradeAmt(): float
256
    {
257
        return $this->minTradeAmt;
258
    }
259
260
    /**
261
     * @param float $maxTradeQty
262
     * @return $this
263
     */
264
    private function setMaxTradeQty(float $maxTradeQty): self
265
    {
266
        $this->maxTradeQty = $maxTradeQty;
267
        return $this;
268
    }
269
270
    /**
271
     * @return float
272
     */
273
    public function getMaxTradeQty(): float
274
    {
275
        return $this->maxTradeQty;
276
    }
277
278
    /**
279
     * @param float $maxTradeAmt
280
     * @return $this
281
     */
282
    private function setMaxTradeAmt(float $maxTradeAmt): self
283
    {
284
        $this->maxTradeAmt = $maxTradeAmt;
285
        return $this;
286
    }
287
288
    /**
289
     * @return int
290
     */
291
    public function getMaxTradeAmt(): int
292
    {
293
        return $this->maxTradeAmt;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->maxTradeAmt returns the type double which is incompatible with the type-hinted return integer.
Loading history...
294
    }
295
296
    /**
297
     * @param float $minPricePrecision
298
     * @return $this
299
     */
300
    private function setMinPricePrecision(float $minPricePrecision): self
301
    {
302
        $this->minPricePrecision = $minPricePrecision;
303
        return $this;
304
    }
305
306
    /**
307
     * @return float
308
     */
309
    public function getMinPricePrecision(): float
310
    {
311
        return $this->minPricePrecision;
312
    }
313
314
    /**
315
     * @param int $category
316
     * @return $this
317
     */
318
    private function setCategory(int $category): self
319
    {
320
        $this->category = $category;
321
        return $this;
322
    }
323
324
    /**
325
     * @return int
326
     */
327
    public function getCategory(): int
328
    {
329
        return $this->category;
330
    }
331
332
    /**
333
     * @param int $showStatus
334
     * @return $this
335
     */
336
    private function setShowStatus(int $showStatus): self
337
    {
338
        $this->showStatus = $showStatus;
339
        return $this;
340
    }
341
342
    /**
343
     * @return int
344
     */
345
    public function getShowStatus(): int
346
    {
347
        return $this->showStatus;
348
    }
349
350
    /**
351
     * @param int $innovation
352
     * @return $this
353
     */
354
    private function setInnovation(int $innovation): self
355
    {
356
        $this->innovation = $innovation;
357
        return $this;
358
    }
359
360
    /**
361
     * @return int
362
     */
363
    public function getInnovation(): int
364
    {
365
        return $this->innovation;
366
    }
367
}
368