LiquidationResponseItem   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
c 0
b 0
f 0
dl 0
loc 40
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getSide() 0 3 1
A __construct() 0 7 1
A getUpdatedTime() 0 3 1
A getSize() 0 3 1
A getSymbol() 0 3 1
A getPrice() 0 3 1
1
<?php
2
namespace Carpenstar\ByBitAPI\WebSockets\Derivatives\PublicChannels\Liquidation\Entity;
3
4
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper;
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
7
class LiquidationResponseItem extends AbstractResponse
8
{
9
    private \DateTime $updatedTime;
10
    private string $symbol;
11
    private float $size;
12
    private float $price;
13
    private string $side;
14
15
    public function __construct(array $data)
16
    {
17
        $this->updatedTime = DateTimeHelper::makeFromTimestamp($data['updatedTime']);
18
        $this->symbol = $data['symbol'];
19
        $this->size = $data['size'];
20
        $this->price = $data['price'];
21
        $this->side = $data['side'];
22
    }
23
24
    public function getUpdatedTime(): \DateTime
25
    {
26
        return $this->updatedTime;
27
    }
28
29
    public function getSymbol(): string 
30
    {
31
        return $this->symbol;
32
    }
33
34
    public function getSize(): float
35
    {
36
        return $this->size;
37
    }
38
39
    public function getPrice(): float
40
    {
41
        return $this->price;
42
    }
43
44
    public function getSide(): string
45
    {
46
        return $this->side;
47
    }
48
}
49