Test Failed
Pull Request — master (#4)
by Vladislav
14:06 queued 06:14
created

OrderBookPriceItemResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getQuantity() 0 3 1
A getPrice() 0 3 1
A setQuantity() 0 4 1
A setPrice() 0 4 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\OrderBook\Dto;
3
4
use Carpenstar\ByBitAPI\Core\Objects\ResponseEntity;
5
6
class OrderBookPriceItemResponse extends ResponseEntity
7
{
8
    /**
9
     * @var float $price
10
     */
11
    private float $price;
12
13
    /**
14
     * @var float $quantity
15
     */
16
    private float $quantity;
17
18
    public function __construct(array $data)
19
    {
20
21
        $this
22
            ->setPrice($data[0])
23
            ->setQuantity($data[1]);
24
    }
25
26
    /**
27
     * @param float $price
28
     * @return self
29
     */
30
    private function setPrice(float $price): self
31
    {
32
        $this->price = $price;
33
        return $this;
34
    }
35
36
    /**
37
     * @return float
38
     */
39
    public function getPrice(): float
40
    {
41
        return $this->price;
42
    }
43
44
    /**
45
     * @param float $quantity
46
     * @return self
47
     */
48
    private function setQuantity(float $quantity): self
49
    {
50
        $this->quantity = $quantity;
51
        return $this;
52
    }
53
54
    /**
55
     * @return float
56
     */
57
    public function getQuantity(): float
58
    {
59
        return $this->quantity;
60
    }
61
}